Unit 3d-models vanishing

Tiramisu

Warlord
Joined
Aug 16, 2013
Messages
148
Location
Leonberg (BW, Germany)
I have created a mod that increases the max hitpoints of units to 200. Now the unit models are vanishing when a unit has more than 100 damage. Normally 100 damage would mean that a unit dies anyway, but in my mod they can still be alive. The problem is that their 3D-modelling is not updated correctly.
This graphical bug sometimes also causes city buildings to vanish.
Spoiler :
DE21156D97889D314538D43A155E7CBD83D25980


So is there anyone who can help me? I have no clue how this graphical modelling works.
 
This sounds and looks like a game-engine issue on the 3d animations for units, etc.

They are all written in the base code under the assumption that a unit has 100 hitpoints and they aren't written to handle such a thing as more than 100 damage to a unit.

I wouldn't call it a glitch so much as you're attempting something the game's code was not even remotely written to handle.
 
I see. It is just surprising to me that the 3D-modelling-team in Firaxis simply used a hardcoded value. If the game was not made for changing the max hitpoints, then I wonder why they even gave modders the possibility to change COMBAT_MAX_HIT_POINTS in GlobalParameters.xml.
Also the UI-team apparently did not hardcode the maximum hitpoints, because e.g. in UnitFlagManager.lua you can see code snippets like
Code:
local maxDamage = pUnit:GetMaxDamage()
Code:
healthPercent = math.max( math.min( (maxDamage - pUnit:GetDamage()) / maxDamage, 1 ), 0 );



Anyway, it would be a possible workaround if I set the max hitpoints back to 100 and reduced the damage in all combats by 50%, but I dont exactly know how to do that.
In GlobalParameters.xml I found some values that might help me to achieve this:
Code:
<Replace Name="COMBAT_BASE_DAMAGE" Value="24" />
<Replace Name="COMBAT_MAX_EXTRA_DAMAGE" Value="12" />

<Replace Name="COMBAT_DAMAGE_MULTIPLIER_MINIMUM" Value="0.25" />
<Replace Name="COMBAT_DEFENSE_DAMAGE_PERCENT_BOMBARD" Value="100" />
<Replace Name="COMBAT_DEFENSE_DAMAGE_PERCENT_MELEE" Value="15" />
<Replace Name="COMBAT_DEFENSE_DAMAGE_PERCENT_RANGED" Value="50" />
Now I wonder how I should change these values. How exactly is the combat damage calculated in the game?
 
Back
Top Bottom