Alternative voxels for damaged states

Bug #895725 reported by Renegade
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Issue #bug:295 is a (suspended) mashup of voxel requests, half of which are silly. However, the suggestion of alternative voxels for damaged units is a good one.

Buildings already have a different image when damaged, as do cyborgs. It would increase the general "credibility" and atmosphere of the game if tanks, ships and aircraft did, too - particularly since they already smoke when damaged, and it does look kind of curious that a visually perfectly fine tank would suddenly start smoking, yet have no dent from the barrage of shells it just endured.

Usage-wise, it should be as simple as
Where SOMETANK would simply replace the unit's current image data, turret and all.

If it makes no difference in effort, it would probably be wise to implement this as DamagedImage=SOMEGFX for use with infantry or other SHP-based units as well.

Implementation-wise, there must be a periodic check for damaged state anyway, in order to trigger smoke, sparks and alternative images on tanks and cyborgs.
An implementation could/should be as simple as adding a hook to the end of that and triggering a reload of the object's image data, replacing it with the one specified in the INI.

Given that both NoSpawnAlt=yes and WaterVoxel already do such state-dependent voxel changes, this shouldn't be too hard.

If the check provides enough data, we could think about doing DamagedImage=YELLOWGFX,REDGFX for the different damage states, but simplicity should rule here - if the check only differentiates between damage/no damage, we should go with that. It's unlikely the majority of modders would create three voxels per tank anyway.
Should there be two states, the yellow state should be used if no red state is defined.

Revision history for this message
WoRmINaToR (worminator) wrote :

I think we should go for simplicity here, however, given that (at least i'm pretty sure) structures already have checks for both yellow and red health states, this could definitely be possible on units.

However, what you said above still stands regardless-- it's unlikely anyone would draw up 3 different voxels for a single unit, just for 3 different damage states.

-"If it makes no difference in effort, it would probably be wise to implement this as DamagedImage=SOMEGFX for use with infantry or other SHP-based units as well."

I also support this being possible for the SHP based and non-vehicle techtypes, infantry and aircraft (and also for SHP vehicles of course).

Revision history for this message
DCoder DCoder (dcoder1337) wrote :

You can simply extend amphibious APC water image change logic here, at least for UnitTypes. As it is, it's implemented in UnloadingClass= style - you specify a separate UnitType to display in a specific state and TechnoExt::ExtData::GetUnitType() returns that UnitType * if it's applicable at the moment. Just add a new UnitTypeClass * DamagedImage attribute to TechnoTypeExt::ExtData, and add code to GetUnitType() to return that if the unit is damaged. Interactions with WaterImage are left as an exercise to the implementer.

Note that it will be a bit more complex to make it work for other object types as those aren't hooked up yet. And we'll need to think about interference with bug:328.

Revision history for this message
Renegade (renegade) wrote :

I'm setting this to invalid as I've converted it into a blueprint, which is the proper procedure for feature requests now. The blueprint is linked in the sidebar.

Changed in ares:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.