View Full Version : Ideal food surplus for early city growth (CE)


misterslack
Aug 07, 2008, 10:45 PM
A dilemma that I often see encounter in my cottage economy games is how to optimally improve a commerce city with access to only one mediocre food resources (unirrigated rice, unirrigated wheat, grass cow, etc). I usually see this sort of thing with all-grass jungle cities using a rice or banana tile to drive growth. Such cities usually have access to riverside grassland tiles and the problem is whether to farm a few of these tiles to improve early growth or cottage them to access the high commerce yield (assuming a financial leader). A weak food tile such as unirrigated rice provides +2 food, for a total surplus of +4 when combined with the city square. Now a +4 surplus isn't bad, however you usually want to work a hill or two which cuts into your growth.

For example, let's say we have a city with:
1 unirrigated grass rice
2 grass hills
2 riverside grass
15 ordinary grass

In this case your riverside tiles are very limited, so is it worth farming one or both of them instead of cottaging? I suppose a "best of both worlds" option would be to not farm them, avoid working the hills while growing to cap with a respectable +4 surplus, and then switchover to the hills when at cap.

This brings up a more general question: when dealing with a new city, do you all prefer to avoid food-negative tiles and sacrifice production until at a sufficient pop cap? If so, and the pop cap is high, at what point do you switch over? What buildings (besides monument/granary) do you like to get up before going into a "growth spurt"?

PS: This is my first post on these boards, and I'd like to thank everyone out there for building this incredible font of civ4 knowledge.

DaveMcW
Aug 07, 2008, 11:12 PM
Food surplus = Happiness surplus

(assuming you already whipped a granary and haven't discovered Biology)

Polobo
Aug 07, 2008, 11:31 PM
Food negative tiles will generally get either 1) a second round of cottages to be worked when stagnating city growth or (if un-forested/flatland) 2) workshops.

For plains hills almost always they get mines.

Grassland hills vary depending upon the city since windmills make them food neutral while mines give decent production while only sacrificing 1 food.

I'll generally try to achieve a 4-6 food surplus during constant growth times. Any more than that and I'm probably better off working more mines/cottages unless I need my city to grow really quickly.

slobberinbear
Aug 07, 2008, 11:48 PM
In your example, you are lusting after the size 20 production and want to get there ASAP while building your cottages up.

Assuming your happy cap is 20, and this is pre-biology and you have civil service, I would irrigate the rice, requiring us to farm one of the riverside grassland tiles. That gives us a surplus of 6 (city tile 2, rice 3, grassland farm 1). That frees you up to cottage all of the remaining grasslands and mine the hills, with a surplus of 4 left over to run two specialists if you can grow to size 22. The alternative would be to cottage over the rice and grassland farm once you hit 20.

+6 food gives a nice sustained growth rate. I'm not sure it makes sense to lose cottage growth turns by farming more than just the one grassland tile, though. However, if you have a giant worker force/Serfdom/Hagia Sophia, I suppose you could farm up hardcore, hit size 20, then cottage up.

Tennyson
Aug 08, 2008, 02:41 PM
Also keep in mind that a farm can become a cottage later, but the reverse is costly.

vicawoo
Aug 08, 2008, 06:11 PM
Farm up to max size - (non-farm food tile bonuses), something like that, then go all cottages.

Levgre
Aug 08, 2008, 07:21 PM
Food surplus = Happiness surplus

(assuming you already whipped a granary and haven't discovered Biology)

That sounds like a very good rule of thumb. Is it the ideal rule do you think, for maximizing a cottage city.

DaveMcW
Aug 08, 2008, 08:10 PM
Yes, there was a long thread with way too much math that proved it is ideal.

misterslack
Aug 08, 2008, 09:21 PM
Yes, there was a long thread with way too much math that proved it is ideal.

I'd like to read it, do you have a link or remember the name?

SnowlyWhite
Aug 08, 2008, 09:30 PM
somewhere around +4 - +3 at the minimum is what I take

And regarding your example, farm one of the river sides and draw the irrigation to the rice so you can work the mine and have a higher pop. growth(no calculations, just "feeling"). Obviously, if your city per se is on the river(thus can build farms on non river tiles around the city), build the farm "behind" in order to irrigate the rice and cottage the grassland riverside.

Food surplus = Happiness surplus

happiness is infinite in theory under hr... or well, limited by how much gold you produce in order to pay all the troops if taking it to extreme.

DaveMcW
Aug 08, 2008, 10:08 PM
I'd like to read it, do you have a link or remember the name?

http://forums.civfanatics.com/showthread.php?t=266397

misterslack
Aug 09, 2008, 02:24 AM
That was an interesting thread. I think it's too difficult to develop a closed-form expression that will give an accurate answer to this question, or it would be too difficult to use correctly. I took an alternate route and wrote a simulator to test the different farm/cottage patterns directly. The simulator takes a pop cap, a base number of citizens working food resource squares generating a base food surplus, and a cottage/farm improvement pattern and runs the city up to the pop cap, and then switches to all cottages and runs the city until all cottages are fully developed into towns. It records the total commerce generated during this time and how long it took to do it, as well as the turn the city hit the pop cap and how much commerce had been generated at that time.

I used five different cottage/farm methodologies:
1. farms: every square gets a farm
2. cottages: every square gets a cottage from the get go, no farms
3. mix (cottage first): alternate cottages and farms, starting with a cottage
4. mix (farm first): alternate cottages and farms, starting with a farm
5. surplus = cap: attempts to cottage and farm to keep the food surplus as close to the remaining pop cap as possible; never overwrites cottages for farms but frequently overwrites farms for cottages.

The simulator assumes a granary at all times.

Again, these methodologies are only used until the city hits the pop cap, at which point all tiles are switched to cottages. We're assuming infinite worker capacity, so the farm-heavy approaches may be at a slight disadvantage in a more realistic setting when you switch them over.

Note that the simulator doesn't take into account river commerce, irrigation, or the financial trait. We assume all squares are potentially irrigitable. River commerce and financial combinations make no difference since all squares will be worked to towns eventually.

"base pop" is the number of citizens working special food resources.
"base food" is the total food surplus from the city square and all food resources.
"pop cap" is self-explanatory.

For example, a city with one citizen working irrigated rice would have base pop = 1, base food = 5 (2 for the city square, 3 for the rice).

You'll see two pairs of numbers next to each methodology. The first pair is the "normalized" turns/commerce: the number of turns the full farm approach took to mature all towns, and the amount of commerce the particular methodology generated in that time. Since the pure farm approach always takes the longest to mature to full towns, its turn count to maturity is used to measure relative lifetime commerce generation.

EDIT: whoops, looks like using the turns for the all-farm method to mature was wrong, the all-cottage approach takes longer for smaller food surpluses, so I recomputed the data using that as the normalized turn count. The "gist" of the data didn't change though.

The second pair of numbers is turns to hit pop cap followed by commerce generated in that time, for that particular methodology.

Here are the results:


base pop = 0, base food = 2, pop cap = 5
cottages 63/686 (23/85)
mix cottage first: 63/682 (16/29)
mix farm first: 63/686 (14/14)
farms: 63/690 (11/0)
surplus = cap: 63/706 (20/61)

base pop = 0, base food = 2, pop cap = 10
cottages 103/2272 (63/833)
mix cottage first: 103/2472 (32/139)
mix farm first: 103/2536 (28/86)
farms: 103/2580 (21/0)
surplus = cap: 103/2608 (31/142)

base pop = 0, base food = 2, pop cap = 15
cottages 156/5286 (116/3016)
mix cottage first: 156/6230 (46/336)
mix farm first: 156/6390 (41/241)
farms: 156/6630 (28/0)
surplus = cap: 156/6582 (43/339)

base pop = 1, base food = 5, pop cap = 5
cottages 48/514 (8/16)
mix cottage first: 48/506 (7/9)
mix farm first: 48/506 (6/4)
farms: 48/490 (6/0)
surplus = cap: 48/514 (8/16)

base pop = 1, base food = 5, pop cap = 10
cottages 64/1364 (24/166)
mix cottage first: 64/1344 (17/50)
mix farm first: 64/1348 (16/36)
farms: 64/1340 (13/0)
surplus = cap: 64/1384 (21/111)

base pop = 1, base food = 5, pop cap = 15
cottages 85/2754 (45/710)
mix cottage first: 85/2790 (28/162)
mix farm first: 85/2826 (26/120)
farms: 85/2850 (20/0)
surplus = cap: 85/2910 (32/284)

base pop = 2, base food = 8, pop cap = 5
cottages 44/474 (4/6)
mix cottage first: 44/482 (3/3)
mix farm first: 44/474 (3/1)
farms: 44/470 (3/0)
surplus = cap: 44/474 (4/6)

base pop = 2, base food = 8, pop cap = 10
cottages 54/1140 (14/66)
mix cottage first: 54/1116 (11/25)
mix farm first: 54/1092 (11/18)
farms: 54/1100 (9/0)
surplus = cap: 54/1140 (14/66)

base pop = 2, base food = 8, pop cap = 15
cottages 67/2122 (27/295)
mix cottage first: 67/2054 (20/91)
mix farm first: 67/2058 (19/69)
farms: 67/2070 (15/0)
surplus = cap: 67/2142 (25/230)


I also tested with universal sufferage+printing press and got no change in the relative results.

Analyzing the data, we confirm that surplus = cap is the best methodology to use, albeit the most micro-intensive. We also notice that at very low surpluses, the farm-heavy approaches do better, and at high food surpluses, the cottage-heavy approaches excel. This makes sense, since the +1 food from a farm is a smaller relative bonus when you're already working two fat corn tiles. The surplus = cap approach adapts to these either scenarios in the optimal way. For a less micro-intensive approach, you can simply go with a flat surplus of +4 to +6 surplus and get a good approximation, mirroring the numbers I've seen thrown around this forum.

So this just confirms with some hard numbers what's already been posted. There's probably a better theoretical methodology than surplus = cap, but you're already pushing the limits of patience for most people.

The c++ code is attached as a txt file, for some reason the uploader wouldn't accept a .cpp extension. I'm pretty sure it's accurate or close enough (it's quite simple), but I haven't tested against a worldbuilder scenario or anything like that.

Quechua
Aug 09, 2008, 02:43 AM
Oh my god that thread reproduced!

vicawoo
Aug 09, 2008, 03:22 AM
On the contrary there was a very simple closed form solution as long as you're not too worried about saving some roundoff beakers by growing a little bit earlier and such

CmdrGoob
Aug 09, 2008, 07:00 AM
Interesting, but I think a discount rate should apply. Net present value approach to Civ 4 cottaging, anyone? :crazyeye:

One commerce per turn right now is worth more than one commerce per turn later down the track, so I don't really like building a new commerce city that works only farms for a while, because I'd usually rather have my economic cities generate some commerce right now, even if it costs me commerce over the long time it takes for the city to mature.

Using farms to grow an economic city is an investment in future returns that pays off by having more efficient growth in the long term, but how does that compare to the rate of return of getting the commerce sooner and investing it in technology? That's a question that is even harder to put numbers on to answer.

Tennyson
Aug 09, 2008, 05:15 PM
Using farms to grow an economic city is an investment in future returns that pays off by having more efficient growth in the long term, but how does that compare to the rate of return of getting the commerce sooner and investing it in technology? That's a question that is even harder to put numbers on to answer.At the point where early cash is important, you're only building farms next to rivers anyway, and getting a single gold for each. Getting two gold for the cottage (if maintenance and lack of library etc dont' wash it out anyway) isn't that big an improvement compared to the gold your capital is making.

But regardless, if early money is such a priority, you can take the formula and subtract one (instead of aiming for 14 food surplus, aim for 13 and build a cottage immediately). But at that point the numbers are completely situational.

Frankly, I'm happy if a city just makes back it's maintenance costs before the Courthouse is built. I'd rather grow the pop while I'm building libraries and such for the cottages to take advantage of. More money later is fine because I'm funneling that money through multipliers.

CLST
Aug 09, 2008, 05:18 PM
That was an interesting thread. I think it's too difficult to develop a closed-form expression that will give an accurate answer to this question, or it would be too difficult to use correctly.

AU contraire. It's little things like this, that keep people like me employed (applied math). Closed form solutions are rarities in the world, and iterative methods via numerical analysis are the way of the world.

misterslack
Aug 09, 2008, 06:56 PM
AU contraire. It's little things like this, that keep people like me employed (applied math). Closed form solutions are rarities in the world, and iterative methods via numerical analysis are the way of the world.

I'm confused :confused: You say "au contraire" then it sounds like you're agreeing with me :)

Regardless, the point I was trying to make is that a formula that takes into account all factors (cottage maturity, increased food for higher population growth, etc) would be too unwieldy to compute in your head for on the fly for every city every turn, whereas an approximation like surplus = happy is doable (and even that requires a lot of micromanagement to get it exact), and something super simple like "+5 surplus" is best for most people in terms of an optimal play/tedium tradeoff.

CmdrGoob
Aug 09, 2008, 09:50 PM
At the point where early cash is important, you're only building farms next to rivers anyway, and getting a single gold for each. Getting two gold for the cottage (if maintenance and lack of library etc dont' wash it out anyway) isn't that big an improvement compared to the gold your capital is making.

But regardless, if early money is such a priority, you can take the formula and subtract one (instead of aiming for 14 food surplus, aim for 13 and build a cottage immediately). But at that point the numbers are completely situational.

Frankly, I'm happy if a city just makes back it's maintenance costs before the Courthouse is built. I'd rather grow the pop while I'm building libraries and such for the cottages to take advantage of. More money later is fine because I'm funneling that money through multipliers.

The OP is assuming financial, though, which means riverside cottages are immediately worth 3. It depends on the when in the game this is, but if it's early, then that's a period when the economy tends to stall untill the key economic techs (CoL, currency, CS, monarchy) are in place, and techs cost are low enough that a few riverside financial cottages in a few cities makes a real difference.

jesusin
Aug 10, 2008, 02:29 AM
I used five different cottage/farm methodologies:
1. farms: every square gets a farm
2. cottages: every square gets a cottage from the get go, no farms
3. mix (cottage first): alternate cottages and farms, starting with a cottage
4. mix (farm first): alternate cottages and farms, starting with a farm
5. surplus = cap: attempts to cottage and farm to keep the food surplus as close to the remaining pop cap as possible; never overwrites cottages for farms but frequently overwrites farms for cottages.


Thanks for bothering, this is very interesting.

I don't understand why you chose strategies 3 and 4. I would have used surplus=cap+1 and surplus=cap-1 instead.

Would you be so kind as to use the OP's example, comparing the strategies?:
1- no farms
2- 1farm then all cottages
3- 2farms, then all cottages
4- 3 farms, then all cottages