Modding CITY_HIT_POINTS_HEALED_PER_TURN

Orion66

Master of Orion
Joined
Feb 9, 2003
Messages
371
Location
POLAND
Hi,

I modified (as usual) for my need GlobalDefines.xml
I have edited CITY_HIT_POINTS_HEALED_PER_TURN to make it 1 point per turn. But in the game AI cites heals 2 points per turn.
Am I missing something? Before patch there was no problems with this. But now there seems to be some kind of bug?
 
Check to see if this change (or lack of it) applies to your cities too. Start Diety Duel map with many civs and declare war on all, let them attack your capital and see how much you replenish per turn. I have a feeling that Firaxis has two different entries for city regen, one entry for your cities and another for the AI.

On a related note, I have been having issues changing maritime food bonuses. I have a feeling that our problems may be related.
 
speaking of healing hp per turn, HOW FREAKIN' HARD IS IT TO UPDATE THE CIVILOPEDIA??? seriously, why don't walls/etc tell us that they're healing 1hp/turn? does it take a phd in computer engineering to update text in the civilopedia??? /rant
 
heh, well I can empathize them, updating text is really boring! I had 2 or 3 versions where MM didn't have the appropriate texts for social policies cause I didn't feel like it.
 
heh, well I can empathize them, updating text is really boring! I had 2 or 3 versions where MM didn't have the appropriate texts for social policies cause I didn't feel like it.

This is ok for modders who do it in their free time but it's unprofessional, so a no-no for game developers.

Actually, where is the additional wall healing speed defined? I can't see anything in buildings, building classes or global defines. Hope it's not hardcoded
 
Hi,

I modified (as usual) for my need GlobalDefines.xml
I have edited CITY_HIT_POINTS_HEALED_PER_TURN to make it 1 point per turn. But in the game AI cites heals 2 points per turn.
Am I missing something? Before patch there was no problems with this. But now there seems to be some kind of bug?

It appears to only change the rate at which the players cities heal, AI still heals at the 2+ per turn. A related question is where is the heal bonus for walls and castles shown in the XML...
 
It certainly seems so. Adding a defense value onto the monument causes the monument to increase the healing rate. In limited testing I would say it's some proportion of Defense value complicated by rounding with an overall cap of +3 extra.
 
It certainly seems so. Adding a defense value onto the monument causes the monument to increase the healing rate. In limited testing I would say it's some proportion of Defense value complicated by rounding with an overall cap of +3 extra.

Does anyone have a notion how much the different buildings add? Walls have 5 defense, castle 7.5, do both maybe just add 1 hp per turn?
 
Does anyone have a notion how much the different buildings add? Walls have 5 defense, castle 7.5, do both maybe just add 1 hp per turn?
It's basically 1 each for the standard early buildings. My rough test results:
Code:
Buildings     Def  Heal
None          0    +2
Palace        2.5  +3
Walls         5    +3
Palace+Walls  7.5  +4
Castle        7.5  +3
Palace+Castle 10   +5 ??
Walls+Castle  12.5 +4 ?? 
Pal+Wal+Cast  15   +5
Mod Monument  20   +5
Pal+Wal+Cast
 +Mod Monum   35   +5
There might have been a transcription error with one or both of the ones marked '??' because those don't make sense. I wasn't testing too rigorously so I ignored the Mughal Fort and Military Base and probably other possible combinations.
 
Alright, I did more extensive testing on this today. Here are my findings:

First of all, CITY_HIT_POINTS_HEALED_PER_TURN does apply to both AI and Human civs. The reason it may not have appeared so at first is probably because of the special capital bonus (see below).

This is how the amount of city healing appears to be determined:
  • Base is CITY_HIT_POINTS_HEALED_PER_TURN
  • Add 1 if city is a Major Civ capital
  • Now take the sum of the defense values of all buildings in the city (including any bonuses such as from the Kremlin), divide by 5, and floor (i.e. round down.) Add this value.
  • Finally, cap the healing at 5 HP.

Most of this appears to be DLL-hardcoding. I have no idea where the capital bonus comes from, but I've described it as best I can; since minor civs don't get it, it's not attached to the Palace or simply being a capital. Similarly the 5 HP hard cap appears to be hardcoded too as it doesn't vary with adjustments to either CITY_HIT_POINTS_HEALED_PER_TURN or MAX_CITY_HIT_POINTS.

Some examples:

1) Major capital with Walls will heal 4 HP per turn:
  • 2 base
  • 1 for being a Major Civ capital
  • 1 for defense; Palace + Walls provide 7.5 def and floor(7.5/5) = 1

2) CS capital with no extra buildings will heal 2 HP per turn:
  • 2 base
  • 0 for not being a Major Civ capital
  • 0 for defense; Palace provides 2.5 def and floor(2.5/5) = 0

3) Non-capital with Walls + Mughal Fort in an empire with the Kremlin will heal 5 HP per turn:
  • 2 base
  • 0 for not being a Major Civ capital
  • 4 for defense; Walls (5) + Mughal Fort (9) provide 14, adjusted to 14*1.5=21 with Kremlin and floor(21/5) = 4
  • Total reduced to 5 because of cap
 
What is strange is that <HealRateChange> is in CIV5Buildings.xml (and has been since 1.0.0.20 - I have all versions of the XML) and isn't used... If it works or not is something else, some 'schema' appear to be disabled in other files (e.g. - <HiddenNationality>)
 
What is strange is that <HealRateChange> is in CIV5Buildings.xml (and has been since 1.0.0.20 - I have all versions of the XML) and isn't used... If it works or not is something else, some 'schema' appear to be disabled in other files (e.g. - <HiddenNationality>)

This is probably meant to change unit heal rate in cities. All of the fields I've tested so far work, even though not all are used by the game. I'd rather expect the fields that are there are things they implemented but removed during development for one reason or another, so it's a good idea to test them thoroughly.
 
Top Bottom