The Curious Cat - City Upkeep Explained

rev063 said:
There some improvements that could be made to the interface to help out here:

- In the Domestic Advisor screen (or Financial Adviser) include something like:

Next city minimum cost: 12gpt

where the "12gpt" is calculated by comparing your current total income, with what your total income would be if you founded a new city at the closest valid square outside your current borders. In practice it wouldn't be exactly that (you could settle further away than the minimum for a greater distance cost), but it would be a useful yardstick to help decide whether it's worth settling.

I like this, we can always hope. :)

It would also be useful in war, to help decide whether to raise or keep a newly captured city. For founding new cities, it could be almost like a "combat calculator", it could come up when you hover over a square with the settler selected. Obviously it wouldn't stay accurate very long due to city growth (all over the empire), changing civics, etc.

I have quite a few times founded cities that I REALLY regretted founding because of the cost. A "disband city" feature would be useful in those situations too (even if it just destroys the city!)

rev063 said:
- In the City View screen, include something like:

City profitability: +4gpt

where this number is calculated by comparing your current total income, with what your income would be if the city being viewed was suddenly razed. This would be more relevant information (and include not only city costs but also city income from worked tiles), but you'd only find out *after* settling a city if it was worthwhile. Nonetheless, with enough practice this would be a useful tool to help manage expansion.

Yes, this could also be useful I think - but I suspect which figure to put there would be the subject of some debate, because the "total commerce" generated by the city gets split between gold and research and culture according to the science and culture sliders - and then the beakers / gold / culture points generated will have various bonuses applied to them, and then get rounded. :crazyeye:

So I'm not sure which figure would be the "right" one here.
 
the individual upkeep seems to increase with city size as the following:
individual city upkeep = Base upkeep + (Base upkeep * (city size-1)/10)
base upkeep is the upkeep of the city at size 1 (before it is rounded up/down)
the size of a city does not appear to affect the city upkeep of other citys.
i tested this on emperor difficulty, it may be different on other difficultys.
 
I analyzed StevenJoyce's data for distance maintenance and came up with a formula:

dist maint = [ pop*dist + 6.5*(dist+1) ]/28.8

where the division is integer division (round down). A reasonable guess would be that map size and difficulty factors are multiplicative factors to the 28.8 and 6.5 numbers, respectively. Anyone want to gather some data on that? Some comments on accuracy:

1) For most of the datapoints this formula gives the exact number.
2) For some datapoints - always those with higher population - the formula is off by +/- 1.
3) For the datapoints with 1,000 pop the formula is off by +1 to +6, increasing with distance. (by "+1" I mean the formula is giving a higher maintenance than the data),
 
If you draw another ring around the "cheesy circle" at 9 units distance, you get a "Cheesy Doughnut". :D
 
Any City number formulas available?

with the excell sheets I seem to get an initial of
Deity
Average maintenance cost=0.3 * # cities

Noble
Average maintenance cost=0.208 * # cities

So I'm guessing some type of formula like
Deity (standard map), formula for individual city

Maintenance=0.3*T+(N-1)/T.. round down the total
T=Total number of cities
N=This city's number

the 0.3 depending on the deity level

for deity that only left 1 error on size 22 for the total maintenance (145 v. 144)
on Noble it seems a bit more difficult (the multiplier has to be .2095 to remove any exceptions)

There may also be a population effect, but that's another problem.

I'm assuming they used the same method as was used in the updated Civ3Conq to determine 'N' (distance from palace and/or founding date, or else each city could just be given a 'rank' when it is founded..since the rank only matters 1 gpt more or less for a city)
 
Krikkitone said:
There may also be a population effect, but that's another problem.

I tested for this -- there is no population effect for Number of Cities Maintenance. There is a population effect for Distance Maintenance.
 
Thanks, I was looking for something like this, too bad it's not the same for 1.52. BTW, Curious Cat has something to do with your username (Gato Loco)?
 
Analyzed the distance data a bit,
Had to change distance data formula, realized it was at Deity level....and only on Normal

[Difficulty % * Distance * (Pop+7?) / (29)]

Difficulty % are
45 (Settler)
55
65
75 (Noble)
85
90
95
100
100 (Deity)

Possible other values that COULD be involved
Size % are
50 (duel)
60
70
80 (Standard)
90
100 (huge)

The Heights : Widths are
10:6 (Duel)
13:8
16:10
21:13 (standard)
26:16
32:20 (Huge)

The 'Maximum Distance' is listed as 25 in the XMLs

Unfortunately I can't seem to determine where the rounding down occurs, since the internal details are unknown.

Also the City number Formula
seems to be basically
[Difficulty% * Size % * Number of cities + (This city-1)/Number of cities]

For city number maintenance
Difficulty%
40 (Settler)
50
60
70 (Noble)
80
85
90
95
100 (Deity)

Size %
45 (Duel)
40
35
30 (Standard)
25
20 (Huge)

Again there are still rounding errors that I can't pinpoint
 
Krikkitone said:
Any City number formulas available?

with the excell sheets I seem to get an initial of
Deity
Average maintenance cost=0.3 * # cities

Noble
Average maintenance cost=0.208 * # cities

So I'm guessing some type of formula like
Deity (standard map), formula for individual city

Maintenance=0.3*T+(N-1)/T.. round down the total
T=Total number of cities
N=This city's number

the 0.3 depending on the deity level

for deity that only left 1 error on size 22 for the total maintenance (145 v. 144)
on Noble it seems a bit more difficult (the multiplier has to be .2095 to remove any exceptions)

There may also be a population effect, but that's another problem.

I'm assuming they used the same method as was used in the updated Civ3Conq to determine 'N' (distance from palace and/or founding date, or else each city could just be given a 'rank' when it is founded..since the rank only matters 1 gpt more or less for a city)

I think you just need to figure out the Deity formula and the other difficulty will follow according to the iNumCitiesMaintenancePercent for each difficulty. These numbers are 100, 95, 90, 85, 80, 70, 60, 50, 40 from the deity to settler difficulty. There might be rounding though, but so far, my observation is that it matches closely with the above percentages across different difficulty.

Also, it does not seems to be affected by game speed.

EDIT: I just notice you already gave the full formula in the last post. Please ignore this post.
 
Krikkitone said:
Analyzed the distance data a bit,
got
[Difficulty % * Size % * Distance * (Pop+7?) / ((Grid Width+Grid Height/2))]

....


Also the City number Formula
seems to be basically
[Difficulty% * Size % * Number of cities + (This city-1)/Number of cities]

Impressive formulas. Finally there's a formula for the city maintenance. Could you explain what the 'This city' variable means? The rest is clear to me. Is it the order in which the cities got founded?
 
Krikkitone said:
[Difficulty % * Size % * Distance * (Pop+7?) / ((Grid Width+Grid Height/2))]

It looks like you have a paren error in the denominator. Perhaps you meant

((Grid Width+Grid Height)/2)

ie the average of the height and width?

or

(Grid Width+(Grid Height/2))

ie the width plus half the height?
 
I've found the following formula similar to Krikkitones one:

[Difficulty % * Size % * [Distance] * (Pop+7) / 22]

I have tested this formula for different difficulties on standard maps up to a population of 1000. The distance is rounded down (e.g. 7,5 to 7).
 
Krikkitone said:
Any City number formulas available?

with the excell sheets I seem to get an initial of
Deity
Average maintenance cost=0.3 * # cities

Noble
Average maintenance cost=0.208 * # cities

So I'm guessing some type of formula like
Deity (standard map), formula for individual city

Maintenance=0.3*T+(N-1)/T.. round down the total
T=Total number of cities
N=This city's number

the 0.3 depending on the deity level

for deity that only left 1 error on size 22 for the total maintenance (145 v. 144)
on Noble it seems a bit more difficult (the multiplier has to be .2095 to remove any exceptions)

There may also be a population effect, but that's another problem.

I'm assuming they used the same method as was used in the updated Civ3Conq to determine 'N' (distance from palace and/or founding date, or else each city could just be given a 'rank' when it is founded..since the rank only matters 1 gpt more or less for a city)


There is a population modifier. I was not able to find a 100% correct formula. The following is a good approximation with only few slight mistakes.

min(MaxNumCitiesMaintenance;[Difficulty % * Size % * ((P+16)*n+1)/18 + (range-1)/n])

P = population of the city
n = number of cities
range = the city's number (dependent of the distance (rounded down) from the capital)
MaxNumCitiesMaintenance is given in the CIV4HandicapInfo.xml (e.g. 6 at monarch and prince level)
Difficulty% (= NumCitiesMaintanacePercent) is given in the CIV4HandicapInfo.xml (e.g. 0,85 at monarch level)
Size% (= NumCitiesMaintanacePercent) is given in the CIV4WorldInfo.xml (e.g. 0,3 for standard maps)

I have added the Excel-file with a lot of data to analyze.
 

Attachments

  • city-upkeep.zip
    8.9 KB · Views: 449
VoiceOfUnreason said:
It looks like you have a paren error in the denominator. Perhaps you meant

((Grid Width+Grid Height)/2)

ie the average of the height and width?

or

(Grid Width+(Grid Height/2))

ie the width plus half the height?

Yeah it should be the average (17 on standard)

and (in response to another)
This city is the Rank of the city

The things that worry me are the
1. remaining 'rounding errors' (differences of about 1)
2. the large differences near 1000 pop
3. the fact that the '7' population offset doesn't seem to be anywhere in the XML
 
namaska said:
)

I have added the Excel-file with a lot of data to analyze.

That data is the number of cities maintenance and not the upkeep right?
 
Krikkitone said:
One thought, perhaps Total population enters into the formula, that could be a complicating factor.

No, I don't think so. In my tests with 2 cities the population of the 2nd city had no influence on the "limit population" of the first city which raises the maintenance cost.
 
Annoying, in any case the problem seems to be finding the order of the terms and where the rounding is applied (since I'm confident they are fairly simple with most of the terms in the XML files somewhere)
 
Krikkitone said:
Annoying, in any case the problem seems to be finding the order of the terms and where the rounding is applied (since I'm confident they are fairly simple with most of the terms in the XML files somewhere)

It would help quite a bit if there was a worked example.
Let's say that I'm at Emperor, standard map, and I have 4 cities, all size 4.
I'm not an organized civ and have basic civics except for Slavery.
The three cities are all 4 tiles away from the capital.

Am I correct in assuming that I pay:

Distance maintenance of
0.95*0.80*4*11/17 for each of the three cities for a total of 5.96 (6)

Number of cities maintenance of
0.9*0.3*4 per city, for a total of 4.32; I don't understand the last term.
Does it mean I add 1/4, 2/4, 3/4 = 1.5 extra maintenance total?

Civics maintenance of
Government:1*(0.08*8,round to 0)+(0.4*3,round to 1) = 1
Legal: 1*(0.08*7,round to 0)+(0.4*4,round to 1) = 1
Labor: 0
Economy:1*(0.08*5,round to 0)+(0.4*6,round to 2)) = 2
Religion:1*(0.08*4,round to 0)+(0.4*7,round to 2)) = 2

So my total maintenance cost would be 6+4.3+1.5+6 = 18?
3/5/5/5 is what would show up on each city, on average, for the quoted maintenance costs?
 
ohioastronomy said:
It would help quite a bit if there was a worked example.
Let's say that I'm at Emperor, standard map, and I have 4 cities, all size 4.
I'm not an organized civ and have basic civics except for Slavery.
The three cities are all 4 tiles away from the capital.

Am I correct in assuming that I pay:

Distance maintenance of
0.95*0.80*4*11/17 for each of the three cities for a total of 5.96 (6)

Number of cities maintenance of
0.9*0.3*4 per city, for a total of 4.32; I don't understand the last term.
Does it mean I add 1/4, 2/4, 3/4 = 1.5 extra maintenance total?

Civics maintenance of
Government:1*(0.08*8,round to 0)+(0.4*3,round to 1) = 1
Legal: 1*(0.08*7,round to 0)+(0.4*4,round to 1) = 1
Labor: 0
Economy:1*(0.08*5,round to 0)+(0.4*6,round to 2)) = 2
Religion:1*(0.08*4,round to 0)+(0.4*7,round to 2)) = 2

So my total maintenance cost would be 6+4.3+1.5+6 = 18?
3/5/5/5 is what would show up on each city, on average, for the quoted maintenance costs?

The civics upkeep isn't added to the upkeep in each city that can be seen in the city screens. The upkeep that can be seen in the city screens is only the city upkeep.
 
Top Bottom