Fastest way to grow and build a granary

vicawoo

Chieftain
Joined
Feb 12, 2007
Messages
3,226
The forum's covered maximizing cottage turns with a granary, maximizing rapid expansion, other optimizations. But we've never covered, having a granary-less city, what's the fastest way to grow? Once you have the granary, your food production effectively doubles. But to build the granary, you have to invest hammers, meaning less food, or whip, meaning you have to regrow.

Technically the best way to grow is to chop the granary while improving and growing normally, but for now let's assume you can't chop, although you can whip.

So here's two scenarios:
1) Easier scenario: granary is half-built (30 hammers), you can whip to finish it, or you can use your extra population to run a mine(s) to slow build it. Under which conditions, that is, tile selections, do you whip it and under which do you build it normally.
2) new city, no granary, large happy cap. (When) do you choose to grow to size 4 and whip, grow then invest hammers, grow then invest hammers and whip, or just invest hammers and don't grow.
A simple example: you have a plains/hill/copper (6 hammers), 2 unirrigated rice (4 food), and at least one grassland hill mine and plains hill mine and grassland farms. Do you build the granary with the copper, grow to size 2 with the rice and work the copper, grow to size 2 with the rice and work the copper and whip, work both rices ... etc.

And feel free to factor in the actual granary mechanics (see vocum insineratio: whipping). My apologies for making this too generalized for easy responses.
 
Oh this can get interesting. Sometimes when the food bin is half full and it looks like overflow will finish the granary and I need a worker, I switch to the worker and whip it when the time is right. The granary finishes the turn after the worker.
 
If I remember correctly, the answer to this question depends on what you want to maximize.

There's an article somewhere about this, I remember reading it a long time ago.
Its conclusion was: if you want to maximize food, you work the food tiles over the hammer ones until you can whip.

Knowing when to whip the granary is easy (1/2 full bin - 2*whipped pop # - food surplus) but determining what you want to maximize is the hard part.

In our SGOTM thread, we were evaluating food:hammer as 1:2, which makes sense as with a high happy cap you can just keep whipping at low populations to get the infra in and then run on max food before converting the tiles to what you need.

While maybe not exact science, it does confirm such inquiries as Grass hill > Plains hill (5 vs 4). Moreover it would show that a 6H copper PH tile is "equal" to a farmed grassland, although once you are close to completing the granary, working those hammer heavy tiles can be better [if you are past the halfway point of the food bin] as the food surplus is stored and you gain more food+hammers this way.

I don't have much time to delve deeper in this right now but I might try sometime later. For now I'll be content in reading replies :)

I suspect that getting some simple rule of thumbs might happen but I think there are too many situations to get a general theorem.
 
size 2 whip: 1 food = 1.36 hammers
size 4 whip: 1 food = 1.20 hammers

A simple example: you have a plains/hill/copper (6 hammers), 2 unirrigated rice (4 food), and at least one grassland hill mine and plains hill mine and grassland farms. Do you build the granary with the copper, grow to size 2 with the rice and work the copper, grow to size 2 with the rice and work the copper and whip, work both rices ... etc.
Rice 1 = 4 * 1.36
Rice 2 = 4 * 1.20
Copper = 6
Size 1 copper wins
 
Easier scenario: granary is half-built (30 hammers), you can whip to finish it, or you can use your extra population to run a mine(s) to slow build it. Under which conditions, that is, tile selections, do you whip it and under which do you build it normally.

whip it if you have lots of food tiles or extra pop, slow build if you have un-irrigated rice. it's hard to talk apples to apples, especially in such a general case. it would depend a lot on what tiles are available to a city. basically, you want your citizens to be working your best tiles for as long as possible. if you have any awesome :hammers: tiles, then build.

if you want a general rule: whip the granary, asap. work your best :food: tiles until size 2, then max :hammers:
because: 1. people tend to found new cities next to a food resource, anyway.
2. much of the early game is spent in slavery (versus caste or nothing).
3. whipping at lower populations is more efficient.

this works especially well with expansive leaders.

new city, no granary, large happy cap. [how often] do you choose to:
1. grow to size 4 and whip,
2. grow then invest hammers,
3. grow then invest hammers and whip,
4. or just invest hammers and don't grow.

1. rarely. seafood, irrigated corn, maybe floodplains heavy locations without ANY :hammers: tiles.
2. sometimes. +4 :food: tiles max, like cows, sheep, horses.
3. usually. this is probably the best way to go. work :food: until size 2, then switch both to :hammers: then whip asap. this assumes that you have improved your resources ahead of time.
4. never. if you are starving a city anyway, it doesn't really matter if you have a granary or not;p

A simple example: you have a plains/hill/copper (6 hammers), 2 unirrigated rice (4 food), and at least one grassland hill mine and plains hill mine and grassland farms. Do you build the granary with the copper, grow to size 2 with the rice and work the copper, grow to size 2 with the rice and work the copper and whip, work both rices ... etc.

as DaveMcW proves, working the bronze mine is the fastest way to get the granary built in this rather lackluster city you describe. lots of :food: and :hammers:

i would ask you what your plan is with that city anyway. it sounds like it would be a great unit pump, but you don't need a ton of hammers for early units anyway. i would say, slow build a granary, but not until the middle ages. maybe you can irrigate the rice by then.

@dave: what's the break even point? i like the example, you usually have time to research BW as you finish your first worker, but if you have a bronze mine, you might be chopping, which i realize this isn't about. how many good food tiles do you need to favor whipping???
 
size 2 whip: 1 food = 1.36 hammers
size 4 whip: 1 food = 1.20 hammers


Rice 1 = 4 * 1.36
Rice 2 = 4 * 1.20
Copper = 6
Size 1 copper wins

Incorrect. Walk through the micro.

Work copper mine at once.
Turn/Food/Hammers
1/0/7
2/0/14
3/0/21
4/0/28
5/0/35
6/0/42
7/0/49
8/0/56
9/0/60+3 <- There's the granary.
10/4/60+4
11/8/60+5

Rice to size 2, then add copper mine.
1/4/1
2/8/2
3/12/3
4/16/4
5/20/5
6/2/6 <- size 2
7/4/13
8/6/20
9/8/27
10/10/34 (whip!)
11/14/60+5

Same production, but the copper mine first approach is 6 food behind. There may be an additional benefit to the second approach, as it is lined up to hit the pop 2 threshold in two turns exactly, so gets to jump back on the copper with no loss of time, where the first case hits 20/22 instead. Of course, the comparison is complicated further by the fact that the two granaries don't store the same amount of food in this scenario (building production comes after food harvest? ugh). But if you run the micro out to turn 15 it's clear that the whip first approach is leading.
 
And remember, if you whip the granary, you'll have to regrow to achieve the "fastest growth" part. It's not just about how fast you can get your granary up. As your hammer:food ratio increases, the greater your incentive to build it without whipping.

And as we can see there's loads of complications: growing increases your production, whipping complicates things, and you have to grow to size 4 to 2 pop whip.
 
VoU's example is very nice.

DaveMcW's math is indeed correct but it failed to grasp what VoU showed:
working food allows to use more tiles.

Outputwise we have [counting in hammers]

Rice-Copper
t0-t6 4F/turn = 5.45H/turn (1 pop whip is 30H, 22F required, 30/22 = 1.363636) -> 32.72H
t7-t10 2F/turn+6H/turn (here we again can use 1.36 ratio to convert food to hammers as we are whipping and that food will be used at pop 1) = 8.72H/turn -> 34.88H
--------
67.6H

Copper
t0-t9 6H/turn -> 54H
t10 4F/turn -> 5.44H***
--------
59.44H

And coincidentally, we get:
(67.6-59.44)/1.36 = 6 -> which is the extra food gained in the second attempt

***I am still converting food at 1.36:1 rate here (rather than the 2.72:1 from the granary) as we will waste 11 food that the granary cannot store before growing to size 2

Same production, but the copper mine first approach is 6 food behind. There may be an additional benefit to the second approach, as it is lined up to hit the pop 2 threshold in two turns exactly, so gets to jump back on the copper with no loss of time, where the first case hits 20/22 instead. Of course, the comparison is complicated further by the fact that the two granaries don't store the same amount of food in this scenario (building production comes after food harvest? ugh). But if you run the micro out to turn 15 it's clear that the whip first approach is leading.

Of course, you can avoid losing food by working hammer tiles on the turn you finish the granary, whenever your food surplus takes you over the halfway point. However, with a completed granary, you'll want more food than anything else for a long time to keep the optimal output, so growth earlier onto the second rice is even stronger here.

In some cases where you do not have very good food tiles however, it might work out better to not "waste" food saved by the granary. In our SGOTM (see posts 1024 and 1025, middleish), we had such a case but it was with sub-par tiles (1F2H and 3H tiles). I imagine with improved tiles that everything might be different and favor food tiles once again.

I'll try to look deeper into this sometime later...
 
size 2 whip: 1 food = 1.36 hammers
size 4 whip: 1 food = 1.20 hammers

Do these ratios double after the Granary has been built?

If so, you would have to account for some more turns with double ratios in the case of whipping, while some tiles less are worked. You have also a double growth rate some time earlier, which may or may not suffice to reach the same pop as the slow built version.
And of course in practice the happy cap isn't unlimited, so you have to factor that in too, somehow :-)
 
Well this is a bummer. I had written a lengthy post and then the electricity cut and I lost everything!

The answer: plains copper first.
On t11 you're 4 food behind but store the full 11F in the granary...meaning on t13 you come out ahead 1F and 1 happy for 10 turns.

Let's see if I can convince myself to write something longer again...
 
(Including the 1H from city tile, the 2F pays for the first citizen)

Plains copper approach
t0-t10 1F+6H/turn = 7.32H/turn = 73.2H or 10F+60H
t11 1F+3F/turn (since the granary can only store 11 food, 1F is calculated at the pre-granary ratio) = 1.32F+(3*2.72)F+1H = ~10.5H or 4F+1H+3SF (SF=Stored food)
t12-t13 4F+1H/turn = (8*2.72)F+2H = 23.76H or 8F+2H+8SF
-----
~107.5H or 22F+63H+11SF = 33F+63H

Rice first-plains copper-second rice approach
t0-t6 4F+1H/turn = 6.45H/turn -> 38.72H or 24F+6H
t7-t10 3F+6H/turn = 9.96H/turn -> 39.84H or 12F+24H
-----
36F+30H = 14F+60H
t11 4F+1H/turn = 6.28H or 4F+1H (since the granary whip happens on the start of t11, it doesn't start storing food until t12)
t12 4F+1H/turn = (4*2.72)H+1H = 11.88H or 4F+1H+4SF
t13 6F+1H/turn = (6*1.36)H+1H = 9.16H or 6F+1H (no stored food as we are below the half food bin)
-----
~105.88H or 28F+63H+4SF = 32F+63H

The red numbers show that on the start of t11 rice first is ahead (+4F). However, it is past the halfway point in the food bin, meaning it will lose (-7F) stored food compared to the plains copper first approach. Growth first will also gain back 1 more turn of growth allowing to work the second rice for 1 more turn (+2F), giving us the (-1F) difference between both approaches.

What can we conclude from this?
  • Food is better than hammers.
  • If you can work special hammer tiles to avoid crossing half the food bin before the granary is complete to gain 1+ turn of granary completion, you will come out ahead on food.

When starting a granary at size 1 with only improvements (at least 2) available (no handy chops), I think we can say:

5+F tile > high hammer tile with food (1F5H or 2F4H) > 4F tile > high hammer tile no food (0F6H) *** (thanks for correction VoU)

*** The above is 80% part gut-feeling so feel free to correct me and show otherwise.
 
When starting a granary at size 1 with only improvements (at least 2) available (no handy chops), I think we can say:

5+F tile > high hammer tile (1F5H or 0F6H or 2F4H) > 4F tile ***

*** The above is 80% part gut-feeling so feel free to correct me and show otherwise.

Well, it's got me confused, as I thought we had previously established that the 4F tile was the better start than the 6H tile.

Also, it's not obvious to me that you considered the "whip and work the mine for that one turn" micro. (Which is not to say that I know the answer - your work so far matches what I did last night, but I'm not convinced that we've actually completed the analysis yet).
 
You're right that isn't very correct. The 6H tile is only useful at size 2 ...so

5+F>high hammer+1F tile>4F>6H tile

I did try working the copper mine on the turn of the whip. The result is somewhat less good (it got lost with my long post).
You lose 3F right away which are gained back via the granary but gain 5H. (+5H)
You grow 1 turn later, meaning you lose 2F later from the second rice tile. (-2F)

5H:2F -> 2.5:1
Considering that the whip with granary converts food at 2.72:1, it comes out just a bit behind.
 
I was going to write some calculations on one pop whipping vs slow building a granary, but first there's that troublesome granary storage mechanic.

I had to confirm this mathematically obvious but common sense defying fact
General, slightly inaccurate statement
Any food growth past halfway is wasteful.
That is, you gain nothing by running a corn over an empty grassland tile, if you are already above halfway and are going to complete the granary without growing.
Example: Let's say it takes 6 food to grow from empty to the next size, meaning your granary will store 3 food. Let's say your food surplus is 1. Let's say you're size n. My notation will be
i/j/k, where i is your size, j is the current food level of your city, k is the food stored in the granary. My columns will different food levels at which you finish the granary. My row will be indicate the turns, so the row below another row will mean it's the next turn.

Granary completes on
n/3/0 n/4/0 n/5/0 n+1/0/0
n/4/1 n/5/1 n+1/1/1 n+1/1/1
n/5/2 n+1/2/2 n+1/2/2 n+1/2/2
n+1/3/3 n+1/3/3 n+1/3/3 n+1/3/3


More accurate statement
Any excess food growth that prevents you from filling your granary bin (10+n food) is wasteful, unless growing increases your food per turn. The latter qualifier means if you can work an extra food source/farm earlier, inefficiently filling your granary bin is still worthwhile.
Example of the difference between these two statements:
Say you have a size 1 city with a 6 food tiles.
Say your granary completes with the city storing 15 food
1/15/0
1/21/6
Though we began over halfway, the granary will have the chance to store 12 food (of course it can only store 11) as our city grows, so our granary will be full
2/5+11/11

This means you unless you have good extra food sources, working those mine/cottages instead of that corn before your granary completes loses little to nothing. For some reason I thought working that corn suboptimal but still better than working the plains forest, but I was wrong. This is something of a tangent to the discussion, but without it I couldn't move on to:
one pop whip or slow build math
 
one pop whip or slow build math

Definitions:
f(i) = net food produced by the ith citizen
h(i) = net hammers produced by the ith citizen
F(n) = total food produced by the size n city
H(n) = total hammers produced by the size n city
G = hammers needed to complete granary.

Assumption: your city can slow build the granary (which already has hammers invested) before it grows an additional size. I had to establish the previous post so I could ignore all food growth while completing the granary. If the assumption does not hold, you can keep growing until it is true.

Food to regrow
2 x ( 10 + n - 1 )
Turns to regrow from halfway with a granary
( 10 + n - 1 ) / F( n - 1)

Turns to build slowly
G / H( n )

So if turns to regrow is faster than turns to build, whipping is better. Therefore,
F( n - 1 ) / H( n ) > (10 + n - 1) / G

Of course you have to add extra food to the numerator if your granary growth is inefficient. When G ~ 30
F(n-1)/H(n) > (10+n-1)/30

Note this has more to do with your total food/hammers, as opposed to individual tile yield. So you in this case can avoid worrying about the value of that copper tile to a rice tile, when it's the ratios that matter.
 
Let's say it takes 6 food to grow from empty to the next size, meaning your granary will store 3 food.

Blink? That's not how the granary mechanic works.

Food goes into the granary at a 1:1 rate until the granary hits its cap. That's the rationale behind the "half the food bin" optimization.

If you complete the granary on turn N, and find yourself at the beginning of turn N+1 at 18/24, growing with a 6 food surplus will bring you to 6/26, not 3/26.

You have to be particularly careful about how you count the food. In an example where you whip the granary on turn N, and grow after N+1, it can easily look like half the food is stored. But that's an accident of the timing of the arrival of the food and the granary on turn N.

For instance, if you are whip the granary from 10/24 to 10/22, and work a 4F tile to recover, you should see 14/22, 18/22, 8/24. If only half the food were being stored, you would see 4/24 after the growth.
 
No, I'm saying instead of 26 food to grow, it takes 6 food to grow. Because writing 26 rows of data is unreasonably long to read. I wasn't clear enough about this, does this make sense.
 
Back
Top Bottom