View Full Version : The Curious Cat - City Upkeep Explained
Gato Loco Nov 07, 2005, 12:15 AM Note - I believe that patch 1.52 changed the specifics for city upkeep. I'll be starting a new job in about a month, so I should soon have money for a computer capable of handling lots of repetitive city placement tests to get at the specifics. Until then, be warned that upkeep is apparently higher than it was under the "public beta" version shipped with the original release.
---------------------------------------------------------------------------------
One of the much-discussed new features in Civ4 is the introduction of the supposedly ICS-killing city maintenance. In preview after preview, we were told that REX* the rabid settler dog has finally been put down or at least kept on a tight leash. For the first time, a city can actually lose you money. However, old habits die hard and we’re already seeing claims in these forums that the ability to chop for settlers will leave this old dog tearing up the backyard for years to come. In the interest of tossing old REX a bone, I’ve attempted to dissect the city maintenance system to figure out how well it does its job. I have conducted a series of experiments to determine exactly how long the leash is. All experiments were conducted under the following settings.
Difficulty = Monarch
World Size = Standard
Game speed = Standard
Civ = Arabs (Chose a non-organized leader just in case it has an effect)
Map = Great Plains (For maximum freedom placing cities)
Civics = all default
All tests were conducted with the world-builder on.
*REX = Rapid EXpansion
Test 1 = Number of cities maintenance:
For this test I founded the capitol in the middle of a large open area and began placing new cities within 3 tiles of the palace. At this distance I had already observed that there is no distance-based city maintenance. Note that the world-builder is capable of placing cities in adjacent tiles even though this is not allowed in the game. All cities were connected to the trade network by default, although in another test I confirmed that this does not seem to affect city maintenance, at least for cities within 10 tiles or so of the palace (unlike corruption in Civ3). I then observed the amount of city maintenance for each additional city. The first observation is that the maintenance from the number of cities is not the same for each city. This is probably to avoid exploitable rounding errors which would occur if the value were evened out over every city, as happened with the ring city placement bug in civ3 vanilla. Instead, each additional city raises the maintenance slightly in a select number of existing cities. I did not determine the formula used for selecting cities but instead graphed the increase in maintenance per turn for each additional city. As the game runs very slow on my computer, I did not go through the process of separating out city maintenance and civic maintenance, but I checked on several occasions and found civic maintenance to be roughly 10% of city maintenance. This would presumably be significantly higher if you run expensive civics, and it appears to scale roughly with city maintenance, so if you plan to spam cities and run a hereditary police state with organized religion, the organized trait may actually give you a noticeable benefit. What’s more, the manual claims that civic costs also increase as total population increases (p.83), so I could picture it getting pretty high in certain cases.
http://www.civfanatics.net/uploads10/marginalupkeep.jpg
As shown by the graph, the cost in gpt of a new city increases as you add more cities. There is a discontinuity around ten cities after which the cost rises sharply, making 9-10 the optimal number on a standard map before massive city upkeep starts to kick in. After this, the marginal upkeep rate increases until your 28th city costs you 14 gpt! Note that this city will not show 14 gpt in city maintenance. Much of the upkeep is distributed as a slight increase across other cities. After this point the marginal increase in upkeep falls dramatically, to 6-7 extra gpt per city. This is because the number of cities component of city maintenance can never exceed 6 gpt per city, so once all your cities are maxed out this component can never exceed 6 times the number of cities. In my observations, the number exceeded this value because of civic upkeep. This is good news for warmongers because once you have conquered 30 cities, future conquests will be a little less painful, especially if you run state property to eliminate the (probably huge) distance based component for your world-spanning empire. As an aside, each holy city potentially gives you 1 gpt for each city you own, so owning 6 holy cities will pay all of your number-based city upkeep if you relentlessly spam missionaries. Owning all seven will turn a profit on state property! If you’re hell-bent on ICSing, I would recommend the Arabs. You start with Mysticism so you have a chance at grabbing lots of religions early and the philosophical trait should lead to quick great prophets to found the appropriate shrines. Call it the “Babylon” strategy after the villain in the “Left Behind” series who tries to conquer the world by founding a universal syncretistic religion. Commie Universalist Arabs take over the world! Oh My!
Test 2 = Distance-Based Maintenance [Update - the value established in this section is a minimum. Some undetermined factor can increase distance upkeep to more than this amount. Thanks to Requies for noticing this]
To test distance-based corruption, I created a horizontal line of 30 cities with the palace at one end and measured the distance-based component of maintenance for each one. The results are shown below:
http://www.civfanatics.net/uploads10/horizdist.jpg
It appears that on the settings used, the distance-based corruption is equal to the distance to the palace divided by 4.5, as long as the city in question is along a straight axis from the palace. I also tested distance along a diagonal distance and found that the diagonal distance does not obey Pythagoras’ theorem. Instead it appears that the program counts diagonal distance as equaling 1.5 times the value of horizontal distance, rounded down. This makes sense as this was the method used to calculate distance in Civ3.
http://www.civfanatics.net/uploads10/diagdist.jpg
http://www.civfanatics.net/uploads10/fulldist.jpg
This is great news because anyone who’s ever done an RCP in vanilla Civ3 knows how to calculate rings on the map. There’s even a utility to do it for you. The trick is to map out the rings of the appropriate distances (4,9,13,18,etc.) and place your cities inside those rings to avoid increasing distance upkeep. Pictured below is a formation that I’m naming the “Cheesy Circle”
http://www.civfanatics.net/uploads10/ironring.jpg
The ring of red X’s shows the distance at which you start paying distance upkeep. This formation (when used on standard maps) gives you nine cities with no distance upkeep and 16 gpt in number-based upkeep, for less than 2 gpt/city. Each city can work over 12 tiles, which should be enough to exhaust their health and happiness anyway. Ideally, you spam settlers to build the circle (at minimal upkeep cost), then develop the cities into high-shield military bases for a classical-age swordsman rush.** The only drawback is that you may miss out on resources by having such a compact territory. In practice it may be best to put some of the cities into the 1-upkeep region to obtain much-needed special resources, such as iron.
**This is a theoretical strategy at the moment. Next time I start a new game I’ll try some variation of this layout. It would seem perfect for the first GOTM (Expansive leader, hill/grass/river start, great swordsman UU)
Test 3 – Do I have a life?
No. But you don’t either if you’re still reading this.
In conclusion, city maintenance works more or less as advertised. The main headaches will come from having too many cities, but distance upkeep could potentially be annoying for small colonies in faraway lands. Consider carefully before founding a little city on a faraway continent for the sole purpose of claiming a banana resource, especially if you can get bananas by trading with your friends. Since many of the numbers are rounded, it is possible to take advantage of the system to minimize your city upkeep and play a more efficient game. I expect that some version of these calculations will figure in high-level civ4 play once there is such a thing as high-level civ4 play. Unless, of course, Firaxis decides to play with the formula in a patch or expansion, just like they did with ring city placement. Given their stated commitment to reducing the amount of math necessary to play the game, it is a likely possibility.
Please feel free to test and comment on my observations. They are as yet incomplete and any input is appreciated. I’ll update once I figure out the answers to remaining questions, such as how upkeep works on different world sizes and what the formula for civic upkeep is.
Gato Loco Nov 07, 2005, 12:18 AM Addendum – Courthouses and the upkeep limit
Just to confirm the nature of the 6-upkeep limit for number of city upkeep, I placed 50 cities on a standard map and started filling them with courthouses. The courthouse affects the upkeep after the cap has been applied, so with courthouses in every city and state property, you should be able to pay only 3 gpt per city. While controlling all 7 holy cities and converting every city might be a pipe dream, doing this for 3-4 religions should be doable for would-be conquerors.
Update - Difficulty level and City Upkeep
After placing large numbers of cities in Warlord difficulty, it appears that difficulty level does affect upkeep. However, it does not affect the OCN. In warlord level, as in Monarch level, costs begin to accelerate after the tenth city. Hoverver, once the OCN is reached, costs increase at about 75% of the rate they do on Monarch. Since the OCN is unchanged, city placement shouldn't be that different on different difficulty levels, but it may be possible to squeeze a few more cities in at lower levels. A comparison is shown below:
http://www.civfanatics.net/uploads10/monvswar.jpg
Also note that:
Warlord maxes out at 5 gpt per city
It takes longer for Warlord to max out city costs than Monarch. Thus there are actually certain points at which the next city costs more under Warlord, though the total upkeep is still less.
Civic upkeep
For this test, I started adding more and more size 1 cities and watching the additional civic upkeep for each one (F3). Preliminary tests indicate that on a standard map you start paying a flat fee for each size 1 city beyond the tenth. The amount comes to slightly less than 1 gpt per city for the starting civics. While it would be possible to catalogue rounding errors and exploit them the payoff would be very small and would need to take into account many possible combinations of city number, city size, and civic options, and would come to no more than 1 gpt anyway since civic upkeep, unlike distance upkeep, is one single lump sum rather than a bunch of small, separately rounded numbers. City size also increases civic upkeep, though to a lesser degree, especially in small numbers of very large cities. Each civic appears to contribute 1/5 of the cost, as determined by switching 2 civics to no upkeep. High upkeep is also much more expensive than low upkeep, as switching to organized religion increased upkeep from 50 to 74 gpt, apparently boosting the religion share of upkeep by 3.5 times (10 gpt to 34 gpt)! City upkeep at this point was ~350 gpt without courthouses, so it appears that under the most expensive civics available one could boost civic upkeep to the point where it could compare with city upkeep. And since courthouses do not affect civic upkeep, the cost of a large empire would be enough to make a would-be world conqueror think twice about high or even medium upkeep civics (no hereditary police states, please). Given this data, I strongly suspect that the organized trait has gotten a bum rap and will find its usefulness in domination games.
lastchance Nov 07, 2005, 12:27 AM This is the most important post on Civ IV so far.
MSTK Nov 07, 2005, 12:39 AM Agreed. Great observations and testing. I'd be delighted to see your naming conventions being immortalized and used by civvers years from now :)
fightcancer Nov 07, 2005, 02:19 PM sorry for being so retarded, but I'd love to know what the X, Y axes represent above.
Mercade Nov 07, 2005, 02:26 PM Excellent post, Gata Loco :thumbsup:
sorry for being so retarded, but I'd love to know what the X, Y axes represent above.
X = # of cities
Y = cost in gold per turn
The first graph shows the incremental costs for added cities when they are created as close to the capital as possible (with 3 distance per city), i.e. spiralling out trying to minimise the distance factor.
The second graph shows the incremental cost for added cities when they are created in a linear line from the capital, i.e. horizontal distance.
M.
Khaim Nov 07, 2005, 02:49 PM I think ICS is actually dead. While you can ring cities like you've shown, I think it's worth the extra few gpt to spread your territory and grab extra resources. You don't really want to cover the entire world in such cities. That said, REX isn't dead at all. You take an early tech hit as you expand horizontally, but once you run into other civs and build up vertically, you quickly regain lost tech.
fightcancer Nov 07, 2005, 03:23 PM X = # of cities
Y = cost in gold per turn
thanks!
also, what's OCN and ICS, please?
MikeH Nov 07, 2005, 03:42 PM OCN - Optimal City Number - i.e. the point beyond which more cities become pretty useless.
ICS - Infinite City Sprawl - a technique in the earlier versopns of CIv of covering the map with tons of cities, often only one space apart.
Gato Loco Nov 07, 2005, 04:55 PM I think ICS is actually dead. While you can ring cities like you've shown, I think it's worth the extra few gpt to spread your territory and grab extra resources. You don't really want to cover the entire world in such cities. That said, REX isn't dead at all. You take an early tech hit as you expand horizontally, but once you run into other civs and build up vertically, you quickly regain lost tech.
I never endorsed covering the whole map with ringed cities. That formation is meant to give you a bunch of low-upheep cities very early in the game while hovering just below the point at which upkeep starts wrecking your economy. The point is that you can chop and pump settlers in the early game without shooting yourself in the foot as long as you don't get carried away and found more than 9-10 cities, or start placing them at the other end of the continent. With low upkeep and high shield production, you can still rush to iron working and make lots of military units without wrecking your economy. Just raze your early conquests so they don't drag you down. By the time you start expanding beyond the core, you'll have a large war chest (and courthouses in every city) from pillaging/plundering and will be able to start expanding in earnest.
And of course, I admit that in reality you'll probably want to put many of your early cities in the 1-upkeep ring (5-8 tiles from the palace) or even the 2-upkeep ring (9-13 tiles) if your starting location is anything short of Eden, so long as you know exactly what kind of upkeep you're getting into, and whether moving your city location by one tile will save you a gpt while still being more or less as good. It all comes down to how many gpt you're willing to pay for better real estate. Iron is worth quite a lot. So are rivers. An extra grassland, probably not.
abj9562 Nov 08, 2005, 06:56 AM Good thread!
IglooDude Nov 08, 2005, 08:36 AM Very good thread. Answered my questions about city expansion/placement upkeep before I even asked them. :goodjob:
fightcancer Nov 08, 2005, 12:08 PM OCN - Optimal City Number - i.e. the point beyond which more cities become pretty useless.
ICS - Infinite City Sprawl - a technique in the earlier versopns of CIv of covering the map with tons of cities, often only one space apart.
thanks for the info.
Mujadaddy Nov 08, 2005, 03:05 PM Test 3 – Do I have a life?
No. But you don’t either if you’re still reading this.
Ok, you got me :p
City upkeep, however, is NOT the only factor involved in new city site selection... Unless your Palace was on ABSOLUTELY PERFECT terrain, I would never, ever, ever put my cities with overlapping work areas like that.... Culture and borders in Civ4 is generally the dictating factor, after resources, of course..
Frewfrux Nov 08, 2005, 03:25 PM Wow. That's great info. It's interesting how it compares to what I have been doing:
If I understand the "Cheesy Circle" theory correctly, you can end up with 25 cities, 9 within the 0 gpt border, and 16 within the 1 gpt border. That means that you end up paying 28 gpt for your cities (16 from distance, and 12 from the number of cities).
What I have been doing, however, is spacing my cities out so that their area's of influence don't overlap. The end result is fewer cities farther apart covering more area. I've figured out that I can have 6 cities in my first ring and 12 in my second (the cheesy circle has 9 in the first and 18 in the second) for a total of 19 cities (adding in the capital). From what has been revealed here, I calculate the cost of this to be 29 gpt...more from distance, but less from number of cities.
In the end the cost is only 1 gpt more to cover more area with fewer cities. Interesting. Am I looking at this correctly? Did I miss something?
MoonZar Nov 09, 2005, 02:53 PM Thanks you for this nice information !
mudhut Nov 09, 2005, 06:52 PM Wow. That's great info. It's interesting how it compares to what I have been doing:
If I understand the "Cheesy Circle" theory correctly, you can end up with 25 cities, 9 within the 0 gpt border, and 16 within the 1 gpt border. That means that you end up paying 28 gpt for your cities (16 from distance, and 12 from the number of cities).
Nope, you missed that the first graph shows MARGINAL cost per city, ie how much extra you pay for each city you add to your empire. You looked up 25 cities on the graph and found that it costs 12 gpt. This is the cost of going from 24 cities to 25 cities; not the cost of all 25 cities. To find the gpt for the number of cities component for 25 cities you need to add all the values together, ie:
City 1: 0
City 2: 0
City 3: 1
City 4: 2
City 5: 2
City 6: 2
City 7: 3
City 8: 3
City 9: 3
City 10: 4
City 11: 6
City 12: 6
City 13: 6
City 14: 7
City 15: 7
City 16: 6
City 17: 8
City 18: 8
City 19: 9
City 20: 9
City 21: 10
City 22: 9
City 23: 9
City 24: 11
City 25: 12
So you can see your total gpt based on number of cities would sum to 143 gpt. Ouch. Don't get confused though: the 25th city won't show as having 12 gpt in its "number of cities" cost - rather the 25th city raises the city maintenance across various cities in your empire by a total of 12.
This is why ICS is on life support (subject to the resolution of the Locust strategy) - who can afford 143 gpt?! Plus you would have your distance cost (you got this calculation right, just 16gpt for this).
What I have been doing, however, is spacing my cities out so that their area's of influence don't overlap. The end result is fewer cities farther apart covering more area. I've figured out that I can have 6 cities in my first ring and 12 in my second (the cheesy circle has 9 in the first and 18 in the second) for a total of 19 cities (adding in the capital). From what has been revealed here, I calculate the cost of this to be 29 gpt...more from distance, but less from number of cities.
In the end the cost is only 1 gpt more to cover more area with fewer cities. Interesting. Am I looking at this correctly? Did I miss something?
So this would acrually be 83gpt from number of cities and 12 gpt from distance for a total of 95 gpt city upkeep cost.
-Mudhut.
drexvenor Nov 09, 2005, 08:00 PM ICS as we know it from Civ3 is dead. You could easily spam cities in Civ3 and see rewards for it. It took no strategy per se and was quite boring actually.
ICS itself is not dead. You can still do it in CivIV. It just takes incredible strategy, planning and work. You need to have an economy that is running at full potential, an army adequate to defend all your cities and the time to spend micromanaging your world.
This is not from any practical experience with ICS in CivIV but from observations of mine from reading many posts on ICS. I have not played an ICS game in CivIV. I don't think ICS will be a viable strategy in CivIV. It can be used as a challenge. Who can win the game with the most cities? It could be the ultimate challenge for the builder.
Again it sounds boring but it takes a lot more work than in CivIII.
Chinese American Nov 09, 2005, 10:03 PM have you taken into account versailles, forbidden palace, and organized trait?
Raize Nov 11, 2005, 07:48 AM Several questions:
1) Does this upkeep increase as the city grows? (I think I read a yes?)
2) Won't city improvements/general surplus balance out and eventually overcome these costs?
I understand you're taking an additional hit as you get more cities, but doesn't it make sense to keep getting cities (from a purely builder standpoint) until net city income = net city maintainence?
So as long as I have extra money I'd always want to build/conquer that next city, for its production bonuses, wouldn't I?
Krikkitone Nov 11, 2005, 12:37 PM Several questions:
1) Does this upkeep increase as the city grows? (I think I read a yes?)
2) Won't city improvements/general surplus balance out and eventually overcome these costs?
I understand you're taking an additional hit as you get more cities, but doesn't it make sense to keep getting cities (from a purely builder standpoint) until net city income = net city maintainence?
So as long as I have extra money I'd always want to build/conquer that next city, for its production bonuses, wouldn't I?
1)
For Civic Upkeep (which depnds on your Civics choices, # cities and pop) Yes
For City Maintenance (Which depends on number of cities and how far they are from palaces) NO
2) Actually you want to build cities until CHANGE in total city maintenance=Income provided by one city
[which means that if you can get each city to produce a bit more than ~6 gold, then there should be no limit...assuming the 'conquerors plateau' holds.]
Gato Loco Nov 11, 2005, 12:52 PM Several questions:
1) Does this upkeep increase as the city grows? (I think I read a yes?)
2) Won't city improvements/general surplus balance out and eventually overcome these costs?
I understand you're taking an additional hit as you get more cities, but doesn't it make sense to keep getting cities (from a purely builder standpoint) until net city income = net city maintainence?
So as long as I have extra money I'd always want to build/conquer that next city, for its production bonuses, wouldn't I?
1) I don't think city upkeep grows as cities grow, but civic upkeep certainly does. You can combat this by being an Organized leader, or by selecting the cheapest civics available, but generally, by the time your cities are at size 10+, you're pulling in a lot of cottage money anyway so you can afford it.
2) Yes, they will. That's why you can expand later in the game, once the infastructure is in place. Building courthouses and the Forbidden Palace, switching to State Property, farming Great Merchants, and pillaging everything in sight can all make up for upkeep. However, with the possible exception of pillaging, these are options only available after you've settled down and improved your existing cities, so classic settler-pump, 30 cities by 1000BC ICS is not tenable.
I'd also like to point out that 9-10 cities on a standard continents map is enough to carve out a good block of territory as long as your heart isn't set on working every tile like you would in Civ3.
City upkeep, however, is NOT the only factor involved in new city site selection... Unless your Palace was on ABSOLUTELY PERFECT terrain, I would never, ever, ever put my cities with overlapping work areas like that.... Culture and borders in Civ4 is generally the dictating factor, after resources, of course..
Yes, you're right. That strategy was meant specifically as an early rush strategy to be combined with an early beeline to iron working. The point is to crank out swordsmen as soon as possible while not crippling one's economy. I'd never suggest it if you aren't going to go to war early.
Wow. That's great info. It's interesting how it compares to what I have been doing:
If I understand the "Cheesy Circle" theory correctly, you can end up with 25 cities, 9 within the 0 gpt border, and 16 within the 1 gpt border. That means that you end up paying 28 gpt for your cities (16 from distance, and 12 from the number of cities).
What I have been doing, however, is spacing my cities out so that their area's of influence don't overlap. The end result is fewer cities farther apart covering more area. I've figured out that I can have 6 cities in my first ring and 12 in my second (the cheesy circle has 9 in the first and 18 in the second) for a total of 19 cities (adding in the capital). From what has been revealed here, I calculate the cost of this to be 29 gpt...more from distance, but less from number of cities.
In the end the cost is only 1 gpt more to cover more area with fewer cities. Interesting. Am I looking at this correctly? Did I miss something?
Aside from the gpt calculations, you're describing a good strategy for a peaceful builder, especially with the creative trait or an early religion to provide border expansion. The circle is meant to provide the maximum production early on without tanking your economy. For builders, the important thing to maximize is your income and food. In these cases, I go for resource city placement - plop down cities in order to claim as many nearby resources with as few cities as possible, because resources are what really matters until the middle ages when you start getting the special tile improvements. After cherry-picking the best city spots, you can later go back and fill in the blanks once you've gotten costs under control (and once you can fill the unproductive areas with mills and workshops). I don't think the exact overlapping or non-overlapping of city borders is an issue because you won't be working all those tiles anyway, and the AI isn't going to settle in a small unclaimed pocket in the middle of your empire if the terrain isn't that good anyway.
Krikkitone Nov 11, 2005, 04:49 PM One factoid
the peak is at 28 cities:
assuming each city takes up about 25 squares (when fully developed)
then that is at about 700 tiles
a standard Great Plains map has 32 x 44 tiles (1408)
so the peak is reached when you have enough cities to cover ~1/2 of the map. (I would guess this holds for all map types (counting land area of course))
So the Conquerer's Plateau is really there only for people going for the Domination Win.
predesad Nov 11, 2005, 06:05 PM I just wanted to say :goodjob: & thanx
dssltg Nov 12, 2005, 03:15 PM My experience has been that the AI recommends a city build site with a blue circle within the cheezy circle.
Many times the blue circle is exactly on the recommended place in the chart above.
Interesting, computer is suggesting city site that overlaps work areas of another city, perhaps to save on city maintanence and civics.
neilm85uk Nov 18, 2005, 08:20 AM My experience has been that the AI recommends a city build site with a blue circle within the cheezy circle.
Many times the blue circle is exactly on the recommended place in the chart above.
Interesting, computer is suggesting city site that overlaps work areas of another city, perhaps to save on city maintanence and civics.
I think the recommendation is the best two sites within range of your settler at the moment. If you move away from the city that spawned them then the recommendations will change.
N.
Gronz Nov 19, 2005, 07:13 PM 1) I don't think city upkeep grows as cities grow, but civic upkeep certainly does. You can combat this by being an Organized leader, or by selecting the cheapest civics available, but generally, by the time your cities are at size 10+, you're pulling in a lot of cottage money anyway so you can afford it.
as far as i can tell, city upkeep does depend on size of the city.
the distance upkeep of a city seems to be a function of city size and distance to the nearest capital.
on difficulty noble and a standard size continent map, distance upkeep for a
size 4 city was distance/5 in gpt
size 7 city was distance/4 in gpt
size 11 city was distance/3 in gpt
size 20 city was distance/2 in gpt
the number of cities upkeep of a city grows with increasing number of cities and city size, however it is capped at a maximum that is determined by your difficulty level.
on difficulty noble and a standard size continent map, number of cities upkeep for each city is at least number of cities / 6 (rounded down)
and can be more if the city is larger than size 1 and/or far away from your capital - but never more than 5 gpt.
Tauro Nov 20, 2005, 10:02 AM Test 3 – Do I have a life?
No. But you don’t either if you’re still reading this.
rotfl
I agree :)
Thx for the great job
MosquitoE Nov 22, 2005, 02:13 PM Nice work, very informative.
Could you tell from your tests how the game treats distance to the forbidden palace as compared to the palace?
DrWu Nov 23, 2005, 07:50 AM Great info, thanks.
Jonny211 Nov 23, 2005, 07:56 AM Thanks for doing the research and posting it... you've answered a question I was itching to know.
Now off to move my palace!
LeSphinx Nov 24, 2005, 06:41 AM Yes me too.
I was looking for tips and detailled informations about this.
Great!
LeSphinx
Samson Nov 27, 2005, 09:34 AM Anyone one know what the "no. of cities" number maxes out at at different difficulties (esp. Noble atm)?
Dogzilla Nov 27, 2005, 06:52 PM IMO a good city always pays for itself, no matter how many cities you have or how far from your capital it is. This study does not take into account wonders/improvements that lower city cost, and a good city will always produce much more gold than it drains once it's developed.
A poor city site, on the other hand, is proably not worth bothering with, unless it has a strategic location or needed resource.
BTW, does anyone really place cities in a prefab grid? One of the fun parts of the game is picking city sites, based on a host of factors--coast, river, resources so another player doesn't get an annoying foothold on your continent, etc...I guess that's why I never win on high difficulty levels.:p
eg577 Nov 28, 2005, 01:10 AM Do we have a full formula for each component of corruption yet?
kurdt Nov 28, 2005, 02:32 PM as far as i can tell, city upkeep does depend on size of the city.
the distance upkeep of a city seems to be a function of city size and distance to the nearest capital.
on difficulty noble and a standard size continent map, distance upkeep for a
size 4 city was distance/5 in gpt
size 7 city was distance/4 in gpt
size 11 city was distance/3 in gpt
size 20 city was distance/2 in gptWhat were the cultural values for those cities? I just got the game yesterday myself, but it seems a lot seems to go back to culture, maybe upkeep distance costs?
Blkbird Nov 28, 2005, 09:39 PM Test 3 – Do I have a life?
No. But you don’t either if you’re still reading this.
Best catch phrase I've seem in this forum. :lol:
Gronz Nov 29, 2005, 04:44 AM What were the cultural values for those cities? I just got the game yesterday myself, but it seems a lot seems to go back to culture, maybe upkeep distance costs?culture does not modify the distance upkeep of a city (just tried it in the world editor: size 7 city at 40 tiles distance = 10 distance upkeep, regardless of culture)
Thalassicus Dec 10, 2005, 05:37 AM ...and the AI isn't going to settle in a small unclaimed pocket in the middle of your empire if the terrain isn't that good anyway.
must...keep...straight face... :twitch:
...try leaving a few tiles of Ice with a seafood nearby; they'll plop a settler right down as happy as can be! :lol:
It's sad when the other leaders starts dropping their citizens down in 1-tile pockets all around your empire, the poor guys have to eke a living off ice and some meager fish, right over the horizon from some of the most legendary cities in the world. :(
I usually take pity on them, and "liberate" their citizens from the torment of their brutal dictator. :mischief:
My experience has been that the AI recommends a city build site with a blue circle within the cheezy circle.
It actually displays visible sites (non-fog of war) within one or two moves of the settler. You can look at how it makes choices for terrain by dropping a bunch of settlers on hills on a random map and seeing where the circles are.
It usually aims for the maximum number of resources in the city radius, with less consideration for potential food/production/commerce in the city. Resources can be attained even if they're not in your city's workable tiles though, so sometimes it's better to build cities without direct access to a resource, if it gives you better overall tile values for the city. After getting experience with the game, I've found I can almost always place better cities without the recommendations visible. After all, the human mind is excellent at pattern recognition and goal-oriented planning, two things that are very harde to code.
Requies Dec 10, 2005, 07:01 AM Not sure if you ever got around to testing it, but it seems like this doesn't work exactly right....
Test 2 = Distance-Based Maintenance
http://www.civfanatics.net/uploads10/diagdist.jpg
http://www.civfanatics.net/uploads10/fulldist.jpg
This is great news because anyone who’s ever done an RCP in vanilla Civ3 knows how to calculate rings on the map. There’s even a utility to do it for you. The trick is to map out the rings of the appropriate distances (4,9,13,18,etc.) and place your cities inside those rings to avoid increasing distance upkeep. Pictured below is a formation that I’m naming the “Cheesy Circle”
http://www.civfanatics.net/uploads10/ironring.jpg
The ring of red X’s shows the distance at which you start paying distance upkeep. This formation (when used on standard maps) gives you nine cities with no distance upkeep and 16 gpt in number-based upkeep, for less than 2 gpt/city. Each city can work over 12 tiles, which should be enough to exhaust their health and happiness anyway. Ideally, you spam settlers to build the circle (at minimal upkeep cost), then develop the cities into high-shield military bases for a classical-age swordsman rush.** The only drawback is that you may miss out on resources by having such a compact territory. In practice it may be best to put some of the cities into the 1-upkeep region to obtain much-needed special resources, such as iron.
**This is a theoretical strategy at the moment. Next time I start a new game I’ll try some variation of this layout. It would seem perfect for the first GOTM (Expansive leader, hill/grass/river start, great swordsman UU)
Outside City view
http://i29.photobucket.com/albums/c287/RequiesAeterna/Civ4ScreenShot0017.jpg
Antium (N city, distance maintenance = 1). Note: this maintenance was there the very moment I built Antium (which was my second city)
http://i29.photobucket.com/albums/c287/RequiesAeterna/Civ4ScreenShot0018.jpg
Arpinum (E city, distance maintenance = 0). I decided to build this farther out for resources (5 square distance) and was surprised to find that the distance maintenance was 0.
http://i29.photobucket.com/albums/c287/RequiesAeterna/Civ4ScreenShot0019.jpg
Also, as I gained more cities (or as they grew, I'm not sure which) my cities' distance maintenance increased (in ALL my cities except Rome) from 0 to 1.
Req
Krikkitone Dec 10, 2005, 10:09 AM Well the original tests were on cities of size 1, no culture
So far it looks like
City Distance maintenance may depend on
Distance
Population of city
Cultural level
Number of cities? seems redundant
City Number maintenance may depend on
Number of cities
Population of city
Cultural level
Number of this city (age/distance from palace..to avoid rounding errors)
Requies Dec 10, 2005, 10:38 AM Well the original tests were on cities of size 1, no culture
So far it looks like
City Distance maintenance may depend on
Distance
Population of city
Cultural level
Number of cities? seems redundant
City Number maintenance may depend on
Number of cities
Population of city
Cultural level
Number of this city (age/distance from palace..to avoid rounding errors)
As I said, my city had that distance maintenance of 1 since it was founded (and it was my second city). And my other city didn't have the distance maintenance even though it's 6 tiles away (farther than every other city). OTOH, all my other cities behaved as you would expect, it's just those cities which were weird....
Req
zagnut Dec 10, 2005, 04:53 PM I am sorry to hear that we may be cursed with the RCP strategy again. I can't believe that Firaxis intended this especially since the Conquests expansion to Civ3 specifically eliminated it. The problem with RCP is not that it enables you to eliminate some of the disabilities that a city experiences as it get further from the capital, but that in doing so it forces you to play the game in an artificial manner. You have to slavishly place your cities on a particular ring instead of where they should be located in order to take advantage of the terrain and resources available on your map.
It encourages participants in competitions such as the GOTM to "play the rings" because then they can increase their score.
I realize these experiments are preliminary, but I hope they don't turn out to be correct.
Gato Loco Dec 10, 2005, 10:54 PM Ok, there's clearly more going on than I thought. I'm not sure when I'll get time to run more in-depth tests, as my machine is still painfully slow even with the patch, and I'm working on the GOTM at the moment. From my experience playing, I've noticed the same thing, that distance upkeep seems to work out higher in practice than in the small-city tests. I've observed for a fact that there appears to be a scalar difficulty factor that gets multiplied in before rounding. There may be other multipliers as well. Any observations would be appreciated.
@Thallasicus
Yes, it seems that the AI still does go for the frozen seafood aisle on the map. Then again, so do I after some consideration. Even a bare water tile can give you 2 commerce when worked. So plop down a fishing town and you can fairly easily get:
+3 commerce from trade routes ( if you have currency + corporation)
+1 gold from shrine income per holy city you own
+3 or +6 commerce equivalent if you run mercantilism
+2 commerce from the city tile itself
+2 commerce per population, 3 if you're financial
all for no more than 3 upkeep with a courthouse and state property
So in a worst-case scenario, the city will start out with 8 commerce/gold at population 1. If seafood is present it will quickly grow and give much more commerce than it takes in upkeep. Better yet, if you have sufferage or slavery you can rush-build courthouses, libraries, and such to further increase the value. And cultural pressure doesn't matter as long as the city can still work its sea tiles. So the AI isn't nuts to settle these spots. Now defending them can be a bit of a pain if you don't have easy sea access to ship in garrisons. It all goes to show that there's no such thing as a bad food resource. It also goes to show that in the rennaisance/modern eras civ4 actually limits big empires less than civ3 does.
@Zagnut
RCP isn't back in the same way as Civ3. Assuming you don't try to cram everything into the 0-upkeep circle (which isn't a good idea on most maps) you have a good amount of flexibility in placing cities. It's just that there are certain cutoff points that can save you money if you adjust city placement slightly. Also, saving 1 gpt is only a big deal in the beginning when upkeep only comes to 1-2 gpt per city and you economy is rather weak. Once you have 15 cities and are dealing with 6 gpt in city upkeep and have a healthy cash flow, saving 1 gpt probably isn't as valuable as getting a slightly better position anyway. Finally, the new emphasis on resources works against city placement formulas, as the ultimate formula will always be to get as many good resources (especially food) in your city borders as possible. RCP worked so well in civ3 because every tile could yield shields and commerce, unlike civ4.
eg577 Dec 11, 2005, 05:16 AM It is an extreme exageration to say we are cursed with RCP again. With RCP your 3rd city had rank 2 instead of 3, your 4th city had rank 2 instead of 4, your 5th city had rank 2 instead of 5 and so on. The benefit for the last city was huge.
The only RCP like thing you can do in civ4 is placing cities just before the distance corruption jumps up from N to N+1; all you gain is 1 gpt per city. You could do this in civ3 too, even after the formula was changed.
Krikkitone Dec 11, 2005, 12:26 PM As I said, my city had that distance maintenance of 1 since it was founded (and it was my second city). And my other city didn't have the distance maintenance even though it's 6 tiles away (farther than every other city). OTOH, all my other cities behaved as you would expect, it's just those cities which were weird....
Req
perhaps roads matter as well in determining distance?
so
N city (founded closer, but with no road connection, city maintenance was 1, by the time it was connected, it grew so city maintenance stayed 1)
E city (founded farther, but roads already in place while it was low population)
Roads could work either by cutting down distance (counting it as moves v. tiles) OR by just saying 'having a trade connection' to the capital.
Thalassicus Dec 11, 2005, 02:47 PM ...it seems that the AI still does go for the frozen seafood aisle on the map. Then again, so do I after some consideration. Even a bare water tile can give you 2 commerce when worked. So plop down a fishing town and you can fairly easily get:
+3 commerce from trade routes ( if you have currency + corporation)
+1 gold from shrine income per holy city you own
+3 or +6 commerce equivalent if you run mercantilism
+2 commerce from the city tile itself
+2 commerce per population, 3 if you're financial
all for no more than 3 upkeep with a courthouse and state property
So in a worst-case scenario, the city will start out with 8 commerce/gold at population 1. If seafood is present it will quickly grow and give much more commerce than it takes in upkeep. Better yet, if you have sufferage or slavery you can rush-build courthouses, libraries, and such to further increase the value. And cultural pressure doesn't matter as long as the city can still work its sea tiles. So the AI isn't nuts to settle these spots. Now defending them can be a bit of a pain if you don't have easy sea access to ship in garrisons. It all goes to show that there's no such thing as a bad food resource. It also goes to show that in the rennaisance/modern eras civ4 actually limits big empires less than civ3 does.
With the tiny pockets around another empire, this most frequently happens in the late game, when a bit of extra commerce isn't really going to provide all that much benifit as extra production. In addition to direct maintenance you also have increasing civic upkeep, which likely evens out any marginal bonus to your commerce.
It's most annoying though when the AI plops these down right after you've conquered cities in war, and once the cultural borders expand to normal you assimilate all these villages -- whether you want them or not. Without a way to disband a city by building a settler at 1 or 2 population, there's not much you can do with cultural flips.
Now if you could improve coastal tiles to have some production in addition to commerce, that would be very valuable.
On topic, city maintenance costs are one of the big reasons I utilize Organized for rapid expansion. With half-cost courthouses and lighthouses, you can quickly get pillaged or underdeveloped cities up to speed and cut your maintenance costs dramatically. In addition, it also halves the cost of expensive civics like Police State, Vassalage, and Theocracy. It's interesting that there's a limit to the maintenance added for each additional city...do you know if this is independent of map size?
Requies Dec 12, 2005, 02:35 AM perhaps roads matter as well in determining distance?
so
N city (founded closer, but with no road connection, city maintenance was 1, by the time it was connected, it grew so city maintenance stayed 1)
E city (founded farther, but roads already in place while it was low population)
Roads could work either by cutting down distance (counting it as moves v. tiles) OR by just saying 'having a trade connection' to the capital.
Possible but unlikely. I connected it pretty quickly and I'm pretty sure the maintenance stayed the same. And also why would that city have maintenance while all the rest around the ring (at about the same size) have 0 (e.g., Cumae)?
Req
Krikkitone Dec 12, 2005, 03:23 PM . It's interesting that there's a limit to the maintenance added for each additional city...do you know if this is independent of map size?
Pretty certainly, it is dependent on difficulty level though.
Fughtgar Dec 16, 2005, 02:29 AM Lots'n'lots'n'lots'a great stuff here - but my biggest question concerns map size, which I don't think has been covered in this thread yet (methinks, me may be wrong).
Does Gato or anyone else know what effect the different map sizes have on the OCN or on any of the other results gathered so far?
Smirk Dec 18, 2005, 03:38 PM Just to interject a tidbit of some high order strategy, city maintence comes from your generic final gold output.
So this has some interesting effects, the most clear is that the drain isn't any one city but taken as a whole, thus that city to get the iron or some other resource could run at a loss, be largely worthless but still an effective contribution to your empire.
Another one along those lines is that, unlike corruption aka Civ3, this doesn't reduce that cities commerce and thus beakers are unaffected. Meaning that city to get those gems, gold or silver may cost you 6gpt early on in maintence but give you a base 9 beakers in the city with only a few population. You can then overcome the deficit with a holy or gold producing city or other means, all the while having a powerful technology driven empire.
All this does is further strengthen the concept that city placement is driven more by resources than useable land. Of course balancing that with other stuff like this thread's topic is ultimately the "game".
Yehbo Jan 14, 2006, 05:58 AM I read this thread with great interest - thanks for doing this research and sharing it.
:thanx:
The last few games I have played on Prince, at normal speed, on a variety of small maps (Pangaea, Continents, Ice Age). Mainly so I can complete a game in 3-4 hours.
I tried applying the Cheesy Circle, but found things didn't quite seem to work out the way I expected. So I did a bit of testing in the World Builder (Small Pangaea map). Not very scientific/complete, but here are the results (v1.52).
Placing 4 size 1 cities, each 3 spaces away from capital (to N S E & W) was already incurring "distance" maintenance. (Possibly because of map size.)
Total maintenance: 11
Increasing all 5 cities to size 3 -
Total maintenance: 16
Placing 4 size 1 cities 4 spaces away:
Total maintenance: 15
Increasing all 5 cities to size 3:
Total maintenance: 16
Placing 4 size 1 cities 5 spaces away:
Total maintenance: 15
Increasing all 5 cities to size 3:
Total maintenance: 16
The total maintenance includes the civics cost.
Building roads and railways to connect the cities made no difference.
I guess I'll have to do some more testing, would be interested to know if anyone else has looked at the costs on small maps.
Edit:
A little bit more testing, I became curious about the impact of population.
Map was Small Pangaea on Prince.
First test - Capital city only.
At size 1, # of cities cost is 0, civics cost is 0.
At size 48, # of cities cost goes to 1, civics cost has reached 10.
At size 112, # of cities cost goes to 2, civics cost has reached 37.
At size 176, # of cities cost goes to 3, civics cost has reached 57.
At size 240, # of cities cost is still 3, civics cost is 82.
Distance cost does not change over this range.
Test 1 Conclusions:
- city size is part of the formula to determine # of cities cost (even when there's only 1 city!)
- total civics cost appears to be a proportion of population, which increases from around 20% with a low population, to around 33% with a high population; the cost is split nearly evenly between the 5 categories of civic (but rounding? appears to add 1 or 2 more cost to the last few sometimes); high upkeep doubles the cost in its category, medium upkeep adds 50% to the cost in its category, no upkeep makes its category free
- obviously these are unrealistic city sizes, but using large numbers may help to show what is going on...
Second test: Two cities, widely spaced (didn't measure distance, but on other end of continent).
Capital size 1, second city size 239:
Distance cost 8, # or cities cost 6, civics cost 84.
Capital size 239, second city size 1:
Distance cost 0, # of cities cost 7, civics cost 84.
Spreading the 240 population over 3 cities in various combinations made 2 gold difference to the civics cost (observed civics cost range: 84 to 86). Culture, techs and religions seemed to make no difference to any of the costs.
Test 2 Conclusions:
- The civics cost and # of cities costs are both slightly, but not significantly, affected by city placement or the population distribution between cities (but I didn't test with a large number of cities).
- The formula for distance cost IS affected by the population distribution between cities, and these costs are both higher if big population cities are further from the capital.
Third test: Two cities, capital size 239, second city size 1, at various distances.
At 4 squares from capital (3 empty squares between city and capital), distance cost goes to 1.
At 8 squares from capital, distance cost goes to 2.
At 12 squares from capital, distance cost goes to 3.
At 15 squares from capital, distance cost goes to 4.
Test 3 Conclusions:
- distance affects distance cost (surprise surprise)
- Cheesy Circle is smaller on this map size?/difficulty level?
Fourth test: Increase city size at selected distances.
Second city 4 squares from capital:
At capital size 1, second city size 1 - distance cost goes to 1
At capital size 1, second city size 8 - distance cost goes to 2
At capital size 1, second city size 16 - distance cost goes to 3
Second city 8 squares from capital:
At capital size 1, second city size 1 - distance is 2
At capital size 1, second city size 5 - distance cost goes to 3
At capital size 1, second city size 8 - distance cost goes to 4
At capital size 1, second city size 12 - distance cost goes to 5
Test 4 Conclusion:
- It seems that the distance cost goes up with size and distance, and that a combination of size and distance makes the cost go up faster. Not surprising really, but it suggests a large empire will get exponentially more expensive, and it also explains why capturing a distant enemy capital early on can be so crippling to one's economy for a while (actually, twice now I have found that early capture of an enemy capital has ruined my economy so much that I could not win the game).
My testing was quite limited, obviously, but I thought I'd post up the results anyway. I didn't go into testing the effect of adding more cities very much ...
StevenJoyce Jan 14, 2006, 02:36 PM I've done a bit of testing, and if someone will tell me how to post an excel spreadsheet I can show some of my (incomplete) results. Distance maintenance is affected by distance, population, and dfficulty level. In particular, the "cheesy circle" is smaller on higher difficulty levels and with higher populations. The total maintenance from the number of cities exhibits increasing marginal costs up until the point where the maximum average cost is attained (5 gpt/city at Noble, 8 gpt/city at diety). After that point ("the conqueror's plateau", 24 cities on a standard-sized Noble map, 27 cities on a standard sized diety map), you'll face a constant marginal cost for number of cities maintenance. Number of cities maintenance is not affected by population.
Requies Jan 14, 2006, 05:23 PM I've done a bit of testing, and if someone will tell me how to post an excel spreadsheet I can show some of my (incomplete) results. Distance maintenance is affected by distance, population, and dfficulty level. In particular, the "cheesy circle" is smaller on higher difficulty levels and with higher populations. The total maintenance from the number of cities exhibits increasing marginal costs up until the point where the maximum average cost is attained (5 gpt/city at Noble, 8 gpt/city at diety). After that point ("the conqueror's plateau", 24 cities on a standard-sized Noble map, 27 cities on a standard sized diety map), you'll face a constant marginal cost for number of cities maintenance. Number of cities maintenance is not affected by population.
You have to zip up excel files as civfanatics doesn't recognize (maybe deliberately) that type of file and then upload the file using manage attachments in the "Advanced" posting post.
Req
Desert-Fox Jan 16, 2006, 01:51 AM The problem is when you play above noble level ... I guess AI have some discount in maintance costs. So they can expand more. So I just have to be very small or be agressive to keep up in score. If I'm too small it is just a lot of luck if I get aluminium or not... if not then it is very hard to win space race. Only one component needs copper. But about AI, if human player doesn't expand quickly enough... i mean too slow, then AI just builds spam cities close to my borders and I've no room to expand so I just push culture or declare war.
But now for me culture slider is almost useless, only when you have nothing to research and push for culture victory then it is needed. Now if you run below 100% research you just do something wrong because AI just runs away in tech race. Colosseums and theatres give happiness bonuses but if you play smart enough you can get luxuries or something else to keep people happy. I think it should be as it was in older versions... when you simply couldn't run 100% research in whole game and still were able to keep up in tech. I remember that 20% luxuries was must when you swiched republic/democracy.
I hope firaxis will fix in next patches so 100% science will not be so must than it is now.
Yehbo Jan 16, 2006, 01:41 PM I hope firaxis will fix in next patches so 100% science will not be so must than it is now.
Desert-Fox, I think it doesn't matter whether you're on 100% or not.
What matters is how many beakers you're getting (how much science research).
Science slider at 100% of 1,000 earns 1,000 beakers.
Science slider at 60% of 2,000 earns 1,200 beakers.
Guess which one I'd prefer. :) (Ok, and I know it's not quite that simple, but the idea holds true - beakers is what counts, not the %.)
Check the left hand column of your finance advisor (F2) to see how many beakers you're getting. :coffee:
What I find a bit frustrating is how difficult it is to tell what the true cost of that extra city is over time. The city cost in the city screen is garbage for this purpose.
As Gato Loco's tests (and others here) show, the cost of each individual city is disguised by being spread across all cities, and the population component is paid for in Civics. (Not to mention Inflation, has anyone figured out yet how that is calculated - I haven't seen a thread on it yet?)
An example from a recent game - when I founded a new city, I could see that my GPT (gold per turn) went from +4 to -16. So it was obvious that city cost me 20gpt at the time I founded it (ouch). But if I go to the city screen, it says it's costing me only 4gpt!!! So if I only looked at that, the city would appear profitable quite quickly - when it is making 4+gpt - when in fact it needs to be making at least 20! And when the city grows, it will cost more, but I have no way of knowing how much.
All of this makes it very hard to know whether a city is "breaking even" (or was really worth founding), because the cost is hidden (between other cities, civics cost, and possibly inflation too).
I've done a bit of testing, and if someone will tell me how to post an excel spreadsheet I can show some of my (incomplete) results.
Good work, would love to see the spreadsheet and I'm sure the others following this thread would too.
StevenJoyce Jan 16, 2006, 03:34 PM OK, here's what I've found. All tests are preformed on 0-culture cities on a standard-sized, normal speed, Great Plains map. The first sheet deals with city maintenance from the number of cities. It shows the total, marginal, and average cost per city for Noble and Deity levels. The second sheet is a pivot table dealing with distance maintenance. It shows the distance maintenance for a given city as a function of its distance from the capital and its population. This table is pretty incomplete, but I won't have time to finish it for the foreseeable future. The third sheet contains the data underlying the pivot table .
111936
sukadi Jan 19, 2006, 11:58 AM city upkeep is related to map size.
i just checked WorldSize.xml file and found there're different upkeep discounts on different map sizes.
so i guess it would be easier to analyze city upkeep by modifying map size discount to 100%
punchandpie Jan 20, 2006, 09:49 AM This thread is the most informative one on city up keep that I have read. Alot of info in there that any civver should use.
rev063 Jan 20, 2006, 04:28 PM All of this makes it very hard to know whether a city is "breaking even" (or was really worth founding), because the cost is hidden (between other cities, civics cost, and possibly inflation too).
That's the nub of the problem. It's hard to know whether it's economically useful to found a new city or not, without knowing what the marginal cost would be.
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. In this case, I'd need to generate at least 12gpt from worked tiles before this city was profitable, and probably more.
- 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.
Yehbo Jan 20, 2006, 10:46 PM 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!)
- 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.
spiceant Jan 21, 2006, 09:28 AM 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.
eg577 Jan 22, 2006, 12:27 PM 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),
Tom183 Jan 30, 2006, 03:44 PM If you draw another ring around the "cheesy circle" at 9 units distance, you get a "Cheesy Doughnut". :D
Krikkitone Feb 03, 2006, 12:36 PM 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)
StevenJoyce Feb 04, 2006, 10:49 AM 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.
Mirc Feb 04, 2006, 10:55 AM 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)?
Krikkitone Feb 15, 2006, 06:12 PM 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
Qitai Feb 15, 2006, 09:04 PM 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.
Roland Johansen Feb 15, 2006, 11:01 PM 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?
VoiceOfUnreason Feb 15, 2006, 11:54 PM [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?
namaska Feb 16, 2006, 05:01 AM 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).
namaska Feb 16, 2006, 05:49 AM 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.
Krikkitone Feb 16, 2006, 12:28 PM 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
Krikkitone Feb 16, 2006, 12:40 PM )
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 Feb 16, 2006, 02:01 PM One thought, perhaps Total population enters into the formula, that could be a complicating factor.
namaska Feb 17, 2006, 01:30 AM 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.
Krikkitone Feb 18, 2006, 11:46 AM 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)
ohioastronomy Feb 18, 2006, 02:13 PM 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?
Roland Johansen Feb 18, 2006, 07:11 PM 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.
Krikkitone Feb 19, 2006, 01:19 PM 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?
Well the Distance maintrenance for the three non-capital cities would probably be 1 (rounding is down in everything in Civ 4 so far), possibly 2 since the formula isn't 100% accurate, but it seems to give higher results rather than lower ones... rounding down that we don't know about.
# cities maintenence would be
.9*.3*4=1.08 base meaning
1.08+0/4=1 for the first city
1.08+1/4=1 for the second city
1.08+2/4=1 for the third city
1.08+3/4=1 for the fourth city
for a total of 2 maintenance in each non capital city and 1 in the capital
so on the finance screen
3= Distance maintenance
4= # of cities Maintenance
Civic Maintenance=6
Government:= 1
Legal: = 1
Labor: 0
Economy:= 2
Religion:= 2
For a total of 13 in non-unit pre interest maintenance costs
ohioastronomy Feb 20, 2006, 09:55 PM Thanks Krikktone, here is a revised estimate.
Here is a worked example of what I understand to be the case for Emperor, not organized civ, no luxury resources (e.g. happiness limit is 4 for the capital, 3 for extra cities). I've applied the formulae here and in the civics case (assuming one free maintenance civic and the others low maintenance, civ 4 v 1.52). The first column is the number of cities (assumed pop 4 for capital, pop 3 for others). The second is the assumed distance (I took minimal number for placing cities in a grid such that all tiles could be worked in theory). The third, fourth, and fifth are the cumulative distance cost, cumulative number of cities cost, and cumulative civic maintenance. The last two are the most important: they are the net cost of adding city x and the effective research rate that you get if you have two free maintenance (one from trade, one free) and support maintenance costs with one/two 3 commerce tiles (e.g. village, non-river, non-financial).
# Cities Dist Distcost Numcity CivicCost Maint CityCost Comm%
1 0 0 0 2 2 0 85/88
2 5 2 1 3 6 4 67/75
3 5 4 2 5 11 5 52/66
4 5 6 4 6 16 5 43/60
5 5 8 6 8 22 6 33/54
6 7.5 11 9 10 30 8 21/46
7 7.5 14 13 13 40 10 7/38
8 7.5 17 17 17 51 11 NA/29
9 7.5 20 21 18 59 8 NA/26
10 10 24 27 20 71 12 NA/19
So, if you had a size 4 capital and size 3 colonies; for each city you had one 3-commerce tile; and all other tiles were devoted to other things (hammers/food) you'd be able to support at most 7 cities (at a 7% research rate). If you dedicated 2 tiles to commerce per city, you can postpone (but not avoid) a steep tech plunge; cities 6+ add little. The marginal cost for cities 6+ are high relative to your population base, so the optimal size would be somewhere around 4-5 cities (e.g. you gain little in the early game from having more than this). If you had a higher commerce yield, you'd change this a bit. If you add luxury resources your maintenance rises (but mostly above 4-5 cities). Based on all of this, it looks as if for emperor/not organized the logical breakpoint for early cities is somewhere around 4-5, if I've run the numbers properly..
hollebeek Feb 20, 2006, 11:09 PM It usually aims for the maximum number of resources in the city radius, with less consideration for potential food/production/commerce in the city. Resources can be attained even if they're not in your city's workable tiles though, so sometimes it's better to build cities without direct access to a resource, if it gives you better overall tile values for the city. After getting experience with the game, I've found I can almost always place better cities without the recommendations visible. After all, the human mind is excellent at pattern recognition and goal-oriented planning, two things that are very harde to code.
The biggest problems are:
(1) it doesn't consider placement of other cities. sometimes moving a city
a little lets you fit in another one that gets the "missed" resource.
(2) hardly ever considers the benefits of plains hills, fresh waters, or coast
Furious Feb 23, 2006, 01:58 PM Very interesting and precious data.
I've been thinking about how to turn the information into a rule of thumb on how many cities to found (or to not-raze). So I'm going to say a lot a vague things without numbers, but they might be useful rules in practice.
I am pretty convinced that after the nineth city, additional cities are unlikely to be paying for themselves in GOLD. Unless they have a lot of commerce, they're probably COSTING you gold.
HOWEVER, we should ask what the cities are contributing in total, something I call their UTILITY. Cities contribute gold+science+production+resources output+national borders. These things can't be measured in gold (except gold :) ), so you have to try and put a price tag to them in gold equivalents. I'm not even going to try. I'm simply convinced, and I hope the readers are too, that the total utility of a city will offset its maintenence costs well after the ninth city, assuming we're talking about a well-rounded city that's contributing SOMETHING other than its own food. This can be production, commerce, a good resource, etc.
So when do well-rounded cities' utility stop offsetting their maintenance costs? I'm going to say, without proving it, that this point is well after the fifteenth city. And I don't care how much after, because, you see, I've rarely had more than this number of cities. And if I did, then the game has already been won.
So my rule of thumb is: if you have less than 15 cities, keep founding / not razing cities, as long as they're in viable locations that can give decent UTILITY. This rule applies most of the time in most of the games. If you have more cities, seriously consider if a new city's total UTILITY is going to offset its cost in gold. This is hard to say! If you have mainenance reducing factors such as courthouses or Versallies, it makes your decision somewhat easier.
Krikkitone Feb 25, 2006, 12:54 PM I am pretty convinced that after the nineth city, additional cities are unlikely to be paying for themselves in GOLD. Unless they have a lot of commerce, they're probably COSTING you gold.
HOWEVER, we should ask what the cities are contributing in total, something I call their UTILITY. Cities contribute gold+science+production+resources output+national borders. These things can't be measured in gold (except gold :) ), so you have to try and put a price tag to them in gold equivalents. I'm not even going to try.
Well actually that Can be calculated
Gold is the equivalent of about 2 commerce (the science+gold factor that CAN be measured in terms of gold)
The cost of the pop 20 city on Deity level
I (Interest Factor)
*( ~10-15 for Civic upkeep from city (pop 20).. assuming 10
+ City # limit 8 .. divide by 2 with courthouse=4
+ Distance Factor .. gets to a max of about 25..10-15 with courthouse)
so once you have courthouses, the maximum expense of a city is probably about 40 Gold=(~10 Civic, ~10 Distance, ~5 City #) * ~1.6 for Interest (in the mid/late game)... ALL REALLY rough #s
If that city is all non special Water tiles (the worst really Usable* tile), for a total of ~50 (40 terrain commerce, and probably 10 trade commerce... because of the harbor and the long distances from your own cities), then the Utility ends up being equivalent to 100 Gold once the city has the appropriate improvements (1 Commerce is equivalent to 2 gold once cities are properly built up)... so the net ends up being fairly high, even for a relatively lousy spot (a city with about 7 towns could top that.)
The issue is the time required, for Towns to grow or Banks, Marketplaces, Libraries, Observatories, etc. to be buit, or populations to grow.
Every city Will be profitable eventually, in a raw commerce sense, ignoring the hammers, resource access, or other strategic positioning issues. The issue is how Soon it will be profitable (and how expensive it will be in non Gold terms, like military, to hold on to it)
* I'm not counting Peaks, Ice, Tundra, or Desert as 'usable'.. a city that has an overwhelming amount of those may never be profitable... however those also result in a lower population and so lower cost for the city.
Krikkitone Mar 07, 2006, 12:51 PM Had to rearrange a formula or two (relooking at the data)
Distance seems to be (because we only have Normal Map Deity data... I realized I was calculating it based on Normal Difficulty
[Difficulty Factor*Distance*(Pop+7)/29]
That 29 is probably some combination of a variety of Map Size factors
Number seems to be
[Size%*Diff%*Number of cities*(Pop+17)/18 +City Rank/Number of cities]
With some rounding probably happening internally (estimates from this are all too high)
tveit1 Mar 09, 2006, 03:14 PM OMG..
someone get a life...including myself who are playing this...
zerza Apr 08, 2006, 10:07 AM Actually the cheesy wheel works great on online games, especially team games. Its a strategy thats been used since PTW.
eg577 Apr 15, 2006, 05:56 PM The formulas for maintenance start at Line 4,872 in CvCity.cpp. I haven't checked these formulas against any data, this is just deciphering the code and putting it into a presentable form.
Distance Maintenance
Here is the tidy formula (ignoring rounding):
{from CvCity.cpp L4,899}
DistanceMaint = (Pop + 7) * 2.5 * Distance/DistanceScale * Building_m * WorldSize_m * Handicap_m
where
Distance = distance to closest goverment center (Palace, Forbidden Palace, Versailles)
As usual, distance is calculated by treating diagonal steps as 1.5 steps (round down the final result).
DistanceScale = (MapHeight + MapWidth) {from CvMap.cpp L925}
Height and/or Width are halved if there is wrapping in that direction.
Building_m = .5 if courthouse, 1 otherwise
Worldsize_m: Duel=.50, Tiny=.60, Small=.70, Standard=.80, Large=.90, Huge=1
Handicap_m: Settler=.45, Chieftain=.55, Warlord=.65, Noble=.75, Prince=.85, Monarch=.90, Emperor=.95, Immortal=1, Diety=1
The not-so tidy formula with all the rounding should be (worth verifing):
[ ([25*Distance*(Pop+7)/10] * Building_m * WorldSize_m * Handicap_m) / DistanceScale ]
Here [...] means round down. I left out a few [...] to keep it clean - you also have to round down after applying each of these multiplicative factors: Building_m, WorldSize_m, Handicap_m (apply the factors from left to right)
Big Curiosity (possible bug?): the '25' is actually the value of MAX_DISTANCE_CITY_MAINTENANCE in GlobalDefines.xml. Yet the 25 is just multiplied on; there is no min(25,distance) operation like you would think (See CvCity.cpp L4,912)
Number of Cities Maintenance
Here is a simplified formula (ignoring rounding and leaving out CityRank caclulations). 'N' is the number of cities you control:
{from CvCity.cpp L4,940}
CityMaint = N * (Pop + 17)/18 * WorldSize_m * Handicap_m + (1 for some cities, depending on cityrank)
CityMaint = min(CityMaint, CitiesHandicap) * Building_m
where
Worldsize_m: Duel=.45, Tiny=.40, Small=.35, Standard=.30, Large=.25, Huge=.20
Handicap_m: Settler=.40, Chieftain=.50, Warlord=.60, Noble=.70, Prince=.80, Monarch=.85, Emperor=.90, Immortal=.95, Diety=1
CitiesHandicap: Settler=4, Chieftain=4, Warlord=5, Noble=5, Prince=6, Monarch=6, Emperor=7, Immortal=7, Diety=8
Building_m = .5 if courthouse, 1 otherwise
The full formula is (again apply the following multiplicative factors from left to right and round down after each multiplication: WorldSize_m, Handicap_m, Building_m):
NumCitiesPercent = [100 * (Pop + 17)/18] * WorldSize_m * Handicap_m
CityMaint = [N * NumCitiesPercent/100] + (1 if CityRank/N * 100 > 100 - (N * NumCitiesPercent) % 100)
CityMaint = min(CityMaint, CitiesHandicap) * Building_m
CityRank is 0 for the captial, 1 for the next closest city, and so forth (more precisely CityRank goes by distance first, game turn founded second, and unique city ID third.) '%' is the modulo operation, i.e. 11 % 3 = 2. Intuitively cities with higher city rank get the +1. Because of the modulo though it ends up being more of a fudge factor.
Krikkitone Apr 16, 2006, 08:57 PM Because of the modulo though it ends up being more of a fudge factor. The courthouse makes the CityRank calculation irrelevant anyways, due to rounding.
Actually Not entirely
if 'Pre courthouse' the # city maintenance is 4 or 5 depending on the fudge factor, they will both end up as 2... but if it is 5 or 6, they will end up as 2 or 3.
But you are right it is a fudge factor to stop wierd massive jumps.
Nice to know the actual formulas. (Mine were wrong because It seems to be the Actual Map and not the 'Map Size', and then there is the rounding effect)
on a little side note, that means that if You have an empire that has run out of Foreign Trade routes that the empire size where the new Free Market and State Property are equal for Size 20 cities, fully developed, on a square unwrapped Huge map, at 50% Interest Deity Level, with optimum arrangement (cities evenly throughout circular areas around the 'Palaces'
1/3 of the map area
* Number of 'Palaces' (1-3)
* ~4 if down to Settler level (inverse square of modifier)
* ~4 if on a dual map (inverse square of modifier)
*~2 if all Harbors
/4+ if cities are missing Banks/Marketplaces and Grocers
/4+ if cities are missing Courthouses.
So an undeveloped, isolationist empire on a Noble difficulty, Standard map favors SP over FM at about 1/10 of Map area. Fully developed, FM is better than SP all the way up to the Domination Limit.
(Population affects both Distance maintenance and Trade routes, so the population isn't much of an issue)
a 'Watery' map removes some potentially profitable city sites, but allows for harbors.
eg577 Apr 17, 2006, 05:40 PM Thanks for spotting that error (silly odd numbers...). I edited the post and also fixed some misc. things.
I tested to see whether that '25' is really manifesting itself as a multiplication (as in maybe the code in the SDK had an uncorrected error). The SDK code agrees with the game code - the game really does multiply the 25 in there. In my tests I did uncover a very unusual find however: Land Mass Type and/or sea Level affect Maintenance.
With a pangea map, low sea level, diety, standard map size my pop 1 city at a distance of 40 (18 up and 15 northwest, so there isn't a shorter route going across the world) had 11 distance maintenance, whereas if I change 'pangea' to 'balanced' and low sea level to medium it has only 9 maintenance. I repeated the experiment with a size 10 city at distance 10 (6 vs 4 maintenance) and a size 15 city at distance 15 (12 vs 9 maintenance). A guess would be that the .8 for standard size map gets bumped up to 1.0 for low sea level pangea maps (I haven't tested those two individually yet though).
Krikkitone Apr 18, 2006, 10:59 PM well the actual Sizes (Max ht+ Max Width) of a Pangea Standard map and a Balanced Standard map are different
"Standard" is adjusted to get a particular amount of usable terrain/potential city spots or something like that) with whatever map type it gets.
glundberg Apr 19, 2006, 06:16 PM This is a section from a larger project I'm working on. It should explain all the observations in earlier posts. Things really are not all that strange and there are no humps or plateaus. It's a simple linear function, albeit with a number of factors.
bertram Jul 10, 2006, 06:58 AM map size
Is there some kind factor/rule of thumb to figure out how much maintenance you pay on a small map compared to a standard map?
What's the OCN each map type?
my current game: I'm playing immortal on a small map, and have ca 9 cities, 700BC. And founding more cities cripples my economy.
alatari Jul 17, 2006, 09:16 PM Wow this has gotten to be a scientific study...
Good work and good information.
It's hard to calculate but founding a city to form up a border to keep out an ally is worth a great deal.
After playing on a huge map (240 x 120) in what would be China and after founding my 33rd city I decided to come read up on city maintenance costs.
NaZdReG Jul 23, 2006, 09:15 PM This is awesome research.
I had an old diagram for visual aid of the "cheesy circle" otherwise known as ring city placement. it also is layed out in such a way to make sure that your surrounding cities get 13-14 tiles a piece to work, provided you make sure they only work the tiles specified. hopefully it will be useful to some
NaZ
Naastriil Aug 04, 2006, 02:47 AM Wow. I never tought this thread would start a CIV science. :)
CivScientist Aug 16, 2007, 02:21 PM The formulas for maintenance start at Line 4,872 in CvCity.cpp. I haven't checked these formulas against any data, this is just deciphering the code and putting it into a presentable form.
Distance Maintenance
Here is the tidy formula (ignoring rounding):
{from CvCity.cpp L4,899}
DistanceMaint = (Pop + 7) * 2.5 * Distance/DistanceScale * Building_m * WorldSize_m * Handicap_m
where
Distance = distance to closest goverment center (Palace, Forbidden Palace, Versailles)
As usual, distance is calculated by treating diagonal steps as 1.5 steps (round down the final result).
DistanceScale = (MapHeight + MapWidth) {from CvMap.cpp L925}
Height and/or Width are halved if there is wrapping in that direction.
Building_m = .5 if courthouse, 1 otherwise
Worldsize_m: Duel=.50, Tiny=.60, Small=.70, Standard=.80, Large=.90, Huge=1
Handicap_m: Settler=.45, Chieftain=.55, Warlord=.65, Noble=.75, Prince=.85, Monarch=.90, Emperor=.95, Immortal=1, Diety=1
The not-so tidy formula with all the rounding should be (worth verifing):
[ ([25*Distance*(Pop+7)/10] * Building_m * WorldSize_m * Handicap_m) / DistanceScale ]
Here [...] means round down. I left out a few [...] to keep it clean - you also have to round down after applying each of these multiplicative factors: Building_m, WorldSize_m, Handicap_m (apply the factors from left to right)
Big Curiosity (possible bug?): the '25' is actually the value of MAX_DISTANCE_CITY_MAINTENANCE in GlobalDefines.xml. Yet the 25 is just multiplied on; there is no min(25,distance) operation like you would think (See CvCity.cpp L4,912)
Number of Cities Maintenance
Here is a simplified formula (ignoring rounding and leaving out CityRank caclulations). 'N' is the number of cities you control:
{from CvCity.cpp L4,940}
CityMaint = N * (Pop + 17)/18 * WorldSize_m * Handicap_m + (1 for some cities, depending on cityrank)
CityMaint = min(CityMaint, CitiesHandicap) * Building_m
where
Worldsize_m: Duel=.45, Tiny=.40, Small=.35, Standard=.30, Large=.25, Huge=.20
Handicap_m: Settler=.40, Chieftain=.50, Warlord=.60, Noble=.70, Prince=.80, Monarch=.85, Emperor=.90, Immortal=.95, Diety=1
CitiesHandicap: Settler=4, Chieftain=4, Warlord=5, Noble=5, Prince=6, Monarch=6, Emperor=7, Immortal=7, Diety=8
Building_m = .5 if courthouse, 1 otherwise
The full formula is (again apply the following multiplicative factors from left to right and round down after each multiplication: WorldSize_m, Handicap_m, Building_m):
NumCitiesPercent = [100 * (Pop + 17)/18] * WorldSize_m * Handicap_m
CityMaint = [N * NumCitiesPercent/100] + (1 if CityRank/N * 100 > 100 - (N * NumCitiesPercent) % 100)
CityMaint = min(CityMaint, CitiesHandicap) * Building_m
CityRank is 0 for the captial, 1 for the next closest city, and so forth (more precisely CityRank goes by distance first, game turn founded second, and unique city ID third.) '%' is the modulo operation, i.e. 11 % 3 = 2. Intuitively cities with higher city rank get the +1. Because of the modulo though it ends up being more of a fudge factor.
In these formulas, does Pop represent the population of the individual city or the population of the entire empire?
Samson Aug 16, 2007, 07:51 PM In these formulas, does Pop represent the population of the individual city or the population of the entire empire?
The individual city
ruff_hi Dec 20, 2007, 01:58 PM Distance = distance to closest goverment (sic) center (Palace, Forbidden Palace, Versailles)This is interesting. I am planning a very large game on a huge map and I'm concerned about distance maintenance. I'm going to put together a little spreadsheet that will give me the optimal location for my Palace, Forbidden Palace and Versailles. I will post some results and a screen shot or two later.
Roland Johansen Dec 20, 2007, 02:41 PM This is interesting. I am planning a very large game on a huge map and I'm concerned about distance maintenance. I'm going to put together a little spreadsheet that will give me the optimal location for my Palace, Forbidden Palace and Versailles. I will post some results and a screen shot or two later.
Should the size of the map really be an issue? The distance maintenance is scaled by the size of the map:
DistanceScale = (MapHeight + MapWidth) {from CvMap.cpp L925}
ruff_hi Dec 20, 2007, 03:07 PM No, the size of map won't be an issue. But I am planning a very long, very big game with lots and lots of cities and that will be an issue. I want to get these three items positioned optimally. I would expect some form of equilateral triangle but I'm not sure of the orientation of said triangle.
Roland Johansen Dec 20, 2007, 03:40 PM No, the size of map won't be an issue. But I am planning a very long, very big game with lots and lots of cities and that will be an issue. I want to get these three items positioned optimally. I would expect some form of equilateral triangle but I'm not sure of the orientation of said triangle.
Oh, sorry. I had misunderstood you.
An interesting question. It's probably very dependent on the shape of the various continents and therefore will typically be different in every game.
ruff_hi Dec 20, 2007, 08:57 PM It appears that on the settings used, the distance-based corruption is equal to the distance to the palace divided by 4.5, as long as the city in question is along a straight axis from the palace. I also tested distance along a diagonal distance and found that the diagonal distance does not obey Pythagoras’ theorem. Instead it appears that the program counts diagonal distance as equaling 1.5 times the value of horizontal distance, rounded down. This makes sense as this was the method used to calculate distance in Civ3.Can someone explain what it means by 'diagonal distance as equaling 1.5 times the value of horizontal distance' with some examples. I cannot seem to see how to apply this formula to the diagram also shown on the first page.
Roland Johansen Dec 21, 2007, 01:35 AM Can someone explain what it means by 'diagonal distance as equaling 1.5 times the value of horizontal distance' with some examples. I cannot seem to see how to apply this formula to the diagram also shown on the first page.
Diagonal distance is measured fairly simple in civ4. The first diagonal step is consider a size 1 step, the second a size 2 step, the third size 1 again, the fourth size 2 again, etc. Or in formula: max (horizontal distance, vertical distance) + [1/2 min (horizontal distance, vertical distance)], where [number] means that you should round that number down.
This formula is used to calculate cultural borders (basic expansion is at distance 1, next one which contains the fat cross is at distance 2, next one distance 3, etc) and bombing distance of fighters and bombers. It is not used in unit movement where diagonal steps are consider size 1 steps.
It is used in the distance calculation for city upkeep.
ruff_hi Dec 21, 2007, 09:29 AM Thanks for the formula.
Here are my results. I am looking at a Huge Rainforest map (84 x 52) and I want to get the biggest civ land area possible. Domination limit for this map is 56%. This means I can have a civ that is 47 x 52 or 84 x 29 (this is my target civ land area). The first results in a civ land area that is almost square while the second results in a civ land area that is long and skinny.
Using the formula above, I set up an excel file with three possible city locations (C1, C2 and C3) and then set up calculations as follows:
calculate the distance from these city sites of every tile (all 4368 of them)
calculate the minimum distance for each tile from these three city locations - - the value for any tile outside of my target civ land area is set to zero
divide the minimum value by 4.5 (value pulled from the first post of this thread)
sum the total distance for every tile
adjust the locations of C1, C2 and C3 such that this total distance is a minimum (I used excel's solver for this)
Using the target civ land area of 47 x 52, I get these city locations ... 25, 40 11, 16 36, 15
These cities are shown in the diagram below ... as expected, the three cities are in a (sort of) equilateral triangle.
http://img178.imageshack.us/img178/8398/citylocation1vp5.jpg
Using the second target civ land area of 84 x 29, I get these city locations ... 14, 15 43, 15 70, 15
These cities are shown in the diagram below ... again, as expected, the three cities line up at the half way mark vertically (15) and are evenly spread horizontally (14, 43, 70).
http://img178.imageshack.us/img178/2893/citylocation2fg9.jpg
The question is - which layout is better from a minimum distance point of view. The answer ...
... is the second one. The first one (triangle) results in a minimum calculation of 6720 while the second (line) results in a minimum calculation of 6291Note: I have taken some liberties by calculating the minimum distance for every tile. Technically, I should probably position city locations and calculate for these cities but that is just a little (actually way) too much work. Also, I have ignored the features on the rainforest map (there is 1 large area of desert and 1 or 2 large areas of mountains)
http://img180.imageshack.us/img180/9272/civ4screenshot0009pq9.jpg
kniteowl Mar 29, 2008, 08:50 AM Just reed the Article, I usually don't read technical stuff becasue most of the time I don't understand the diagrams and Formula but is it really true?
Courthouses don't affect civic upkeep? that means civic upkeep never gets's halved by courthouses? wow I've honestly never realized this before, I've always assumed that Civic upkeep was apart of Maintenance cost now I know... this is still true for BTS and WL right?
Roland Johansen Mar 29, 2008, 02:11 PM Just reed the Article, I usually don't read technical stuff becasue most of the time I don't understand the diagrams and Formula but is it really true?
Courthouses don't affect civic upkeep? that means civic upkeep never gets's halved by courthouses? wow I've honestly never realized this before, I've always assumed that Civic upkeep was apart of Maintenance cost now I know... this is still true for BTS and WL right?
Courthouses don't affect civic upkeep. This has always been true and is true for every version of civilization 4.
Civic upkeep is completely different from city upkeep. It is even in a different category from city upkeep in the financial advisor. I don't know why you would expect courthouses to halve civic upkeep.
I wrote an article on civic upkeep a long time ago, but it's still correct and can also be found in the War Academy. The organized leader trait is the only thing that can seriously reduce civic upkeep.
Jerrymander Apr 05, 2008, 11:38 AM Just reed the Article, I usually don't read technical stuff becasue most of the time I don't understand the diagrams and Formula but is it really true?
Courthouses don't affect civic upkeep? that means civic upkeep never gets's halved by courthouses? wow I've honestly never realized this before, I've always assumed that Civic upkeep was apart of Maintenance cost now I know... this is still true for BTS and WL right?
True. They don't affect it. Never gets halved. True for all expansions.
Civic upkeep is cut by the Organised trait.
Diamondeye Jun 11, 2008, 04:48 AM Read OP and skimmed thread. Really good work, thankyou alot :)
I have two questions:
1) Krikkitone mentions that the max city upkeep increases with difficulty level. This does not seems apparent to me by the Warlord/Monarch Graph. Can anyone confirm or decline this? It seems as if Warlord is gaining maintenance slower (ie more cities are needed before hitting the plateau), but that the plateu is almost same height.
2) Can a graph like the one mentioned above be made for Emperor, Immortal and/or Deity. It would be nice know where the Plateaus are on these difficulties.
Thanks for a good article :)
Yxklyx Jun 11, 2008, 10:00 AM From reading this it seems that...
When you build a new city some of the new maintenance is spread around your empire; however, a courthouse only reduces the amount in that city. Say you build a city that costs you an extra 10 in that city and another 10 spread about the empire - so an extra 20. The courthouse however only reduces the maintenance cost by 5 correct?
Diamondeye Jun 11, 2008, 06:30 PM From reading this it seems that...
When you build a new city some of the new maintenance is spread around your empire; however, a courthouse only reduces the amount in that city. Say you build a city that costs you an extra 10 in that city and another 10 spread about the empire - so an extra 20. The courthouse however only reduces the maintenance cost by 5 correct?
Correct, even though the example is flawed as a city has a cap of 6 :gold: in City Maintenance.
Roland Johansen Jun 11, 2008, 07:47 PM Read OP and skimmed thread. Really good work, thankyou alot :)
I have two questions:
1) Krikkitone mentions that the max city upkeep increases with difficulty level. This does not seems apparent to me by the Warlord/Monarch Graph. Can anyone confirm or decline this? It seems as if Warlord is gaining maintenance slower (ie more cities are needed before hitting the plateau), but that the plateu is almost same height.
2) Can a graph like the one mentioned above be made for Emperor, Immortal and/or Deity. It would be nice know where the Plateaus are on these difficulties.
Thanks for a good article :)
From reading this it seems that...
When you build a new city some of the new maintenance is spread around your empire; however, a courthouse only reduces the amount in that city. Say you build a city that costs you an extra 10 in that city and another 10 spread about the empire - so an extra 20. The courthouse however only reduces the maintenance cost by 5 correct?
Correct, even though the example is flawed as a city has a cap of 6 :gold: in City Maintenance.
While the original post was extremely interesting at the time it was written, some code readers have found the exact formulas for the city distance maintenance and number of cities maintenance. The original graphs just show the upkeep for one single situation: one difficulty level, one population size and one map size. The actual formula is dependant on map size, population level and difficulty level and thus is a lot more complicated than what can be captured in one single graph. The pattern that emerges from the graphs is still interesting, but you can understand the upkeep a lot better if you know and understand the formulas. They can be found in post number 89 of this thread (written by eg577). Note that the original poster of this thread could never have found these formulas as he wrote the article at a time that the SDK wasn't available yet. The article was very interesting when it was written and the nature of the graphs is still interesting although I prefer the exact formulas.
Some information that might answer a part of your questions (and can also be found in eg577's post):
City upkeep is divided into 2 parts, number of cities upkeep and city distance upkeep. It's the number of cities upkeep that goes up for all of your cities when you found a new city. The city distance upkeep doesn't change when you found a new city. However, the number of cities upkeep also has a maximum which is dependent on difficulty level (the value of 6 which is mentioned in Diamondeye's post is the maximum at prince and monarch level). So after you have founded a certain number of cities (dependent on map size and city size and difficulty level), you won't see it go up anymore for the older cities as the maximum level has been reached (which is named the conquerors plateau by the original post).
It's a lot of work to create new graphs for different situations and there are many many different situations as the graphs would change dependent on map size, difficulty level and size of the cities. I don't think it's a very useful exercise.
The courthouse only reduces the upkeep locally and adding a new city can also increase the number of cities upkeep in older cities. Eventually, all of your cities will have a number of cities upkeep equal to the maximum number of cities upkeep (which is a value between 4 and 8 dependent on difficulty level). This upkeep usually makes it interesting to eventually build a courthouse in every one of your cities, especially on the higher difficulty levels where the maximum number of cities upkeep is a lot higher. Of course, a courthouse in a distant city is more interesting as these cities also have a high city distance maintenance.
Diamondeye Jun 12, 2008, 08:03 AM Okay, thanks alot Roland Johansen, I'll have a look at the post 89.
redmosquito Jun 13, 2008, 03:16 AM Am I the only one who does not see any diagrams in the first page?
Roland Johansen Jun 13, 2008, 03:36 AM Am I the only one who does not see any diagrams in the first page?
I can see several pictures (graphs and such in jpg-format) in the first page. Maybe your browser settings are too strict and block the pictures.
csarmi Jul 11, 2008, 02:19 PM These formulas don't seem to work for me (in BTS). What has changed? In which files (civ4 files I mean) can I look up these myself?
Alexchamp Jul 28, 2008, 12:34 PM Who knows how to influence to the city upkeep of quality vassals?
How vassal increases the upkeep of city ? Who knows the formula ?
Aleph_Strategy Aug 03, 2008, 02:33 PM One of the best guides I have ever read on civfanatics and also very useful!:goodjob:
Jerrymander Aug 03, 2008, 05:37 PM Who knows how to influence to the city upkeep of quality vassals?
How vassal increases the upkeep of city ? Who knows the formula ?
They don't.
moyang Aug 07, 2009, 06:00 PM Who knows how to influence to the city upkeep of quality vassals?
How vassal increases the upkeep of city ? Who knows the formula ?
Vassal's city counts toward your city numbers.
|
|