Ohhhh!
I assumed
multiplying by zero equals zero! Of
course Firaxis didn't do it this way.
Thanks for finding this. I would have never thought to look there. Now that we have access to the game core, we can look directly at the maintenance algorithm.
Code:
// Game progress factor ranges from 0.0 to 1.0 based on how far into the game we are
double fGameProgressFactor = double(GC.getGame().getElapsedGameTurns()) / GC.getGame().getDefaultEstimateEndTurn();
// Multiplicative increase - helps scale costs as game goes on - the HIGHER this number the more is paid
double fMultiplyFactor = 1.0 + (fGameProgressFactor * GC.getUNIT_MAINTENANCE_GAME_MULTIPLIER());
// Exponential increase - this one really punishes those with a HUGE military - the LOWER this number the more is paid
double fExponentialFactor = 1.0 + (fGameProgressFactor / GC.getUNIT_MAINTENANCE_GAME_EXPONENT_DIVISOR());
double dFinalCost = pow(fMultiplyFactor * iSupport, fExponentialFactor);
It turns out they labelled the variables badly. They called the first variable a "multiplier" (0 * n = 0) when it is actually a
modifier of the multiplier (1
+0 * n = 1).
Hmm... this makes it more complex to nullify vanilla maintenance costs. I'll have to think about the function.
============
Edit: I looked over the broader function and don't see a way to completely eliminate the GameProgressFactor, but we can essentially zero it out by setting the exponent divisor to a huge value. I'll go with 30,000.
Since the game was previously balanced with this unknown cost included, we'll need to increase unit maintenance to compensate for its disappearance. What's an average nationwide unit maintenance expense by the Modern Era for leaders with a big army?
1 + 1/7 = 1.142857

Expected|

Actual
100|193
200|426
300|678
400|941
500|1215
600|1496
700|1785
800|2079
900|2378
1000|2683
I think a decent starting point to compensate for this is doubling lategame maintenance across the board, for both units and buildings. It will bring the expected maintenance up close to the actual values once that exponent is gone.
The unusual maintenance was seen on marathon speeds, but
map size is the main factor, since large maps have more units and more maintenance. It just happens to be that most marathon games play on large-huge maps (correlation vs causality). This is also why militaristic AIs get crippled by their armies, from this unknown exponential factor.
===============
Edit: Thinking about this some more, this is probably why some players reported excessive lategame gold, if they were peaceful and built few units.
On a side note... we are
sooooo off topic!
