HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...
Bug #892050
opengold_upkeep_style Mixed doesn't seem to work as advertised
0%
Description
The description for gold_upkeep_style Mixed in the comments of game.ruleset [1] goes:
; "Mixed" - In the first step, the player`s total gold must be non-negative
; after paying upkeep for all buildings within a city. If for any
; city the player`s gold is negative, random buildings in the city
; are sold off.
; In the second step, gold upkeep for all units is paid in a lump
; sum. If the player does not have enough gold, random units with
; gold upkeep are disbanded.
Also, with that setting, city gold surpluses are shown without unit upkeep costs deducted, and
those upkeeps are only included in the nation-wide income (shown in the sidebar on the client).
This seems to indicate that a city that can pay for its buildings, and hence shows a nonnegative
balance, should be free of trouble, regardless of how little money the nation has.
However, this is not the case. update_city_activity() [2] ignores the calculated surplus value, and instead
deducts both unit and improvement upkeep city during city processing whatever the gold_upkeep_style
is. It then goes on to check if the nation's treasure is negative, and fixes that by selling buildings.
Hence, depending on the order the cities are processed, a city that can pay for its buildings
(showing a nonnegative balance), in a nation that can pay for all its buildings and units (showing
a nonnegative balance) can still be forced to sell a building.
For example, with the nation as in the attached screenshot and savegame, if Castellum happens
to get processed first, you get "Can't afford to maintain Barracks in Castellum, building sold!" (If
Aquincum gets processed first, the income from it prevents this.)
Tested on 2.6, master looks similar.
[1] https://github.com/freeciv/freeciv/blob/S2_6/data/civ2civ3/game.ruleset#L150
[2] https://github.com/freeciv/freeciv/blob/S2_6/server/cityturn.c#L3049
Files