City Growth

Tigger70

Chieftain
Joined
Dec 16, 2005
Messages
9
I have been inquiring into the system of city growth in civ IV. Sufficient results have been obtained to warrant posting and discussion.

A note about our topic: the fundamental dynamic at work in civ is the acquisition of rights to work game tiles. Aside from the food management issue, working such tiles yields commerce points and hammer points, and on this all else depends. Hammers are developed into units and resource multipliers (buildings); commerce generates trading options with other AI civs and, most obviously, beakers for the acquisition of techs. Managing the rate at which new tiles can be acquired is accordingly central to strategic play. This suffices as a defense regarding the significance of the topic.

I will proceed to list the findings of interest point-by-point. All numerical values are applicable for the correct game speed (epic speed). I have not inquired into how the system works at other speeds.

(1) Growth Requirements
A city of size 1 requires acquisition of 33F to grow to size 2. A city of
size 2 requires 36F, size 3 39F, size 4 42F, and so forth (temporarily
setting aside the effects of a granary). So far as I can determine this
system of +3 storage required per size > 1 continues indefinitely. A
size 20 city requires 90F stored to grow to size 21, which is in
accordance with the basic pattern. The core point to note here is that
there exists no “cut-off” point beyond which further growth becomes
abnormally more difficult than it was before (I mean this with
respect to storage requirements only. Obviously the availability of
health, happiness, and so forth can present interacting factors that
make further growth not possible).

(2) Food surpluses wrap after growth
When scanning over the food bar in the city screen we might see a value
of something like 42/48. What this means is that 42F surplus has been
stored, with 48 required for the current growth cycle to complete.
Suppose that we have a 10F surplus at this time. The city will
grow at the conclusion of the present turn. On the next turn the city will
show 4/51 - meaning that the extra 4F not needed for the cycle
has “wrapped” over into the next cycle. This alleviates the potential
need for obnoxious micro-management. Without it we would want to
remove citizens from food-tiles towards the end of a cycle so as to avoid
accumulating resources that will be lost. Fortunately matters do not
work this way.

(3) Granaries, Part 1
The granary stores 50% of the needed food in one cycle for use in the
next. What this would mean in our previous example is that when the
42/48 city grows, the food bar will show 28F on the next subsequent
turn. 50% of 48 = 24, plus the extra 4F which “wraps” after growth =
28F total. If we were running a food surplus of 6F in that example (thus
matching the needed amount exactly), 24F would appear on the
immediate following turn via the granary effect alone. Note that the next
cycle would require 51F for growth, so we would see 24/51 on the
next cycle. This is slightly less than 50% of what is required for the next
growth increase. In practice the difference is negligible, but it is
noteworthy for understanding how the system
works.

(4) Population and whipping (slavery civic).
The program straightforwardly eliminates X population when whipping
without doing anything else. What I mean by this: suppose we have a
size 6 city with 26/48 in the food bar and we whip 2 citizens. After
whipping we will show size 4, 26/42. The 26F present before
the whipping operation remains. This produces outcomes that can
appear weird in certain situations when not paying attention. Suppose we
have a size 6 city with 46/48 and we whip two citizens. After the
whipping operation we will have 46/42 with growth in 1 turn. On the
next turn the city is size 5 and it appears that we whipped only 1
citizen. If we had NOT whipped the citizens, the city would have grown
to size 7 on the relevant turn (assuming at least 2 food surplus). Since
we DID whip the citizens, the city is size 5 on the following turn -
a difference of 2 citizens, as advertised. It is a matter of understanding
that only the population has been eliminated, not the stored F-values
that have been accumulated.

(5) Calculating the food surplus
Suppose we have a size 3 city working tiles (1) a farmed flood plain, (2) a
mined grassland hill, and (3) another mined grassland hill. Each citizen
requires 2F support. The farmed flood plain provides 4F, the mined hills 1
F a piece - yielding 6F total. Since we have 3 citizens needing 2F each,
we have met the requirements and it would appear that the city should
be stagnant. But it isn’t. A related way of thinking about these tiles
holds that the flood plain is “supporting” the mines squares. This way of
thinking has its uses but it misses the point. Regarding the first
observation: the city is effectively given a “0-citizen” tile to work. This
is the city’s base (home) tile - usually 2F 1P 1C. This “free” tiles gives a
+2 food surplus if all the other tiles come out even (with respect to
surplus). The above calculation is skipping the base city square - the
city will have a +2F surplus because of the “free” tile. Regarding the
“way of thinking” mentioned above: The art of city food maintenance is
the art of managing the rate at which new tiles can be worked. This is
directly tied to the city’s food surplus at any given time, which in turn is
the only value that matters. It is true that tiles (1), (2), and (3)
will be neutral with respect to food surplus. In this sense the flood plain
is “supporting” the mined squares. We don’t want to manage city growth
though via the roundabout method of balancing which squares
are “supporting” others. Doing so constitutes a mistake in
understanding what the fundamental driving factor is in managing city
growth: the food surplus value, which determines the rate at which new
tiles can be worked over time The two points to note here are (1) the
effect of the free “0-citizen” tile in calculating the food surplus
value (it usually adds +2) and (2) understanding that the core value
which matters is the food-surplus number.

(6) City-Growth Table
At certain stages in the game we review our cities while they are in
various stages of their growth cycles. When they are midway or further
in a growth cycle, changing worked tiles (and thus the food-surplus
value) changes the number of turns remaining in the cycle by a
considerable factor - often by 3-5 turns. City growth management
however is ultimately a long-term project. We are interested in managing
the number of turns required to move from size 5 to size 10, 15, and
beyond. To understand the factors involved in this long-term
project, we need to understand the cumulative effect of average food-
surplus values over an extended period of time. The following chart is a
tool I have put together for this purpose.

http://forums.civfanatics.com/attachment.php?attachmentid=115780&stc=1&d=1139619912

(I do not understand the file posting system. They usually appear in a different format than what I'm seeing in the "Preview Post" function. I can only hope that it is functional. For that matter the spacing construction is rather odd too. No time available at the moment to fix this.)

The rows are food-surplus values, while the columns indicate current city
size. Each cell consists of two numbers. The first number gives the
number of turns required for city growth if the city does not have a
granary. The second number provides the number of turns required
if the city does have a granary (and it was functional during the previous
growth cycle). The table does not take into account the food-wrap
issue discussed above. What this means is that sometimes we will save a
turn from the provided number. For example suppose we are running a 10
-surplus city at size 4. 42F is required to advance. On the 5th turn the
city will grow, resulting in 8/45 at the start of the next cycle. With 8
food stored, we will need 4 turns to reach 48/45 and thus to grow again.
The chart however indicates 5 turns (not 4) since that is the number of
turns that would be required if we had zero food at the start of the
relevant cycle. Note what happens here though. We will move from
48/45 to 3/48 at size 6. Here 5 turns will be required, as indicated in the
chart. In short, the food-wrapping effect intermittently permits us to
save one turn. In the long-term however the number of saved
turns is largely the same regardless of which row (and thus which
average food-surplus is being used). This permits us to ignore the effect
for relative comparisons.

(7) Observations from the City-Growth table
The key feature to note from the table is the significance of running a 5-
food surplus (with a granary) or a 6-food surplus (without a granary).
Running a surplus of 4 or less comes with a very significant cost in long-
term growth. Running a surplus higher than 5 or 6 does bring distinct
advantages. These advantages however are considerably more
incremental in character than they are at the lower values. Beyond a
food-surplus value of around 6, working a zero-food citizen (mined plains
tile, specialist, etc.) is considerably more palatable than it is at lower
surplus values [note: the decision to work a zero-food citizen is
significant since the cost of doing so lowers the food-surplus value by 2,
as opposed to lowering only by 1 working a mined grassland hills or
maintaining the current surplus by working a grassland pot (cottage)].

Some quick observations to help make this point. Suppose that we are
growing a size 3 city to size 4. Without a granary, this requires 14 turns
with a 3F surplus. It requires only 7 turns with a 6F surplus,
accomplishing the task 50% faster. A second case: suppose we are
growing a city from size 3 to size 6 (without a granary). Using a 3F
surplus requires 42 turns; using a 5F surplus requires 26 turns. Again, the
difference is remarkable. On the other hand: we grow from size 3 to size
4 in 7 turns using a 6F surplus. If we increase our surplus to 9F, the
task will be accomplished in 5 turns instead of 7. Switching from a 3F-
surplus to 6F saves 7 turns. Switching from 6F to 9F saves only 2 turns.
Without a granary, a 6-F surplus is the maximally efficient number.

I will leave other observations to those who see them. The quick point
to note is the significance of the window between the 5F and 6F surplus
numbers. Running a surplus 4 or lower for any significant amount of time
will yield poor and sub-optimal returns. The 5F to 6F window is entirely
satisfactory and maximally efficient. Running a surplus beyond 6F will
yield accelerated development, but with a lowered incremental rate of
return. Beyond 6F the prospect of utilizing a zero-food citizen becomes
notably more reasonable.

(8) Obvious caveats
I mention this to ward off needing to say it at some future time. There
are obviously going to be situations in which other game factors are more
important than managing city growth. In the window before
calender/hereditary rule, we are often running with a happiness limitation
to growth. In these circumstances running a surplus of 4 or lower is
entirely reasonable. If we’re in a military conflict, running with sub-
optimal growth parameters may be advantageous and/or necessary. In
addition, when making a run for a world-wonder, emphasizing hammers in
exchange for growth can obviously be correct. The larger issue of
balancing the various intersecting factors in the game isn’t the point of
issue. We are isolating one segment of game-play to see what can be
discovered about it.

(9) Granaries, Part II
The long-term cumulative effect of granaries is quite striking. Suppose
we are growing a city from size 5 to size 15 with a steady 5F food
surplus. Without a granary the process will take 121 turns. With a
granary the process will take 66 turns. The city without the granary
requires 55(!) more turns to complete the process. This constitutes a
steady delay in acquiring new tile resources, which in turn drives all other
aspects of play. The default plan for any normal city accordingly must
include building a granary at some point or another. The issue of when to
build it is open to context, and of course there will be exceptions for
cities that are geographically placed in growth-limited locations, or are
peculiar in some other such way. For any normal city though, there must
be some feature in the larger strategic context that overrides the default
plan to make skipping the granary completely a reasonably correct
decision.

(10) The State Property civic
Suppose that we are in the later stages of developing some particular
city. We have a 3F surplus, and we intend to “complete” the city by
growing onto 3 plains tiles with 1F a piece. When this is done the city
will be completed in its capacity to work the maximal number of tiles it
can, and will accordingly be stagnated. Growth may start up again way
later when we obtain the biology tech, but we can assume this will be a
long time in coming. The obvious problem which we face here is that
growing onto the last tiles will take an extremely large number of turns.
The 3F surplus is bad enough (especially when we are likely dealing with a
reasonably large city already, with extended food storage requirements).
Matters will only get worse though when the first cycle is completed,
leaving a 2F surplus followed by the snails-pace that will arrive for the
last tile with a 1F surplus. Reasonably speaking, growing onto the
last tiles will take such a long time that we are largely foregoing their
use. The State Property civic appears designed to assist with this. The
civic is quite popular for the maintenance bonus it gives (no distance-
from-palace maintenance) but it’s effect on city growth strategy appears
to be overlooked. In many cases we will want to build windmills on plains-
hills tiles and watermills on plains-river tiles. Doing so makes both of
them interchangeable at 1F 2P 1C, and they will improve later: +1P with
replaceable parts and +2 commerce with electricity. The State Property
civic gives a +1F bonus for windmills/watermills. What this means is that
if/when we employ State Property, either as a long-term civic or as a
temporary 15-20 turn choice, we will very often be able to complete
cities that would otherwise take an inordinate number of turns. In the
above example, suppose we have 4 windmills/watermills being worked in
that city. When we adopt state property our food surplus will increase
by 4F. In the process of growing onto the last 3 intended tiles, we will
move from 7F to 6F to 5F in surpluses rather than from 3F to 2F to 1F.
The result is that the city can grow onto those last tiles in an entirely
reasonable number of turns. If/when we change out of state property
afterwards our food surplus will disappear and the city will be stagnant -
stagnant, but working the tiles that were planned for its employ. This is
often the only feasible way to enable tile utilization in the late stages of
city growth - unless we want to wait for Biology (which is typically an
unacceptable delay).
 

Attachments

  • CivIVCityGrowthTable.txt
    896 bytes · Views: 1,027
Tigger70 said:
If/when we change out of state property
afterwards our food surplus will disappear and the city will be stagnant -
stagnant, but working the tiles that were planned for its employ. This is
often the only feasible way to enable tile utilization in the late stages of
city growth - unless we want to wait for Biology (which is typically an
unacceptable delay).

I'm a bit confused that you've devoted a section to how state property can aleviate growth problema in near-capacity cities and state that biology is too long a delay. Biology and State Property are nearly identical in technology level. Both require Scientific Method. Biology is slightly more expensive in terms of it's own research cost in additon to requiring chenistry (instead of liberalism) but the difference is negligable. Actually, in most games, I have Biology before State Property (unless I am going for the Kremlin).

In general, it's hard to disagree with the rest of what you've stated. The numbers definitely suggest that 5/6 surplus food is the optimal range. I'd argue that, through much of the game, attaining that 5/6 surplus is very difficult without forgoing quite a bit of short-term benefit, if not outright impossible.

Additionally, there are any number of scenarios in which running at a surplus of 3 or 4 food, depending upon available tiles, is actually more efficient. For instance, what if running at a 3 (instead of 5) food surplus got you a granary in 10 turns instead of 20 (you decided to work a mined grassland hill instead of one farm)? If we simply run the numbers on that (assuming a granary simply functions by multiplying your food surplus by 1.5, which is actually fairly conservative), after 20 turns and a food surplus of 5, you've built up a 100 total surplus. If you went with a 3 surplus, though, at the end of 20 turns you've produced a total of ~105 surplus food (3*10 + (5*1.5)*10).

This was very simple example. Real game examples will be orders of magnitude more complex. How do you decide if building a swordsman 3 turns earlier will let you take over a city threee turns earlier and thereby get you that city's 8 population working for you 3 turns sooner? I'm sure that could be worked out mathematically, similar to the granary exercise. But that is only one of tens if not hundreds of decisions that have to be made every turn. Taking the time to calculate the "optimal" decision in every case is unfeasible.

Anyway, my general point is that, while a 5/6 food surplus may be "optimal" in a test tube. The game we play is not contained within that test tube.
 
I don't understand the reasoning behind saying a 5/6 food surplus is optimal. What is this based on?


If I'm interested in maximizing the total output over some time frame in which I can expect my city will reach a target size (say, because that's my happiness limit), then this is the right criterion:

(Ignoring things like you really would like to have a library before you start working 20 towns)

(Also ignoring roundoff errors when the surplus doesn't divide evenly into the food needed to grow)

You can consider how much output you'll have at full size, and consider how much output you have now. The difference is your "deficit", and the total "cost" of growing to the next city size is the deficit times the number of turns.


For example:

Suppose I have a production city I plan to grow to size 13 (because that's my happiness limit), and I plan to work a corn by the river, 4 grassland, 6 grassland hills, and 2 plains hills, for a net of +0 food and +27 hammers per turn.

But right now, it's size 4 with a granary.

My reasonable options seem to be to work the corn, then some combination of farmed grassland and mined grassland hills.

If I work 3 hills, I have +3 food, +10 hammers. The cost is 8 turns * -17 hammers = -136 hammers in all.

If I work 1 farm 2 hills, I have +5 food, +7 hammers. The cost is 5 * -20 = -100 hammers.

If I work 2 farms 1 hill, I have +7 food, +4 hammers. The cost is 4 * -23 = -92 hammers

If I work 3 farms, I have +9 food, +1 hammers. The cost is 3 * -26 = -78 hammers.

So overall, I'm better off taking the 9 food surplus.

Sure, switching from +5 to +7 only gained me one turn, and +7 to +9 also only gained me one turn... but because I'm so far behind my target city size, one turn is actually a big difference! I gain roughly as much by going from +5 food to +9 food as I did by going from +3 food to +5 food.

In other words, the added benefit of increasing the food surplus is decreasing, but it's still positive.


But what if I'm size 9? I might work the corn, 4 grassland, and 4 of the grassland hills. This is a +6 food surplus, and I make +13 hammers for a deficit of 14. Growth is in 5 turns, for a net cost of -65 hammers.

What if I stop working one of those hills in favor of a 5-th farmed grassland? My food surplus is now +8, and I make +10 hammers, for a deficit of 17. Growth is in 4 turns, for a net cost of -68 hammers.

So, in this case, the +6 food is better than the +8.
 
Malekithe says:

"I'm a bit confused that you've devoted a section to how state property can aleviate growth problema in near-capacity cities and state that biology is too long a delay. Biology and State Property are nearly identical in technology level. Both require Scientific Method. Biology is slightly more expensive in terms of it's own research cost in additon to requiring chenistry (instead of liberalism) but the difference is negligable. Actually, in most games, I have Biology before State Property (unless I am going for the Kremlin)."

Ah yes it seems that you are correct in this. The segment on state property is point #10 - sort of an afterthought after I had worked my way through the other stuff I was looking at. For some reason I overlooked the rather obvious fact that the techs come up at comparable times - asleep at the wheel I guess. One way to look at this: we get a choice at this stage in the tech tree as to whether to grow into the remaining tiles via farmed square bonuses (Biology) or Windmill/Watermill bonuses (via State Property). This gives us some considerable flexibility with respect to how to proceed. The indicated claims however with respect to the difference in timing between the arrival of the techs is quite apparently an error. Many thanks for this observation.

Regarding the other interesting notes mentioned in this response and others: I will see what I can find to say about these things as time permits.

Many thanks to all for contributing.
 
One way to look at this: we get a choice at this stage in the tech tree as to whether to grow into the remaining tiles via farmed square bonuses (Biology) or Windmill/Watermill bonuses (via State Property).

Minor point: Windmills do not get + 1F from State Property. Watermills do, and so do workshops (making their food impact on a tile neutral).
 
Interesting article. There is one key point, however:

You only need any food surplus when the city can grow. This means that there are long stretches of the game where you can run comfortably without any surplus, and the key for growth is having the relevant tiles so that you can turn growth on when the happiness limit kicks in. In the late game, it is true that you will grow slowly without a big surplus - but, again, you'd have to include the relevant opportunity costs. Factor in the lost hammers from working, say, a grass/hill mines, as opposed to a grass/farm, when determining whether you're better off with a +4 or +6 food surplus. If you do so forever, this cost is not trivial - it's permanent. What this suggests to me is that growth will be much less favored in hammer-rich environments, while it will be favored in cottage/commerce cities and of course favored in specialist-farm cities.
 
I decided to look a little more into the claim that a 5/6 food surplus was optimal. This struck me as a bit unusual, as I rarely carry around a 5/6 food surplus in many of my games. I'm certainly playing sub-optimally in some areas, but I figured there's no way that my typical surplus of 2/3 food in most production or commerce cities is that out of line with the "optimal" surplus.

So, based on some of the suggestions in this thread, I put together a system of evaluating the trade-off between hammers now and hammers later with faster growth. The goal was to determine how many hammers can reasonably be sacrificed for a certain level of food surplus.

Defining the scenario:
To start the exercise, I need to settle on a couple of parameters.

First is the current population level (P1) my city is at. This is important because it determines how expensive each succesive population point is.

Second, we have the target population of the city (P2). This could be based upon the current health or happiness limitations, or upon the number of workable tiles available to the city, or simply your current desire for the size of the city.

Now there are the hammer levels. I use three values for this. First, your current hammers (H1) that would be sacrificed if you chose to emphasize growth (if, in order to facilitate more growth you would have to move a citizen from a grassland hill to a grassland farm, this value would be 3).

Also, we have the target hammer level (H2) of the city, this value should not include assumed hammer output (for instance, never count the 1-2 hammer(s) from the city toward this value). This should be equal to the number of hammers you would be getting with 0 food surplus and a population equal to P2, minus the number of assumed hammers (ie. you know you'll be working a gold mine at all times).

The last hammer-related value is what I refer to as the hammer injection rate (HR). It is the number of additional hammers that each population point will bring while maintaining the same food surplus. For instance, if each citizen on the way to P2 would be working a farmed plain, then HR would be 1. This can be averaged if the injection rate is non-constant, but it gives slightly less accurate results.

Lastly, there are the two test surplus values: The current surplus (F1), at which you would be producing H1 hammers and the target surplus (F2) at which you would be sacrificing H1 hammers.

To create an example: let's say I have a city currently at 2 population working a pastured plains cow (3F, 3H) and a mined grassland hill (1F, 3H). I want to grow to 4 population, at which point I will be able to work the cow, the grass land hill, a mined plains hill, and a farmed plains (a total of 12 hammers and no surplus food, from which we would subtract the assumed hammers of 4 for the cow and the city tile). To aid growth, I also have a farmed grassland available (3F) resulting in a total surplus of 4F instead of 2F if I switched the grassland hills citizen to the farm. During my growth, I will add the third citizen to the farmed plains, for a hammer injection rate of 1. In this scenario we have the following values: P1 = 2, P2 = 4, H1 = 3, H2 = 8, HR = 1, F1 = 2, F2 = 4.

In this example scenario, with the initial surplus, it would take 18 turns to reach 3 pop and another 20 turns to reach 4 pop. So in 38 turns we would have produced (18*7 + 20*8 = ) 286 hammers. If we look at the growth focused strategy, though, we reach 3 pop in 9 turns and 4 pop in an additional 10 (twice as fast). So after the same full 38 turns we've produced (9*4 + 10*5 + 19*12 = ) 314 hammers.

But let's look at another case. I'm working (again in a pop 2 city) a mined grassland hill and a farmed grassland, but I want to grow to 4 population through working just a regular grassland (maybe it has a cottage, which I'm discounting for this analysis). I currently have a 2 food surplus, which will change to 3. The other tiles I have available are another mined grassland hill, undeveloped grasslands, and a forested plains. At four population I'd have a hammer total of 8 (6 from 2 grassland hills and 2 from the forest, discounting the city tile's output). In this scenario we have the following values: P1 = 2, P2 = 4, H1 = 3, H2 = 8, HR = 0, F1 = 2, F2 = 3.

In the second scenario we find that continueing to work the grassland hill and growing with the 2 food surplus produces (18*3 + 20*3) = 114 hammers. If we moved up to the 3 surplus we'd only be looking at a production of (12*0 + 13*0 + 13*8) = 104 hammers. In this case, the extra pop growth wasn't worth it.

What all this means:

The two basic quantities involved in all of this analysis are the hammer ratio and the growth ratio. The hammer ratio can simply be expressed as H1/H2. The higher this ratio, the less you stand to gain from growth. The growth ratio is (F2 - F1)/F2. Higher growth ratios indicate relatively higher growth rates. If the hammer ratio is greater than the food ratio then it's better to just continue working the hammer tiles and use the current growth rate. However, if the growth ratio is higher, than your total output will actually be higher by adopting the alternate growth rate. Hammer injection muddies the waters a bit, but I've still calculated the formula to take that into account (it increases the hammer ratio slightly, depending on the total amount of population growth desired).

Everything I've discussed here can be quickly calculated using the attached spreadsheet (inside the zip archive, requires MS Excel). You simply input all of the parameters for your scenario and it will calculate your hammer ratio and growth ratio. and give you the suggested path.

There are two primary things that all this analysis does not take into account. I have completely discounted commerce. You could, in theory, use the same formulas, only using a commerce ratio instead of a hammer ratio, but I'm not sure what the impact of cottage growth is on everything. Second, this assumes all hammers dissappear into a vaccuum and can only be spent once the desired population level has been attained. This is unrealistic. In reality, hammers accumulate over time and allow you to acquire resource multiplication structures (a forge for instance, or even military units). This effect can be somewhat mitigated by adjusting the hammer ratio upwards by some factor indicating how important it is to get hammers now, rather than later.

Again my earlier comment about all of this taking place in a test tube is very applicable. Real game situations will require much more intuition and weighing of desired outcomes. Hopefully, though, in some backwater city, where you're looking to simply maximize total output, regardless of timeframe, this analysis will come in handy.

Implications:

  • There's no such thing as a universally optimal food surplus. It is, instead, all about trade-offs. You're going to be increasing your hammer ratio in order to increase your growth ratio, the trick is to find the spot where the growth ratio is actually higher.
  • The growth ratio increases with diminishing returns. Therefore, going from 1 to 3 food surplus is much more benficial than going from 3 to 5. Unless you're sacrificing a small number of hammers in the jump, it's often not worth it.
  • In shield-poor areas, it is much easier to increase the growth ratio (especially with some food resources) without a correspondingly large jump in the hammer ratio.
  • Growth becomes increasingly less beneficial if the tiles you're growing into are uncompetitive with those being worked currently. (You'd be giving up good tiles to be able to grow into poor tiles, resulting in a much higher hammer ratio).
 

Attachments

  • Civ4Food.zip
    33.1 KB · Views: 273
malekithe said:
But let's look at another case. I'm working (again in a pop 2 city) a mined grassland hill and a farmed grassland, but I want to grow to 4 population through working just a regular grassland (maybe it has a cottage, which I'm discounting for this analysis).

Obviously, switching from working improved tiles to unimproved tiles is going to make the latter alternative look worse. I think this is hardly a fair comparison. No one is saying that you should try to get up to +4 food even if you have no farms anywhere.

Generally, a fair comparison is going to be a 2:3 tradeoff of food:hammers (e.g., switching between a grassland farm and grassland mined hill, or between a plains farm and a plains mined hill).
 
DaviddesJ said:
Generally, a fair comparison is going to be a 2:3 tradeoff of food:hammers (e.g., switching between a grassland farm and grassland mined hill, or between a plains farm and a plains mined hill).

Yes, that scenario was a bit contrived. I suppose it could represent a very early game scenario, but in general wasn't terribly realistic. In truth I had trouble concocting a scenario in which the excess food wasn't better in the long run. The problem seems to be that when moving your surplus from 1 to 2 or 2 to 4, it's very hard to go wrong. It can be a bit trickier, though, when making smaller relative jumps, such as 4 to 6.

For a more fair example, let's look at a pop 2 city that is currently working a farmed, yet unirrigated, grassland wheat (5F) and a mined grassland hill (1F 3H). That setup gives it a surplus of 4 food. In this town I also have available another 2 mined grassland hills, a farmed grassland, and plenty of forested grasslands or farmed plains. Now, I can look into working the farmed grassland instead of the mined hill to speed my growth. At 2 population I'll be working the wheat and the farm for a 6 surplus. At 3 I'll add in one of the farmed plains, maintaining the 6 surplus and adding a hammer, then at 4 pop in order to stabilize growth I'll be working the farm and 3 mined grassland hills (working the wheat does me no good, as I don't want to grow anymore).

The growth ratio in this case is (6-4)/6 = 1/3. The hammer ratio is approx 3/9 or 1/3, but when you factor in the fact that the 3rd pop unit will generate 1 hammer (from the farmed plains), it actually modifies the hammer ratio upward slightly (to ~.354). This would indicate, that sticking to the 4 surplus may actually be the better idea.

If anyone doesn't trust my calculated ratios, let's break it down. It takes 36 food to reach 3 pop, 39 more food to reach 4. At 4 surplus the output looks like this: 9*4 + 10*5 = 86 total hammers. At the 6 surplus though, here's the calculation: 6*1 + 7*2 + 6*10 = 80 total hammers. In this case, the 4 food surplus is clearly superior to the 6 food surplus. If there had been plains hills present, so that we could continue to take advantage of the wheat, then growth would be a better option, but often that is not the case.

The conclusion I draw is that at low surplus levels (< 3), 2 food is worth more than 3 hammers. But, as the surplus level increases, the value of food decreases. This is fairly intuitive, but a good thing to keep in mind when dealing with food-rich cities.
 
malekithe: here's how I analyzed the situation. Maybe it will help.


The first "big" observation I made is that when you're considering what to do at population P1, you can ignore what's going to happen at higher populations for the following reason:

You can split the whole problem into two parts: "Grow from population P1 to population (P1)+1" and "Grow from population (P1)+1 to population P2".

The optimal way to "Grow from population (P1)+1 to population P2" will be the same no matter how we decide to "Grow from population P1 to population (P1)+1", so we can remove it from the comparison.

(Okay, that's not exactly true -- food overflow has an effect, and I haven't figured out a good way to handle that. But I think you were ignoring it too)

I was originally looking at it as you did: I had a variable for the gain in food and a variable for the hammers I sacrificed, and I think I got the same result you did. But I decided that it was too annoying to actually try to work out while I'm in the middle of a game, so I fiddled with it to get to a simpler result. Once I got the simpler result, I figured out the analysis I'm going to show below.

(1) Grow in T1 turns, producing J1 hammers per turn.
or
(2) Grow in T1' turns, producing J1' hammers per turn.

(let's assume T1' < T1, so that (2) is the higher food scenario)

In scenario (1), we produce T1 * J1 hammers while growing.
In scenario (2), we produce T1' * J1' hammers while growing.

However, scenario (2) gets to the target city size (T1 - T1') turns faster, which means we can credit scenario (2) with another (T1 - T1')*(H1) hammers.

So, we want to pick scenario (1) if:

T1 * J1 > T1' * J1' + (T1 - T1')*(H1)
which simplifies to
T1' * (H1 - J1') > T1 * (H1 - J1)

and I decided this formula is something I can work out when I'm in the middle of a game. (Yay!)

The optimial choice of food vs hammers is when you minimize the quantity:

(turns until growth) * (number of hammers I'm missing)

Where by "missing" I mean the number of hammers you are unable to produce because your city is at size P1 instead of P2. (I.E. the difference in hammer output)
 
malekithe said:
For a more fair example, let's look at a pop 2 city that is currently working a farmed, yet unirrigated, grassland wheat (5F) and a mined grassland hill (1F 3H). That setup gives it a surplus of 4 food. In this town I also have available another 2 mined grassland hills, a farmed grassland, and plenty of forested grasslands or farmed plains. Now, I can look into working the farmed grassland instead of the mined hill to speed my growth. At 2 population I'll be working the wheat and the farm for a 6 surplus. At 3 I'll add in one of the farmed plains, maintaining the 6 surplus and adding a hammer, then at 4 pop in order to stabilize growth I'll be working the farm and 3 mined grassland hills (working the wheat does me no good, as I don't want to grow anymore).

You should still use the wheat somehow. One way is to alternate back and forth between wheat+3 hills (10f 10h) and forest plains+3 hills (6f 12h), for an average of 8f 11h. Another way is to use Slavery.
 
MyOtherName: Actually if you manipulate your equation a bit, we come to the exact same conclusion.

You have:

T1' * (H1 - J1') > T1 * (H1 - J1)

Let's express that as a pair of ratios

T1' / T1 > (H1 - J1) / (H1 - J1')

Now, we can reverse the comparison and put a "1 - " on both sides of the equation. (editted to fix mathematical error)

We get:

1 - T1' / T1 < 1 - (H1 - J1) / (H1 - J1')

Simplifying:

(T1 -T1') / T1 < (J1 - J1') / (H1 - J1')

The values (J1 - J1') and (H1 - J1') are exactly equal to the values I defined for H1 and H2 in my post. Additionally, (T1 - T1')/T1 is equal to the value I denoted as (F2-F1)/F2, the growth ratio.

So, when you sub in my parameter names, you get:

(F2-F1)/F1 < H1/H2

So, essentailly, we've come to the exact same conclusion: If the growth ratio, (T1 - T1') / T1 in your nomenclature, is less than the hammer ratio (sacrificed hammers / end-result hammers, subtracting the starting conditions for each (what I refered to as assumed hammers)), then it's better to continue with the situation 1, with less growth.

Also,

You should still use the wheat somehow. One way is to alternate back and forth between wheat+3 hills (10f 10h) and forest plains+3 hills (6f 12h), for an average of 8f 11h. Another way is to use Slavery.

Yes, true. And if this were the case then it would be better to use the +6 surplus. But, if we only had 2 mined grassland hills to use and instead have to use a slightly worse tile (maybe a forested plain), then we're right back to maxing out at 8F 10H. If all of your tiles are quality tiles then it is better to expand into them quickly (obviously), but as the quality deteriorates, the value of extra food decreases as well. I'm sure you are well aware of this principle, and many of the in-game decisions around population growth come fairly intuitively to you, but I don't think this is the case for most people, including me to a certain degree. For me, knowing the mathematic principles that underly that intuition iskey. If I can understand the system, then I can better use it to my advantage.

Actually, you pointing out that you can continue to use high food squares in an alternating fashion was a novel idea to me. I'll have to start making use of that, if I can muster the attention span to revisit the city every couple of turns. It doesn't really change the basic underlying mathematical principles behind population growth, but it does open more options.
 
This is an interesting thread. I'd approach it a bit differently, but I come to the same basic conclusion: typically, a smaller food surplus is a reasonable strategy. This is easiest to visualize if you image a basic production city where all that you can work are grassland/farms (+3F) and grass/hill mines (+1F +3H). If you add farm/mine in pairs, you can get an average food surplus of 2 by alternating which one you use every turn (for odd population points) and locking in a farm/mine combo (even population points); this also means that each population point adds 1.5H. You get an average surplus of 3 by working an extra farm first, followed by farm/mine pairs; every extra surplus point above 2 "costs" you 1.5H/turn during the growth phase. When you are done growing, your city will have a "steady" production of (1.5*size +3); you switch one farm at the end to a mine. This quantifies the tradeoff: less hammers while you are growing, more when you reach your target size.

If I am growing from size 10 to 20, at normal, here are the turns to grow to size 20 and the total hammers over the maximum time (275 turns for a 2 food surplus):

2 surplus: 275 turns; 6627@turn 275
3 surplus: 183 turns; 7260@turn 275
4 surplus: 138 turns; 7576@turn 275
5 surplus: 110 turns; 7766@turn 275
6 surplus: 92 turns; 7893@turn 275

However, you're absolutely right that the relative rankings depend on how much the city grows. If you look at growing only to size 15 (e.g. you run out of hills):

2 surplus: 135 turns; 2558@turn 135
3 surplus: 90 turns; 2380@turn 135
4 surplus: 68 turns; 2291@turn 135
5 surplus: 54 turns; 2238@turn 135
6 surplus: 45 turns; 2202@turn 135

It's reversed; smaller is better. The reason is that the penalty for a larger food surplus during the growth phase (6H difference between a surplus of 6 and a surplus of 2) is comparable to the total production difference between size 10 and 15 (7.5H). By the time your 6 surplus city has grown to size 15, the 2 surplus city is between 12 and 13 - e.g. the average size difference
is only 1.25 across the last 90 turns, too small to make up the initial loss.
A real analysis would include the depreciation in hammers as the game progresses; a hammer buys you more current units in the early game than the late game.

Another way of putting it is that the more production potential that you have, the larger your surplus should be. If you have 5 hills, and no forests, your city will have at most 16H base and it will max out for production (specialists excepted) at size 8. Strategies that become important at size 20 are irrelevant. If you have 10 hills, your maximum base production is 31 and you would need 18 people to support the mines. Investing in more rapid growth will pay a higher dividend.

This does raise another factor: things like railroads, biology, lumber mills, specials change the target numbers but not the principle. As you mentioned, you work out the tradeoff between food and hammers; you figure out how big your city has to be to get the most production for your tech level; and then you can arrive at the most efficient growth rate. Based on my exercise, I'd argue that for a production city a smaller surplus (2-3) is actually fine; cities with 10 grassland/hills are rare. Commerce cities will likely favor growth because the cost for generating a big surplus is less; a single pig farm can supply a 6 food surplus to an unlimited number of grassland cottages. This isn't true when you're adding 1F or 0F tiles.
 
ohioastronomy said:
If I am growing from size 10 to 20, at normal, here are the turns to grow to size 20 and the total hammers over the maximum time (275 turns for a 2 food surplus):

I think you should assume a Granary when you do these comparisons. Adding a Granary to any of these scenarios will gain you way more than the 60 hammer cost. And you typically want the Granary for the health benefits, besides.
 
If I am growing from size 10 to 20, at normal, here are the turns to grow to size 20 and the total hammers over the maximum time (275 turns for a 2 food surplus):

2 surplus: 275 turns; 6627@turn 275
3 surplus: 183 turns; 7260@turn 275
4 surplus: 138 turns; 7576@turn 275
5 surplus: 110 turns; 7766@turn 275
6 surplus: 92 turns; 7893@turn 275

However, you're absolutely right that the relative rankings depend on how much the city grows. If you look at growing only to size 15 (e.g. you run out of hills):

2 surplus: 135 turns; 2558@turn 135
3 surplus: 90 turns; 2380@turn 135
4 surplus: 68 turns; 2291@turn 135
5 surplus: 54 turns; 2238@turn 135
6 surplus: 45 turns; 2202@turn 135
These numbers don't seem to add up, and directly contradict my findings.


For example, suppose I'm size 14, but trying to grow to size 15 (48 food to go), and all that I have unworked is a grassland hill.

1 surplus: 48 turns, X hammers @ turn 48

But if I consider changing my other grassland hill mines for grassland farms:

3 surplus: 16 turns, X + 48 hammers @ turn 48
5 surplus: 10 turns, X + 54 hammers @ turn 48
7 surplus: 7 turns, X + 60 hammers @ turn 48
9 surplus: 6 turns, X + 54 hammers @ turn 48

(For example, by switching from one mine to one farm to get to a 3 food surplus, I am making 3 fewer hammers per turn for 16 turns, but then I'm making 3 more per turn for the other 32)

The only reason the 9 food surplus is worse than the 7 food surplus is because it results in 5 extra food which could have been converted to hammers instead by, say, 5 turns of 9 surplus and 1 turn of 3 surplus. The result would be X+63 hammers @ turn 48


And even at size 10, starting from a baseline of a +5 food surplus and 5 unworked grassland mines, I still predict it's better to drum up an additional surplus by transferring all of your citizens from worked grassland mines to grassland farms.

In fact, I claim the following theorem: if all of your "food" tiles are the same, and all of your "hammer" tiles are the same, then you maximize your total hammer production by working as many food tiles as possible at all times.


The only reason to work a hammer tile instead of a food tile is because that hammer tile is unusually good. E.G. it's good to work that mined grassland iron if the only reason left to grow is to work a couple of desert hills.

In the examples I've run, where it's all grassland and grassland hills, it was best to put windmills on all the hills, and convert them to mines just as the city reaches full size. (And this is without the bonus hammer they get from replacable parts!)


A real analysis would include the depreciation in hammers as the game progresses; a hammer buys you more current units in the early game than the late game.
I think you're looking at this one backwards -- sure an early game hammer buys more units, but a late game hammer buys better units. I know I would generally rather have a tank than 12 warriors. :D Or more realistically, unless I have an immediate use for three cavalry now, I would prefer to have two tanks later.
 
MyOtherName said:
I think you're looking at this one backwards -- sure an early game hammer buys more units, but a late game hammer buys better units. I know I would generally rather have a tank than 12 warriors. :D Or more realistically, unless I have an immediate use for three cavalry now, I would prefer to have two tanks later.

Slightly OT, but I agree with that analysis completely. It really bothers me to be producing military units that are never going to see action. That's why I rarely, if ever (haven't had to through emperor), build archers or longbowmen to defend my cities. I don't like the idea of my hammers completely going to waste. I find I only sink hammers into military for two reasons: I'm going to war soon (true most of the game) or I need to increase happiness in the city (through hereditay rule).

To bring this post back on topic, if you find that there is nothing productive to build within a city at the moment (out of hammer multiplying buildings and no impending wars at the current tech level). Then the analysis of food vs. hammers is entirely moot. It's always better to focus on growth, as fast as possible. It would seem that this situation is the exact opposite of the scenario where you are at the happiness cap.
 
malekithe said:
Slightly OT, but I agree with that analysis completely. It really bothers me to be producing military units that are never going to see action. That's why I rarely, if ever (haven't had to through emperor), build archers or longbowmen to defend my cities. I don't like the idea of my hammers completely going to waste. I find I only sink hammers into military for two reasons: I'm going to war soon (true most of the game) or I need to increase happiness in the city (through hereditay rule).

To bring this post back on topic, if you find that there is nothing productive to build within a city at the moment (out of hammer multiplying buildings and no impending wars at the current tech level). Then the analysis of food vs. hammers is entirely moot. It's always better to focus on growth, as fast as possible. It would seem that this situation is the exact opposite of the scenario where you are at the happiness cap.

The biggest costs of adding people you can't use are the extra food they eat and the possibility of going over the health limit. Other than that, there is nothing wrong with passively soaking up a food surplus with extra people, even if you can't use them - it only harms you when the city is forced to switch from more useful commerce/production tiles to feed nonproductive citizens.
 
MyOtherName said:
These numbers don't seem to add up, and directly contradict my findings.


For example, suppose I'm size 14, but trying to grow to size 15 (48 food to go), and all that I have unworked is a grassland hill.

1 surplus: 48 turns, X hammers @ turn 48

But if I consider changing my other grassland hill mines for grassland farms:

3 surplus: 16 turns, X + 48 hammers @ turn 48
5 surplus: 10 turns, X + 54 hammers @ turn 48
7 surplus: 7 turns, X + 60 hammers @ turn 48
9 surplus: 6 turns, X + 54 hammers @ turn 48

(For example, by switching from one mine to one farm to get to a 3 food surplus, I am making 3 fewer hammers per turn for 16 turns, but then I'm making 3 more per turn for the other 32)

The only reason the 9 food surplus is worse than the 7 food surplus is because it results in 5 extra food which could have been converted to hammers instead by, say, 5 turns of 9 surplus and 1 turn of 3 surplus. The result would be X+63 hammers @ turn 48


And even at size 10, starting from a baseline of a +5 food surplus and 5 unworked grassland mines, I still predict it's better to drum up an additional surplus by transferring all of your citizens from worked grassland mines to grassland farms.

In fact, I claim the following theorem: if all of your "food" tiles are the same, and all of your "hammer" tiles are the same, then you maximize your total hammer production by working as many food tiles as possible at all times.


The only reason to work a hammer tile instead of a food tile is because that hammer tile is unusually good. E.G. it's good to work that mined grassland iron if the only reason left to grow is to work a couple of desert hills.

In the examples I've run, where it's all grassland and grassland hills, it was best to put windmills on all the hills, and convert them to mines just as the city reaches full size. (And this is without the bonus hammer they get from replacable parts!)



I think you're looking at this one backwards -- sure an early game hammer buys more units, but a late game hammer buys better units. I know I would generally rather have a tank than 12 warriors. :D Or more realistically, unless I have an immediate use for three cavalry now, I would prefer to have two tanks later.

I see your point on the production, and the key input is that you have to switch back to hammer production to recoup your investment. e.g. if you are always growing with pure farms, you never actually get any hammers out until you stop growing and switch.

For the case where you start with 0 surplus and flip (1,2,3) mines to farms to add 48 food:

flip 1 mine, grow in 24 turns. You lose 72H and gain a permanent +1.5H/turn.
flip 2 mines, grow in 12 turns. You have the same hammer loss (72), but then have a bonus of +1.5H/turn for the last 12 turns; the net gain is 18H.
flip 3 mines, grow in 8 turns; lose 72H, gain 16*1.5 = 24H.
It is therefore the case that you gain the most by flipping as many farms as you can - but only if you flip them back after growing, and subject to diminishing returns. I'll check my numbers - this sounds intuitive, but is a different strategy than grow multiple pop points and switch at the end.

As far as units go, their value is relative to the defenders they face. A swordsman is every bit as useful for taking an early city as a marine is for taking a late city; the marine just costs more. There are sweet spots in the tech tree where units are unusually cost-effective, but this doesn't map neatly onto unit cost - e.g. axes, knights, cavalry all represent quantum advances over the typical defenders they face, and are initially very valuable. When their counters appear, their utility diminishes. (And early veterans can become extremely useful highly-promoted units at later epochs).
 
Yes, true. And if this were the case then it would be better to use the +6 surplus. But, if we only had 2 mined grassland hills to use and instead have to use a slightly worse tile (maybe a forested plain), then we're right back to maxing out at 8F 10H. If all of your tiles are quality tiles then it is better to expand into them quickly (obviously), but as the quality deteriorates, the value of extra food decreases as well. I'm sure you are well aware of this principle, and many of the in-game decisions around population growth come fairly intuitively to you, but I don't think this is the case for most people, including me to a certain degree. For me, knowing the mathematic principles that underly that intuition iskey. If I can understand the system, then I can better use it to my advantage.

Actually, you pointing out that you can continue to use high food squares in an alternating fashion was a novel idea to me. I'll have to start making use of that, if I can muster the attention span to revisit the city every couple of turns. It doesn't really change the basic underlying mathematical principles behind population growth, but it does open more options.

I think you should still use the wheat still even if you do not want to alternate between tiles. The two extra food will not hurt you at all. Let it grow to be an unhappy pop and use that same two extra food to support that unhappy pop. And when your happiness grows, well, you get you pop immediately since it is already there. If you really think about the cost of an unhappy pop, it is really just the food to grow it and two food to keep it.
 
Top Bottom