View Full Version : Where is the maintenance cost per unit defined


kiwitt
Oct 01, 2009, 01:51 PM
I would like to increase the maintenance cost of each unit, but don't know where to find it.

Gaius Octavius
Oct 02, 2009, 11:24 AM
One way is to use <iExtraCost> in Civ4UnitInfos.xml. This allows you to specify different costs for each unit type, so battleships and carriers would cost more in maintenance than destroyers and transports, for example. If you want all units to cost more, you could set them all to the same number.

kiwitt
Oct 02, 2009, 11:32 AM
Thanks for that. That is a good idea.

A corps should cost more than a division, etc.

God-Emperor
Oct 02, 2009, 05:20 PM
Are you sure iExtraCost is for maintenance?
I'm pretty sure it is extra build cost in gold, rather than hammers.

kiwitt
Oct 02, 2009, 06:56 PM
I have just added it into my mod. It's perfectly with my style of game - bigger units should cost more to support :)

You can see the results in the Expenses Tab of your economic advisor if you move your mouse over unit costs it is visible in a popup there.

God-Emperor
Oct 03, 2009, 02:54 AM
Oops.
I had tested it by doing the XML change (giving a unit an iExtraCost of 200) and then loading a saved game. The existing units of that type didn't add any maintenance (which, in retrospect, is not too surprising as their data already existed) and the build button's pop-up text indicates +200 cost so I assumed it meant build cost...
Testing it again, I upgraded a unit to the modified unit type and sure enough, there was the extra maintenance on the finance screen unit cost pop-up (and my gold per turn dropping by about 200 was also a pretty good clue before I even checked that).

Tholish
Oct 05, 2009, 05:47 PM
I never knew that was there. I use a two tiered system of "Military" and "Non Military" units, and adjust the costs in CivicInfos. That method would be so much better. I wonder if the AI recognizes it.