3.19 Startsite Normalization Procedure

Wreck

Prince
Joined
Jan 4, 2006
Messages
331
Here's a summary of how CivIV BTS 3.19 alters the start sites for all civs. (This post is an update of the information found in this thread: http://forums.civfanatics.com/showthread.php?t=252429, without which creating it would have been much harder.) Note that the code for each of these steps can be overridden in Python, and evidently is sometimes. I.e., I have seen peaks in the start site BFC on the Great Plains map.

In all cases, the "BFC" refers to the big fat cross of the city minus the start tile itself; the start tile itself is not altered by many of the effects. Where the BFC is mentioned but the start tile can be altered, I note that explicitly. When tiles are altered in steps 6-9, each tile in the BFC is checked once, with the order of the tiles being randomized.

CivIV BTS 3.19 Startsite Normalization Procedure

1) Add Rivers: If the start site does not have fresh water, checks to see if a lake can be added in the BFC (using the same code as step 3). If it can add a lake, it tries to add a river in a way that might or might not provide fresh water. (This river always starts in the SE corner of the start tile, but its direction can be any of the four.) If it sees it cannot add a lake, it tries to add a river in a smarter way instead, that always gives fresh water to the start site if it succeeds.

2) Remove Peaks: Replaces peaks with hills. This is done for all tiles in the 7x7 square area centered on the start site.

3) Add Lakes: If the startsite doesn't have fresh water yet, adds a lake somewhere in the BFC. A lake can be added to a non-river-adjacent land tile if all tiles adjacent to it are not water. The search order is the inner ring first, starting with the tile 1N of the start site (this is where most lakes will go). If a lake cannot be sited in the inner ring, the outer ring will also be attempted, starting with the tile 2N of the start site.

4) Remove Bad Features: Removes bad features (jungle and sea-ice) within 3 tiles of the start site. The chance to remove the feature is 50% for most tiles, but just 25% for resource tiles. In addition, removes all coastal sea-ice within 4 tiles of start site.

5) Remove Bad Terrain: Replaces sub-par terrain tiles with grassland. A "sub-par" tile for this purpose is any tile with natural yield of less than 2 food+hammers (that is, snow, desert, unforested tundra, although some of these terrain types will be acceptable with a resource on them). This is done for all tiles in the BFC including the start site. It is also done for all of the coastal land tiles, and 50% of non-coast land tiles, in the 3rd ring.

6) Add Food Bonuses: Tries to make the BFC have at least one (land) food resource or two seafood resources. In addition, if the site has no other resource tiles with 2+ food, and no floodplains/oases, the site will get one more food resource (of either kind). Resources added will depend on the tile type of the randomly-chosen BFC tile that the program gets to first, that can accept a resource:
forested tundra: deer
unforested flat plains: corn
unforested flat grassland: corn
unforested grassland hills: pigs
jungle: pigs
coast: clams
ocean: fish​
Other tiles either won't exist at this stage in the procedure (i.e. unforested tundra, peaks), or won't accept any food resource (non-tundra forests reject all resources).

7) Add Good Terrain: Tries to make sure you have at least four "good" tiles in the BFC, "good" being any tile with a natural (unimproved) yield of 2+ food and 1+ hammers. It will replace up to four non-resource flat land tiles with grassland forests, to try to make that true.

8) Add Extras: Tries to improve the BFC until it has at least 80% of the best start-site's value. (Not sure yet what this "value" is exactly, but presumably it is at least semi-reasonable.) It does this in three steps, checking after each change, and stops when/if it reaches 80% value, or when it runs out of stuff to do:
a. Add a sprinkling of extra forest to some of the BFC tiles that are forestable. Tile must be non-resource land tiles, without a current feature. Although all tiles are checked once, there is a random chance that any tile will be skipped over that increases with the number of successfully-added forests. Hence, even in a low-value site with all 20 BFC squares able to take a forest, this step still won't forest more than 2 or 3 tiles on average.
b. Add certain kinds of food or production resources to BFC tiles, until the site has four or more resources, with seafood counting as 2/3 of a resource. The resource added to a tile will depend on the starting tech and terrain; in a normal ancient start it is this:
forested tundra: deer
unforested plains (flat or hill): marble
unforested flat grassland: corn
unforested grassland hills: pigs
jungle: pigs
coast: clams
ocean: fish​
If the resource could not be placed because of forest, and the site is at least half water, the forest gets removed, and then a resource is added as per above.
c. Add a forest to every BFC tile that can have one.

9) Add Hills: Tries to make sure the start site has enough hills. If there are less than 3 hills in the BFC including startsite, it will add hills until there are three. Hills can be added only on land, not already a hill, not floodplains or oasis, and if a resource tile, the resource must be allowed on hills.
 
So the bugs were fixed that resulted in an all forest spawn?

I believe 3.17 had these same rules, but the order they were applied resulted in all forests when it went to improve the land.
 
Yes. Based on that earlier thread, I would guess the rules were the same in 3.17, except for the tweaks to part 8. (They had step 8c where 8a now is, and no 8a.) However, his descriptions were not in this level of detail, and some of his descriptions are slightly wrong. I.e., in spite of their location in the code with the other extras, you get your three hills no matter whether the site has gone above 80% or not.
 
:woohoo:
 
Very nice post, Wreck.
6) Add Food Bonuses: Tries to make the BFC have at least one (land) food resource or two seafood resources.
What exactly counts as a food resource? Sugar, grapes, whales, cows on plains?
 
Very nice post, Wreck.
What exactly counts as a food resource? Sugar, grapes, whales, cows on plains?
A "food" resource is one that is defined in the appropriate xml file as such. (Location in the game is irrelevant, just the resource type.) If you look in the file C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Assets\XML\Terrain\CIV4BonusInfos.xml (on my windows, you may have installed somewhere nonstandard), then you can see the various resources ("bonuses"). Each one has a "YieldChanges" list with three iYieldChange subfeatures; these are in order food, hammers, and commerce. If the resource has a 1 in the first iYieldChange subfield, it's food.

For example, the first food defined is bananas. Part of it is this:
Code:
 <Type>BONUS_BANANA</Type> 
  <Description>TXT_KEY_BONUS_BANANA</Description> 
  <Civilopedia>TXT_KEY_BONUS_BANANA_PEDIA</Civilopedia> 
  <BonusClassType>BONUSCLASS_GENERAL</BonusClassType> 
  <ArtDefineTag>ART_DEF_BONUS_BANANA</ArtDefineTag> 
  <TechReveal>NONE</TechReveal> 
  <TechCityTrade>TECH_CALENDAR</TechCityTrade> 
  <TechObsolete>NONE</TechObsolete> 
- <YieldChanges>
  <iYieldChange>1</iYieldChange> 
  <iYieldChange>0</iYieldChange> 
  <iYieldChange>0</iYieldChange> 
  </YieldChanges>
Anyway, I'm sure you just want the list of what resources are "food". They are:
banana
clam
corn
cow
crab
deer
fish
pig
rice
sheep
wheat
sugar
whale​
 
This is definitely not true on all map scripts, considering I've seen plains cow without even a flood plain otherwise and non-fresh water capitols.

Looks like I must go further back for prox considerations.
 
Tech masonry and open with a settler, I guess :/. Why even allow bum starts like that? Surely if DaveMCW can manage a foodscore evaluation rule of thumb that functions well almost universally, the programmers could have done it...at least post-patch to correct the mistake if not before.
 
This is definitely not true on all map scripts
Yes, and I mention that.

considering I've seen plains cow without even a flood plain otherwise
Only one food resource is allowed by the procedure; it does mean you've got a resource with 2+ food somewhere, which may be hidden initially. And it will also tend not to happen unless the procedure thinks you have a good startsite (that is, it is not adding resources in step 8).

and non-fresh water capitols.
This can happen if the procedure cannot place a lake, or the lake placed goes in the second ring, and it either cannot place a river, or it succeeds in the "dumb" river placement but puts it starting SE of the settler and the river goes either south or east initially and thus does not water the startsite.
 
It's called the regenerate map button ;)

The AI does not have this button, and one AI with a start like that + another that does not is not always a minor problem. Look what happened in the recent noble's club with mansa musa ---> a screwed start for a neighbor neutered the AI's expansion so badly that the human could peacefully settle to #1 land. On immortal. Pre-astronomy.

Pull the human from that spot and replace him with shaka, and shaka will settle the same land, kill the neighbor, and wind up with over 1/3 of the world's land and pop...with 6 civs left in the game.

These are exactly the kinds of things anybody purporting "balanced" starts should address.
 
Top Bottom