From ICS to OCP, gridlike city placement explored

Celebithil

Warlord
Joined
Sep 2, 2004
Messages
219
Introduction:
As we all know Civilization is not about winning the game, or conquering enemies, it is about building a pretty empire. In particular everything should be as you want it and nice and ordered. Especially the cities should all follow a preset pattern. Now in Civ4 quite often an obstruction occurs for your nice pattern. There is a mountain, or a lake square, where you want to found your city. Or there is some resource, which you don't want to settle on top of. However diverting from your pattern (by not founding the city, or founding a city close to the intended spot) will often lead, not only to imperfections in the pattern of cities, but also to tiles which can not be worked. This guide will explore the different lattices (grids) on which you can place your cities and how flexible they are when you have to move a city.

More seriously, I think that placing your cities along some specific grid is NOT the optimal strategy. In civ2 you could do this very well, as any terrain could be transformed by your engineers into something useful, and not very useful cities were no problem, as they did not drag upon your entire empire. In civ 4 this has changed dramatically and you should only found cities in very good spots (at least in the first stages of the game, later you can backfill the leftover marginal spots). This implies in particular that I have abandoned the plan to have some specific pattern in city placement. However when I get into the mood I sometimes cannot suppress the urge to start a game and place all cities in a nice grid. Moreover it is a pretty good tactic if you come upon a large unsettled land and want to use all the land anyway (halfway in the game, so you can afford the higher maintenance cost induced by not first only settling in the good spots).

Definition:
Let me now define a gridlike city placement:
A gridlike city placement is obtained by taking two (not collinear) vectors (x_1,y_1) and (x_2,y_2) and placing cities on the tiles (nx_1+mx_2,ny_1+my_2) for integers n and m.

An ICS would use the vectors (3,0) and (0,3), and place cities on (3n,3m), while OCP would correspond to (4,2) and (0,5), let me draw this
ooooooooXoooooooo
ooooooooooooooooo
ooooXoooooooooooo
oooooooooooooXooo
ooooooooooooooooo
ooooooooXoooooooo
ooooooooooooooooo
ooooXoooooooooooo
oooooooooooooXooo
In this picture X's denote the location of cities, while o's denote empty spots. I coloured a few BFC's, and note the single purple spot, where two BFC's have overlap.

I will only consider gridlike city placements which can work every tile. With this condition there are only 23 different grids possible (taking into account the restrictions Civ4 places on founding cities close to each other), a list of which is given below.

Number of working tiles:
One important decision before making a gridlike city placement is how many tiles each individual city should work. There have been many disputes on what is optimal, and I do not want to give an answer to that. Let me just mention that the main argument for wanting a low numbers of working tiles for each city (for example in ICS), is that you can work those tiles earlier. An argument for wanting a high number of tiles (for example OCP) is that you have less cities and therefore less maintenance cost.

Given the vectors (x_1,y_1) and (x_2,y_2) the (average) number of working tiles per city equals
|x_1 y_2 -x_2y_1| (for the knowledgeable amongst you, this is the norm of the cross product, if we consider the vectors to be in R^3 by adding a third component which is zero). Of course one can vary the
number of tiles worked by each city, since overlapping tiles can either all be assigned to one city or distributed amongst the different cities (one can even work the tile by one city on odd turns, and by another city on even turns, though this requires a lot of micro management ;)).

Flexibility of a grid:
As mentioned in the introduction the main problem I have when building cities on a nice grid is that sometimes you have to move a city one spot, because there is a mountain or ocean in the way. Thus I considered for each grid whether one could move a city (assuming all neighbouring cities are founded on the grid), and how many tiles you would miss (i.e. not be able to work with any city) by moving your city.

For each grid one can draw the boundaries of the BFCs of all neigbouring cities of some give gridpoint, and this gives a "hole" of tiles which can only be worked by a city on the gridpoint. Generally these tiles are also the tiles on which you can perhaps found your city if it is not possible to found it on the grid, with the exception of points in the corners of BFCs (i.e. (2,2) away from another city).
Thus the flexibility of a grid can be visualized by drawing this hole, and denoting on which positions it is impossible to found a city.

To give an example for this, consider the grid (3,1), (-1,4). This gives the image
ooooooooooooXo
oooooooooXoooo
ooooooXooooooo
oooXoooooooooo
XooooooooooooX
ooooooooooXooo
oooooooXoooooo
ooooXooooooooo
oXoooooooooooo
oooooooooooXoo
ooooooooXooooo

and the hole is of the form
is-
-X-
-si
where i denotes a spot where you cannot settle. s a spot where you can settle, and X the intended
spot in the grid. Moving the city one south, is therefore possible, and your city still works all tiles in the hole, so you do not lose any squares.

In the list below I have given all these holes, together with a list of how many tiles you lose when moving.

List of possible grid:
So here is the list of possible grids, ordered by the average number of working tiles. The list contains all grids, up to symmetries (i.e. rotating a grid 90 degrees, or taking its mirror image). The items in the list contain first the two vectors, then the hole, in a format where each line is broken of by a \, so the hole above will be denoted is- \ -X- \-si (this allows me to describe a hole in a one line notation). On the next line I give the possible numbers of lost tiles on different actions, where directions as S and N denote moving the city one tile South or North, and rem denotes not placing the city at all.

  • 9 working tiles
    • (3,0), (0,3): X
      1: rem
    • (3,0), (1,3): X
      1: rem
  • 10 working tiles
    • (3,1), (-1,3): X
      1: rem
  • 11 working tiles
    • (3,1), (-2,3): i \ X \ i
      3: rem
  • 12 working tiles
    • (3,1), (0,4): is- \ -X- \ -si
      0: N,S 5:rem
    • (3,0), (0,4): s \ X \ s
      0: N,S 3:rem
    • (3,0), (1,4): s \ X \ s
      0: N,S 3:rem
  • 13 working tiles
    • (3,2), (-2,3): -i- \ iXi \ -i-
      5: rem
    • (3,1), (-1,4): is- \ -X- \ -si
      0: N,S 5:rem
  • 14 working tiles
    • (3,2), (-1,4): ss- \ iXi \ -ss
      0: N,S 1: NW,SE 7: rem
    • (3,1), (-2,4): -i- \ is- \ -X- \ -si \ -i-
      1: N,S 7: rem
  • 15 working tiles
    • (3,0), (1,5): isi \ -s- \ -X- \ -s- \ isi
      3: N,S 4: NN,SS 9:rem
    • (4,1), (1,4): iss \ sXs \ ssi
      0: N,E,S,W 1: NE,SW 9:rem
    • (3,2), (-3,3): -s- \ is- \ iXi \ -si \ -s-
      1: N,S 3: NN,SS 9:rem
    • (3,1), (0,5): is- \ is- \ -X- \ -si \ -si
      2: N,S 4: NN,SS 9:rem
    • (3,0), (0,5): isi \ -s- \ -X- \ -s- \ isi
      3: N,S 4: NN,SS 9:rem
  • 16 Working tiles
    • (4,0), (2,4): -i- \ sss \ sXs \ sss \ -i-
      0: E,W 1: N,S 2: NE,SE,SW,NW 11:rem
    • (4,0), (1,4): i-- \ sss \ sXs \ sss \ --i
      1: N,E,S,W 2: NE,SE,SW,NW 11:rem
    • (3,2), (-2,4): --i-- \ sss-- \ -iXi- \ --sss \ --i--
      2: N,S 3: SE,NW 6: SEE,NWW 11:rem
  • 17 working tiles
    • (4,1), (-1,4): ---i- \ isss- \ -sXs- \ -sssi \ -i---
      2:N,E,S,W 3:NE,SE,SW,NW 13:rem
  • 18 Working tiles
    • (4,1), (-2,4): --is- \ isss- \ -sXs- \ -sssi \ -si--
      2: E,W 3: N,S 4: NE,SE,SW,NW 9: NNE,SSW 15:rem
  • 19 working tiles
    • (4,1), (-3,4): -iss- \ isss- \ -sXs- \ -sssi \ -ssi-
      3: E,W 4: N,S 5: NE,SE,SW,NW 7: NN,SS 9: NNE,SSW 17:rem
  • 20 working tiles
    • (4,2), (0,5): -sss- \ isss- \ isXsi \ -sssi \ -sss-
      4: N,E,S,W 6: NE,SE,SW,NW 9: NN,SSE,SS,NNW 10: NNE,SSW 19:rem

Some final remarks:
I'd like to give especial prominance to the (4,1), (1,4) grid. It provides a lot of flexibility (there are four different tiles you can found your city without losing squares). It moreover gives an average number of working tiles (which I now believe is the best).

The next time I am in the mood I will definitely use this grid :).
 
Nice to see some grid treatment in here... good ol'Civ II/III stuff :old:

A question: as you should know, civ IV ( as the oldest versions ( at least civ III did... never played II ) ) does not neasures distances in a good old cartesian way, and as Civ IV as a huge toll for city maintenance, it is important to minimize the overall distance to the capital/Forbidden Palace/Versailles. Do you have any data about what grid fits better that propose?
 
Settle the resource clumps and ignore the grid.

I quite agree this is the optimal strategy in civ4 if you want to win, that's why I started the thread that civ was not about winning ;-). Sometimes I have different goals, and one of those is building a perfectly organized empire. For me this includes building cities in some orderly fashion as on a grid. And I know I'm not the only one who thinks that way. The last game I was doing this I got really annoyed by some badly placed lake, so I figured I'd try to see whether other grids could avoid such problems.

Interesting question r_rolo. Do you know a recent article on city upkeep, and distance maintenance (the article in the war academy still says that distance maintenance is basically rounded down to an integer, while in BTS I doubt this is still the case). Then one could probably give a formula describing total city maintenance for n cities on a grid (with a palace at the centre).
 
Actually when I think about it, the type of metric used does not matter much. As long as distance maintenance is linear in distance up to first order (i.e. the main part) the cost only depends on the number of working tiles (w) per city. In particular if you want to work an area of K tiles, you need k/w cities, at an average distance of about k^(1/2) (times a constant depending on the metric), so the total distance becomes k^(3/2)/w, with a constant depending on the metric, but independent of the particular grid (apart from its dependence through w). There might be some terms (constants times k) which differ depending on the grid, but explicit calculations seem pretty tedious (I tried one).

Anyway I think the answer surface^(3/2)/working tiles is good enough for most purposes. You can also calculate this on the number of cities. If you have n cities, they will cover nw tiles, so be located at about n^(1/2) w^(1/2) and total cost is n^(3/2)w^(1/2) times some constant.

Note that these formulas seem to contradict each other, the one says cost goes down if w increases, and the other says it goes up. This is because in the case you consider a constant surface you will stack more cities in if w goes down (less place per city), so the two results are not entirely comparable. I think the surface one is more important since in the only case you would actually implement this in an optimal game is when colonizing a new island, when you are advanced enough you just want to cover the entire island (even marginal cities are profitable in the late game after all), but then you don't want a fixed amount of cities, but a fixed amount of land.

PS This of course only holds if you place a forbidden palace (or Versailles, or your actual palace) in the middle of the grid.
 
Introduction:
As we all know Civilization is not about winning the game, or conquering enemies, it is about building a pretty empire. In particular everything should be as you want it and nice and ordered. Especially the cities should all follow a preset pattern. Now in Civ4 quite often an obstruction occurs for your nice pattern. There is a mountain, or a lake square, where you want to found your city. Or there is some resource, which you don't want to settle on top of. However diverting from your pattern (by not founding the city, or founding a city close to the intended spot) will often lead, not only to imperfections in the pattern of cities, but also to tiles which can not be worked. This guide will explore the different lattices (grids) on which you can place your cities and how flexible they are when you have to move a city.

More seriously, I think that placing your cities along some specific grid is NOT the optimal strategy. In civ2 you could do this very well, as any terrain could be transformed by your engineers into something useful, and not very useful cities were no problem, as they did not drag upon your entire empire. In civ 4 this has changed dramatically and you should only found cities in very good spots (at least in the first stages of the game, later you can backfill the leftover marginal spots). This implies in particular that I have abandoned the plan to have some specific pattern in city placement. However when I get into the mood I sometimes cannot suppress the urge to start a game and place all cities in a nice grid. Moreover it is a pretty good tactic if you come upon a large unsettled land and want to use all the land anyway (halfway in the game, so you can afford the higher maintenance cost induced by not first only settling in the good spots).

I red your article and posts carefully and liked your view depending on actual math functions, as math is always the rightful judge.
I agree with the placement you drew above and it is my favourite as well BUT !!! Generally, I cannot obey it in Civ4. You also told about this in your comparison of Civ2 with Civ4.

Main reasons that disturb my ideal placements; sometimes a rival neighbouring city, sometiems a lake/mountain, and sometimes because of strategic reasons like having a resource and blocking a rival civ from passage to the land you want to settle later on.
Especially sometimes there is no land that enables you to block the AI with 1 city, you have to place 3 or even 4 cities and you have to reach 30culture points fastly.
And sometimes, I have to found 3/4 cities mainly because of its resource more than the good tiles.
If these cities that I'm talking about, which are not basically found for good tiles, are much in number especially in old ages, you have to slow on research.
And many times, my bordering cities are far away than capital. But it's a must in many cases, if you are sharing a continent with good resources.

If the AI is far away and cannot be destroyed easily than I have to use a method like the following.


*First I place 3-4 cities near to capital. I try to arrange a working tiles number more than 17(incl. city itself) for each city, which means 1-2 can be shared between neighbour cities and each city might have 1-2 desert/mountain.
* Then I start founding border cities.
* I continue founding some more cities near capital.
* I try to found a colony with 2 cities
* When I block border and block passage of AI to my inner lands, I leave there empty for many turns. I generally don't try to have more than 10 cities until I discover Code of Laws, currency and calendar
* Although I don't expand, and no more cities than nearly 10, I continue building colonies
* After these researchs, I found more cities. some with new plantations and some more cities near the coast, some more near rivers, maybe some more to build new cottages. I go up to nearly 20 cities.
* After researching liberalism, economics, and democracy, I continue expanding
* After optics, I try to found a colony on another landmass.

About colonization;first I found 2 cities and grant indepence. If there are very good resources I need, I generally settle on them after granting independence. And I don't liberate such cities to the colony. I later found new cities and liberate them to the colony. If I found 2 mroe cities on another island near the existing colony, I prefer granting indepence to a new civ instead of liberating cities to the existing one.


And there are tiles that I generally try to settle upon but this is not as much important as the tiles that will be in the fat cross;
* Useless tiles like desert/tundra etc
* plains&hill (gives 2 F,2H,1C instead of 2F,1H,1C)
* sometimes I can also settle on resources that doesn't give good F/H or C when worked on (for example wine)
* near fresh water

Some more of my principles:
* If a river has many flood plains (which generates more food, and more unhealthiness) like 6-7 tiles, I try to divide them to 2 cities. Flood plains help a city grow fast but if much in number they create health problems later. So dividing to 2 cities, you will have 2 cities growing fast instead of 1 and you don't have such a big health problem later. You will have 1/2 unhealthiness in both cities instead of a s 3/4 unhealtiness in 1 city! If you have to found 1 city there, than at leats in the beginning try building cottages instead of farms! Or build 1 city in the beginning, build the second one sharing flood plains later during later expanding.
* An example: If I haven't researched monarchy yet, I try to block AI passage to wine but don't settle until research is complete, unless it has other good tiles.
* I don't settle early on resources which doesn't create good F/H/C, unless I need their health/happiness extra urgently, but still I block AI passage.
* I leave some tiles in my inner country to settle later on, especially tiles with many flatland jungles. Depending on city specialization, I improve flatland jungles with farm or workshop or cottage. Some jungle tiles, I settle early especially for building cottages earlier because it takes much time for cottages to reach town.
*Sometimes I can also arrange some resource types (the ones which doesn't create good F/H/C) just outside city fat cross but within its cultural borders. If it doesn't create good F/H/C/, no need to have it in city fat cross. But I will still have that resource type. This requires a city with cultural point more than 150 of course. But if you do this on a border city, your resource becomes in danger always.
 
I generally avoid placing cities within three tiles of another city. I only do this when required by coastline, to grab a resource, to deny the AI a city site, or when most/all of the overlap tiles really, really suck (ocean, mountain, desert).

Four tiles is ok, but I really dislike doing four tiles directly N, S, E, or W of the other city, which results in three tiles of overlap.

My fave configuration, all other things being equal, is the one in the OP's first diagram. All tiles used, overlap minimized. However, I will throw OCP out the window if another spot gets more resources, or a particular resource sooner.
 
Cities rarely grow to pop 20 early on though...making overlap less problematic. Smaller cities in between bigger ones that use few tiles still have some definite uses - as I play it seems more and more so.
 
4 tiles overlapping is not a big deal, especially if the overlapping tiles are useless.
4 tiles overlapping means, 2 tiles handicap for each city may result with 2 population less, which in many cases is not so many important. At least, it is better than loosing many tiles.
and if 2 cities have to overlap more than 4-5 tiles than i generally don't settle for the 2nd one in the beginning. I do it later.

I generally avoid placing cities within three tiles of another city. I only do this when required by coastline, to grab a resource, to deny the AI a city site, or when most/all of the overlap tiles really, really suck (ocean, mountain, desert).

Four tiles is ok, but I really dislike doing four tiles directly N, S, E, or W of the other city, which results in three tiles of overlap.

My fave configuration, all other things being equal, is the one in the OP's first diagram. All tiles used, overlap minimized. However, I will throw OCP out the window if another spot gets more resources, or a particular resource sooner.

You are right about trying to have overlap minimized. But in my opinion, u r right only for during old ages. Not modern times.

after you reach democracy or communism, it is even a smaller loss. When each 10% slide in tax rate means more than 100/200, a new city will not effect much. Let's say that each city make you loose 30 gpt, and if your economy is growing every turn ( as it shoudl normally be), you should be able to compensate that loss in a small time.

by the way, as number of cities parameter is limited with some value, it is a smaller problem after soem ciritical number of cities (described with tests in some other threads) and i observed it myself as well.

especially if you are going for a domination or conquest victory, you should support a very big army which requires many cities. free units make me comfortable. even if you want to make a space or cultural victory you still need many defensive units (of course if you don't prefer to load 10-20 turns back in some cases)

So after (free market AND corporations) OR (state property & WORKSHOPS) every number of city is possible. You may have so many number of cities that you may not find a place to settle new cities on any more, unless you have a worl larger than huge. Yes, you can never reach number of cities as you can in CIV2 or alpha centauri but this is already the main philosophy of CIV4.
 
Back
Top Bottom