bugFreeciv - Bugs: bug #19541, Forced disbanding of units due to...

Show feedback again

bug #19541: Forced disbanding of units due to shortages is inconsistent between gold and shield upkeep

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Sun Mar 11 16:57:15 2012  
Category: NoneSeverity: 2 - Minor
Priority: 5 - NormalStatus: None
Assigned to: NoneOpen/Closed: Open
Release: S2_3Operating System: Any
Planned Release: Contains string changes: None

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Sun Mar 11 17:19:59 2012, comment #2:

Good point. Could be dealt with, but would be fiddly.

Jacob Nevins <jtn>
Project Administrator
Sun Mar 11 17:18:22 2012, comment #1:

Note that balance_treasury-functions restore upkeep already paid, and thus return balance to at least 0. Selling no-upkeep units would not help at all this turn as it would not reassign free upkeep to units currently having upkeep.

Marko Lindqvist <cazfi>
Project Administrator
Sun Mar 11 16:57:15 2012, original submission:

When a city isn't producing enough shields to maintain all its units, in city_distribute_surplus_shields(), the candidates for disbanding are those where utype_upkeep_cost(..., O_SHIELD)>0 for the unit. This includes those units who happen to currently be enjoying free upkeep due to EFT_UNIT_UPKEEP_FREE_PER_CITY (see city_units_upkeep()). (In fact it may happen to prefer them, since the disband unit isn't chosen randomly.)

In contrast, when city_balance_treasury_units()/player_balance_treasury_units() look for units to disband due to lack of gold, they only consider units where punit->upkeep[O_GOLD] > 0. This will spare any who happen to enjoy free upkeep from their city at the moment. (And units are chosen randomly from the list, not in iteration order.)

Overall, it doesn't matter -- the correct number of units get sold, and they're interchangeable -- but it's a bit unfair. (It might in theory give a player an incentive to do silly micromanagement of unit list orders, to control which get disbanded.)

It might be nicer if:

  • Production-based disband picked a random unit from the candidates.
  • Gold-based disband considered units currently enjoying free upkeep, by looking at utype_upkeep_cost().
    • Wrinkle: player_balance_treasury_units() would have to be careful not to disband units with no homecity (hence no upkeep, hence no use disbanding -- also, particularly valuable and hence annoying if disbanded).
Jacob Nevins <jtn>
Project Administrator


(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by cazfi (Posted a comment)
  • -unavailable- added by jtn (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup