City hitpoint buildings have no effect in loaded games

Thalassicus

Bytes and Nibblers
Joined
Nov 9, 2005
Messages
11,057
Location
Texas
Buildings like walls that increase maximum city hitpoints appear to have no effect in loaded games.

  1. Start a new game.
  2. Found the capital.
  3. Place walls using the tuner.
  4. Save the game.
  5. Set the tuner console state to WorldView.
  6. Enter this command:
    print(tostring(Players[Game.GetActivePlayer()]:GetCapitalCity():GetMaxHitPoints()))
  7. Exit to the main menu.
  8. Load the saved game.
  9. Re-enter the command from step #6.

Here is the output:

Code:
> print(tostring(Players[Game.GetActivePlayer()]:GetCapitalCity():GetMaxHitPoints()))
 WorldView: [B]250[/B]

> print(tostring(Players[Game.GetActivePlayer()]:GetCapitalCity():GetMaxHitPoints()))
 WorldView: [B]200[/B]

I also tested this in combat situations, and it appears this is not simply a visual bug. The walls have no effect.

QA probably missed this because the UI designer did not show city hitpoints as a number in an easily visible location. Good places to show city hitpoints are the tooltips for: city strength, city tile, and/or city banner, especially for damaged cities.
 
I didn't remember seeing this in the fall patch or the hot fix, so no. I doubt they were even aware of it as they don't have any UI function that calls up the data to check for it as Thal said.

In the base game it's not a huge deal as the later buildings add almost insignificant hit points (substantial total, but trivial in late-game combat). I believe it's +125 max? That's bad enough.

Modding the buildings to add more HP makes them more important defensively, so it's very important to fix for that. It becomes very noticeable if a city is supposed to have, say, 750 hit points instead of 300.

The game does add the HP correctly when walls are constructed or acquired so it's mostly a question of getting the game to save this data or be able to restore it via the same process (looking for HP adding buildings).
 
I just realized something interesting:

  1. Build a city with defensive buildings.
  2. Save and reload the game.
  3. City captured in war, defense buildings destroyed, health drops by -125.
  4. Steps 1-3 happen again.

The city now has negative maximum health, and instantly dies from attacks. :lol:
 
I just noticed that when I loaded a game, my city (which was under siege) dropped lower in health than it should be - I thought the problem was that the game "forgot" to apply the healing of that turn, but most likely this was the issue. This is a pretty ugly bug, as it means defensive buildings lose most of their value as soon as you quit the game first time? :eek:
 
Top Bottom