Page 1 of 2

Unit upkeep independent of homecities

Posted: Mon Oct 12, 2015 7:01 pm
by SMACX2
In Civ 3 /Civ 4 unit upkeep is not handled with the 'homecity' mechanism but somehow calculated globally. I do not remember the exact formula, but it was dependent on government, city number etc.
This has the benefit that the player does not need to micromanage the homecity for each unit, which can get a bit of time consuming on large maps.

Is there any possibility to switch to this upkeep behavior via a ruleset change and get rid of the 'homecity mechanism' completely'? If not, it would be really great if this gets implemented in the future.

Edit:
- It is already possible to change unit upkeep to gold and pay globally. Great!

- Civ 3 behaviour: You get a number of freely supported units based on city size and government type.
For example Monarchy has "Unit Support Town/City/Metro: 2/4/8",
that means each Town reduces global gold support by 2, each City by 4 and each Metropolis by 8.
Republic has "Unit Support Town/City/Metro: 1/3/4" and in addition each unit over the cap costs double upkeep

So to emulate civ 3 upkeep, we would need an extra tag in the effects.ruleset which reduces global gold support dependent on city number and city size. In addition a government dependet tag would be needed which defines the multiplicator for gold upkeep over the cap.

- Civ 4 behaviour: it is distinguished between unit upkeep (for units inside your borders) and unit supply (for units outside your empire). In addition, the maintenance between military and non-military units is also different. For all caps the calculation is based on the total population size and a difficulty modifier.
The following tags are used in the civ 4 files (names speek probably for themselves): INITIAL_BASE_FREE_UNITS, INITIAL_BASE_FREE_MILITARY_UNITS, INITIAL_FREE_UNITS_POPULATION_PERCENT, INITIAL_FREE_MILITARY_UNITS_POPULATION_PERCENT, INITIAL_GOLD_PER_UNIT, INITIAL_FREE_OUTSIDE_UNITS, INITIAL_OUTSIDE_UNIT_GOLD_PERCENT

To emulate civ 4 upkeep, one would need several extra tags in the ruleset, but not government dependent

Some additional ruleset tags for defining a "free unit support cap" like in civ 3/4 would make it possible to circumvent the homecity mechanism.

Re: Unit upkeep independent of homecities

Posted: Mon Oct 12, 2015 7:06 pm
by sveinung
You can change to a national upkeep by changing the upkeep from shields to gold. See the "Shield2Gold" unit type flag and the "Shield2Gold_Factor" effect. Have a look at the experimental ruleset if you need an example.

Re: Unit upkeep independent of homecities

Posted: Mon Oct 12, 2015 8:36 pm
by SMACX2
I could change the upkeep from shield to gold by this for each unit:
"uk_shield = 0"
"uk_gold = 1"
But then government have no impact on the upkeep cost anymore.

If I try to get government dependence of the gold upkeep with the following:
"[effect_upkeep_free_units_monarchy]
type = "Unit_Upkeep_Free_Per_City"
value = 3
..."
I have to deal again with the 'homecity mechanism' to optimize the free upkeep for units.

Ideally, there would be a global formula for gold upkeep like:
whole_gold_upkeep - (city_number * government_modificator)

Re: Unit upkeep independent of homecities

Posted: Tue Oct 13, 2015 8:59 am
by Lachu
Is there free upkeep per city if gold upkeep is enabled?

Re: Unit upkeep independent of homecities

Posted: Tue Oct 13, 2015 9:26 am
by Lachu
We can connect this to policies, decreasing city production by small amount, we will increase global free unit support.

Re: Unit upkeep independent of homecities

Posted: Wed Oct 14, 2015 6:09 pm
by SMACX2
sveinung wrote:You can change to a national upkeep by changing the upkeep from shields to gold. See the "Shield2Gold" unit type flag and the "Shield2Gold_Factor" effect. Have a look at the experimental ruleset if you need an example.
I think "Shield2Gold_Factor" and "Shield2Gold" are used if you want to switch between shield and gold upkeep in one game after some conditions are met.

Re: Unit upkeep independent of homecities

Posted: Wed Oct 14, 2015 6:14 pm
by SMACX2
Lachu wrote:Is there free upkeep per city if gold upkeep is enabled?
You can enable it in the ruleset. The mechanism is then the same as for shields.
"[effect_upkeep_free_units_monarchy]
type = "Unit_Upkeep_Free_Per_City"
value = 3
..."

For example monarchy allows each city to support the first three units for free. So this kind of support depends on the assignment of homecities.

Re: Unit upkeep independent of homecities

Posted: Wed Oct 14, 2015 6:17 pm
by SMACX2
Lachu wrote:We can connect this to policies, decreasing city production by small amount, we will increase global free unit support.
How does this work in detail? What do you mean with 'policies'?

Re: Unit upkeep independent of homecities

Posted: Thu Oct 15, 2015 6:05 am
by Lachu
Policies are way to tradeof one variable by other, like science output by happiness, so decreasing science output will increase happiness and vice-versa. It's enabled in experimental ruleset of trunk.

Imagine we have policies called freedom of speech. If you increase this value, science output will increase, but happiness will be decreased. If you decrease this value, then science output will be decrease, but happiness will increase.

Re: Unit upkeep independent of homecities

Posted: Tue Oct 20, 2015 4:37 am
by sveinung
SMACX2 wrote:
sveinung wrote:You can change to a national upkeep by changing the upkeep from shields to gold. See the "Shield2Gold" unit type flag and the "Shield2Gold_Factor" effect. Have a look at the experimental ruleset if you need an example.
I think "Shield2Gold_Factor" and "Shield2Gold" are used if you want to switch between shield and gold upkeep in one game after some conditions are met.
You can also "switch" at the beginning of the game. Just make it condition less. (No req)