Solving the mystery: Unit Maintenance

Status
Not open for further replies.
I'm okay with Workers/Settlers taking some upkeep, but Great People should be a reward, not a punishment.

It forces a strategic decision. Do I cash in my GP now for immediate benefit, or do I hold off until the reward is much greater at the cost of dealing with upkeep for the unit between now and then? Like a lot of other mechanics in CiV, it looks like another case of either being able to have your cake or eat it...but not both at the same time.
 
So we should just change the divisor to 1, right? If I'm reading this correctly, that should make for much more accurate and intuitive upkeep costs, where deleting a unit yields -4 cost per turn, another unit -4 per turn, another unit -3 per turn, etc. It seems like the issue where only every other unit costs money isn't [integer]/2, it's the rounding to the nearest 7, so rounding to the nearest 1 should eliminate that behavior, correct? (I'm not concerned with the formula here, just making the upkeep costs more logical).

There is no divisor for unit maintenance. I think "divisor" in this case just means an exponent of 1 divided by something. All the other functions in the game use an exponential curve, but using a pure exponential curve for miantenance would make your maintenance shoot through the sky at the end of the game.

In my post with the unit maintenance formula, even if I used giant 100,000 multipliers, I still got unit maintenance numbers that weren't rounded to a multiple of any number. Using giant multipliers you can see the fractional amount of gold that it would cost, and there's no nice round divisor. Divisor are applied to other things such as policy cost, not unit maintenance.

Also interesting is that if I use giant multipliers, I don't get the behavior of every odd unit not costing maintenance. That implies to me there's just a "round to nearest number" somewhere in the middle of the formula, probably some buggy side effect of LUA script. It really looks like an oversight rather than a planned thing that every odd unit would not add maintenance. That only happens when you use "sensible" unit maintenance numbers, but if a modder were to make a Zimbabwe mod where everything costs 1000x as much, apparently he wouldn't get the same effect.
 
To anyone wanting to figure out the formula, the easiest way would be to set the divisor to 1 so you can actually see it changing in amounts smaller than 7, use Tuner to give yourself a huge number of units, then record the amount of maintenance on each turn for a few dozen turns (please keep in mind the game speed makes a difference). If you want to, send me the results you obtain and I'll figure out the formula (I have a math background and love this kind of stuff, I just don't really know how to use Tuner and don't have much interest in pressing end turn 100 times to get a decent sample).

As mentioned, I do see amounts smaller than 7 all the time, and I can see fractional gold amounts if I set a big gold multiplier. Two units costing more than 2x cost isn't just a divisor issue, it's an explicit behavior.

I've already given out an approximate formula, but have a blast if you want to find a closer fit:

Maintenance costs for single unit, first 15 turns, standard speed and normal difficulty:
0.5, 0.508, 0.517, 0.526, 0.535, 0.544, 0.553, 0.563, 0.572, 0.581, 0.590, 0.599, 0.609, 0.618, 0.627, 0.637

By the way, changing the inflation values by game speed in the XML doesn't do anything for unit maintenance.

But changing how many months elapse per turn affects it in some non-obvious way. Bah!
 
So I got distracted with the new Training Series Game as well as still trying to do a better gauntlet (sub 250 turns is nuts) and have neglected this somewhat. I am glad to see quite the number here working on it now.

I'm curious though how you do things such as editing a tile yield, or the unit multiplier. I just have the world builder. What am I missing to do those things? I think I can make some progress, but having that would be fantastically more helpful than just building scenarios:crazyeye:
 
I can't wait till the bug mod comes out. Delete this worker and you will save 56gpt. Top drawer!

I think from the military overview screen you should be able to see the current upkeep costs associated with your units. This is the kind of basic accountancy information essential to make decisions regarding the empire.

I'd also like to see this information when creating units. We told that creating a monument will cost you 1gpt maintenance, but what about that crossbow man?
 
The unit costs are stupid. I'm astounded by the stupidity of this design. how can a tank, a battlesip, a worker and a spearmen all be essentially cost the same? Not just dumb in a logical sense, but dumb in the game design as well.

The more I see design decisions like this, along with the UI, the more I'm convinced that they were designing with a console port in mind. You'd need to simplify things for that.

You should at least include some subtlety if you're going to have a confusing and opaque maintenance cost. Since the algorithm is so hidden, why not charge more for some units than others? Why not make costs higher in wartime? Etc.
 
It's a joke that a thread like this has to exist.

Why are the RULES of the game being hidden from us? This formula should be in the civlopedia, even if it meant less actual historical info. If you want to make the AI seem unpredictable or act erratically, fine...but hiding the rules themselves crosses a line that leaves a bad taste in my mouth.
 
My head is spinning.

The thing that irks me is that I deleted one of my 3 workers last night and got 10gpt back ... 10 gpt! Why would a worker ever cost me more than 3 colloseum? A modern battleship, sure I could see that, maybe a steath bomber also, but a worker? Do we really pay our construction crews that much these days?
 
My head is spinning.

The thing that irks me is that I deleted one of my 3 workers last night and got 10gpt back ... 10 gpt! Why would a worker ever cost me more than 3 colloseum? A modern battleship, sure I could see that, maybe a steath bomber also, but a worker? Do we really pay our construction crews that much these days?

Ya, i remember the first time I saw this too, but it was like 12-13 gp i think. i was fighting a war across the globe and i got annoyed with the camera jerking back and forth to my completely dominated continent, and so I just started firing all my workers. Viola! i created my permanent golden age after firing half a dozen works or whatever. though just to correct you, it's not 10 gp for a worker, but 10 for every 2 workers.
 
It's a joke that a thread like this has to exist.

Why are the RULES of the game being hidden from us? This formula should be in the civlopedia, even if it meant less actual historical info. If you want to make the AI seem unpredictable or act erratically, fine...but hiding the rules themselves crosses a line that leaves a bad taste in my mouth.

The ironic part is I think the game was simplified to more easily present information, even if it meant being able to use less levers. Now the mechanic that uses the most complex information is probably the most poorly implemented!

Take city maintenance in Civ4 for example. It's complex as it doesn't use integer values, and has 3 components: # of cities, city size, and if it's on another island with how many other neighbours. The Civ5 version is just a simple +2 maintenance per city, and another +1 per population. The rate of change of it with respect to the number of cities is constant.

Meanwhile we moved from a pretty simple unit maintenance in Civ4 to a more complex model, and it makes much less sense.
 
It's ridiculous that the age of a unit increases its maintenance cost. It should be tied to it's XP, not age.

Although I would understand that for unionized workers...:rolleyes:
 
It's not the age of the unit, is it? If I'm understanding this correctly, it's the age you're in (or more specifically, the turn you are in). I guess the point isn't so, when you're in the modern age with a modern economy, you have some massive army that clogs gamespeed down. I would hope this isn't overbalanced, though (it would be nice if modern armies are at least noticeably larger).

Anyway, I'm understanding that no simple solution is going to come from this, but I'm curious to see what we come up with here (as complicated as it might be).
 
It's a joke that a thread like this has to exist.

Why are the RULES of the game being hidden from us? This formula should be in the civlopedia, even if it meant less actual historical info. If you want to make the AI seem unpredictable or act erratically, fine...but hiding the rules themselves crosses a line that leaves a bad taste in my mouth.

Thank you. Stuff like this prevents me from even enjoying playing Civ 5. I don't like feeling like I'm wandering aimlessly, doing things and making decisions without any indication of their consequences. Having some idea what effect my actions will have is kind of important in a strategy game. You know, so I can actually strategize.
 
EDIT: My mistake, the mod also changed one of the other parameters.

I concur that the inflation number under gamespeeds doesn't do anything.
 
Nice to see other people are confused about the unit maintenance as well.
Also thank you very much for the people who have done some math and testing. Now I've got at least some idea what to take into account when releasing my diplomacy in force.

In Civ IV I usually had a very weak army until someone gave me trouble and from there on I'd have a strong army to the end of the game.

In Civ V the unit maintenance seems to take the strategy more to the lines of "I can't keep an army if I really, really don't need it". War is expensive and armies are cut down after the war only to be built up again when need arises. Calculating what the approriate size for peace time "defense force" is very hard. (that is a constant debate in real politics at least in my country. For some reason no one asks the price of military when the huge tank army from next door gathers along the borders:))

At first I thought the maintenance cost was rediculously high in Civ V, but now I'm leaning towards acceptance. I find myself making calulations such as
"in 5 turns my gpt is going to be around -25, I've only 320 gold. I estimate my attack to last for 14 turns give or take 2 turns. It seems have sell some resources to that cheeky Catherine to make sure I don't go bankrupt mid-war.".
It is actually refreshing to start learning a new way to handle military aspects of the game.
The maintenance cost should be more transparent though.
 
Nice to see other people are confused about the unit maintenance as well.
Also thank you very much for the people who have done some math and testing. Now I've got at least some idea what to take into account when releasing my diplomacy in force.

In Civ IV I usually had a very weak army until someone gave me trouble and from there on I'd have a strong army to the end of the game.

In Civ V the unit maintenance seems to take the strategy more to the lines of "I can't keep an army if I really, really don't need it". War is expensive and armies are cut down after the war only to be built up again when need arises. Calculating what the approriate size for peace time "defense force" is very hard. (that is a constant debate in real politics at least in my country. For some reason no one asks the price of military when the huge tank army from next door gathers along the borders:))

At first I thought the maintenance cost was rediculously high in Civ V, but now I'm leaning towards acceptance. I find myself making calulations such as
"in 5 turns my gpt is going to be around -25, I've only 320 gold. I estimate my attack to last for 14 turns give or take 2 turns. It seems have sell some resources to that cheeky Catherine to make sure I don't go bankrupt mid-war.".
It is actually refreshing to start learning a new way to handle military aspects of the game.
The maintenance cost should be more transparent though.

The problem with this approach is that you will be classified as weak by the AIs if you don't maintain a large standing army and they will attack you. Their definition of army strength is also a bit problematic: I've had AIs mock me for my small army just after I conquered another AI and just before they got beaten.
 
To anyone wanting to figure out the formula, the easiest way would be to set the divisor to 1 so you can actually see it changing in amounts smaller than 7, use Tuner to give yourself a huge number of units, then record the amount of maintenance on each turn for a few dozen turns (please keep in mind the game speed makes a difference). If you want to, send me the results you obtain and I'll figure out the formula (I have a math background and love this kind of stuff, I just don't really know how to use Tuner and don't have much interest in pressing end turn 100 times to get a decent sample).

Difficulty: 4 - Prince (Normal)
Speed: Standard
Did not alter the divisor value though, in fact, no XML was modified for this test.

I used the tuner to eliminate the ai civs and barbarians so I could take turns without being attacked. Then I added units one at a time recording the total expenses each time. After adding 30 units, I deleted them all, took 100 turns, and repeated the process.

Code:
Turn 1			Turn 100		Turn 200		Turn 300	
Units	Expenses	Units	Expenses	Units	Expenses	Units	Expenses
0	0		0	0		0	0		0	0
1	0		1	0		1	0		1	0
2	1		2	2		2	4		2	6
3	1		3	2		3	4		3	6
4	2		4	5		4	9		4	14
5	2		5	5		5	9		5	14
6	3		6	8		6	14		6	22
7	3		7	8		7	14		7	22
8	4		8	11		8	19		8	30
9	4		9	11		9	19		9	30
10	5		10	13		10	24		10	38
11	5		11	13		11	24		11	38
12	6		12	16		12	30		12	47
13	6		13	16		13	30		13	47
14	7		14	19		14	35		14	55
15	7		15	19		15	35		15	55
16	8		16	22		16	41		16	64
17	8		17	22		17	41		17	64
18	9		18	25		18	46		18	73
19	9		19	25		19	46		19	73
20	10		20	28		20	52		20	82
21	10		21	28		21	52		21	82
22	11		22	31		22	57		22	91
23	11		23	31		23	57		23	91
24	12		24	34		24	63		24	100
25	12		25	34		25	63		25	100
26	13		26	37		26	68		26	109
27	13		27	37		27	68		27	109
28	14		28	40		28	74		28	118
29	14		29	40		29	74		29	118
30	15		30	43		30	79		30	127

The expenses were the same whether I added workers, warriors, or death robots. Additionally I reloaded after hitting turn 300 and added one unit, then took 300 turns. The unit did not gain any expense cost over time and adding additional units followed the same pattern, so older units (tech wise or time wise) seems to make no difference in expense cost.

I don't have the math skills to reach any other conclusions from the data, but hopefully someone else can. :)
 
Difficulty: 4 - Prince (Normal)
Speed: Standard
Did not alter the divisor value though, in fact, no XML was modified for this test.

I used the tuner to eliminate the ai civs and barbarians so I could take turns without being attacked. Then I added units one at a time recording the total expenses each time. After adding 30 units, I deleted them all, took 100 turns, and repeated the process.

Code:
Turn 1			Turn 100		Turn 200		Turn 300	
Units	Expenses	Units	Expenses	Units	Expenses	Units	Expenses
0	0		0	0		0	0		0	0
1	0		1	0		1	0		1	0
2	1		2	2		2	4		2	6
3	1		3	2		3	4		3	6
4	2		4	5		4	9		4	14
5	2		5	5		5	9		5	14
6	3		6	8		6	14		6	22
7	3		7	8		7	14		7	22
8	4		8	11		8	19		8	30
9	4		9	11		9	19		9	30
10	5		10	13		10	24		10	38
11	5		11	13		11	24		11	38
12	6		12	16		12	30		12	47
13	6		13	16		13	30		13	47
14	7		14	19		14	35		14	55
15	7		15	19		15	35		15	55
16	8		16	22		16	41		16	64
17	8		17	22		17	41		17	64
18	9		18	25		18	46		18	73
19	9		19	25		19	46		19	73
20	10		20	28		20	52		20	82
21	10		21	28		21	52		21	82
22	11		22	31		22	57		22	91
23	11		23	31		23	57		23	91
24	12		24	34		24	63		24	100
25	12		25	34		25	63		25	100
26	13		26	37		26	68		26	109
27	13		27	37		27	68		27	109
28	14		28	40		28	74		28	118
29	14		29	40		29	74		29	188
30	15		30	43		30	79		30	127

The expenses were the same whether I added workers, warriors, or death robots. Additionally I reloaded after hitting turn 300 and added one unit, then took 300 turns. The unit did not gain any expense cost over time and adding additional units followed the same pattern, so older units (tech wise or time wise) seems to make no difference in expense cost.

I don't have the math skills to reach any other conclusions from the data, but hopefully someone else can. :)



WOW, awesome job with the chart. I don't have the math skills either to figure out a formula, but it gives some pretty good insight into what's happening.

:goodjob:
 
Status
Not open for further replies.
Back
Top Bottom