Very strange resources distribution in CivIVCol.

KJ Jansson

Prince
Joined
Oct 7, 2008
Messages
509
Who understand the distribution of resources in CivIVCol?

Let's analyse the situation with SILVER, for instance. As an example I will take original CivIVColonization with 1.01 patch. Please, note without any modification!

Question: Where and how SILVER could appear?

1. SILVER as a bonus.

....\Sid Meier's Civilization IV Colonization\Assets\XML\Terrain\CIV4BonusInfos.xml

Code:
			<Type>BONUS_SILVER</Type>
			.............
			<TerrainBooleans>
				<TerrainBoolean>
					<TerrainType>TERRAIN_TUNDRA</TerrainType>
					<bTerrain>1</bTerrain>
				</TerrainBoolean>
				<TerrainBoolean>
					<TerrainType>TERRAIN_SNOW</TerrainType>
					<bTerrain>1</bTerrain>
				</TerrainBoolean>
			</TerrainBooleans>
			<FeatureBooleans>
				<FeatureBoolean>
					<FeatureType>FEATURE_FOREST</FeatureType>
					<bFeature>1</bFeature>
				</FeatureBoolean>
				<FeatureBoolean>
					<FeatureType>FEATURE_LIGHT_FOREST</FeatureType>
					<bFeature>1</bFeature>
				</FeatureBoolean>
			</FeatureBooleans>
			<FeatureTerrainBooleans>
				<FeatureTerrainBoolean>
					<TerrainType>TERRAIN_TUNDRA</TerrainType>
					<bFeatureTerrain>1</bFeatureTerrain>
				</FeatureTerrainBoolean>
				<FeatureTerrainBoolean>
					<TerrainType>TERRAIN_SNOW</TerrainType>
					<bFeatureTerrain>1</bFeatureTerrain>
				</FeatureTerrainBoolean>
			</FeatureTerrainBooleans>

Thus, SILVER could appear on TERRAIN_TUNDRA and TERRAIN_SNOW if they have FEATURE_FOREST and FEATURE_LIGHT_FOREST.

P.S. I leave my comments about silver in snow outside the discussions.

2. +1 SILVER as result of <RiverYieldIncreases>:

\Sid Meier's Civilization IV Colonization\Assets\XML\Terrain\CIV4TerrainInfos.xml

a)
Code:
<Type>TERRAIN_GRASS</Type>
			.............
			<RiverYieldIncreases>
				.............
				<YieldIntegerPair>
					<YieldType>YIELD_SILVER</YieldType>
					<iValue>1</iValue>
				</YieldIntegerPair>
			</RiverYieldIncreases>

b)
Code:
<Type>TERRAIN_PLAINS</Type>
			.............
			<RiverYieldIncreases>
				.............
				<YieldIntegerPair>
					<YieldType>YIELD_SILVER</YieldType>
					<iValue>1</iValue>
				</YieldIntegerPair>
			</RiverYieldIncreases>

c)
Code:
<Type>TERRAIN_DESERT</Type>
			.............
			<RiverYieldIncreases>
				.............
				<YieldIntegerPair>
					<YieldType>YIELD_SILVER</YieldType>
					<iValue>1</iValue>
				</YieldIntegerPair>
			</RiverYieldIncreases>

d)
Code:
<Type>TERRAIN_TUNDRA</Type>
			.............
			<RiverYieldIncreases>
				.............
				<YieldIntegerPair>
					<YieldType>YIELD_SILVER</YieldType>
					<iValue>1</iValue>
				</YieldIntegerPair>
			</RiverYieldIncreases>

e)
Code:
<Type>TERRAIN_SNOW</Type>
			.............
			<RiverYieldIncreases>
				.............
				<YieldIntegerPair>
					<YieldType>YIELD_SILVER</YieldType>
					<iValue>1</iValue>
				</YieldIntegerPair>
			</RiverYieldIncreases>

Then in \Sid Meier's Civilization IV Colonization\Assets\XML\Terrain\CIV4FeatureInfos.xml:

a)
Code:
<Type>FEATURE_JUNGLE</Type>
			...........
			<RiverYieldIncreases>
				...........
				<YieldIntegerPair>
					<YieldType>YIELD_SILVER</YieldType>
					<iValue>1</iValue>
				</YieldIntegerPair>
			</RiverYieldIncreases>

b)
Code:
<Type>FEATURE_FOREST</Type>
				...........
				<YieldIntegerPair>
					<YieldType>YIELD_SILVER</YieldType>
					<iValue>1</iValue>
				</YieldIntegerPair>
			</RiverYieldIncreases>

c)
Code:
<Type>FEATURE_LIGHT_FOREST</Type>
				...........
				<YieldIntegerPair>
					<YieldType>YIELD_SILVER</YieldType>
					<iValue>1</iValue>
				</YieldIntegerPair>
			</RiverYieldIncreases>

That's all were SILVER can appear.

And now let's start the game and see which SILVER distribution we really have. I used couple standard maps from CivIVCol without changes and modifications. I generate a number of maps of different size, however all the time the result was the same. Practically we have two possible variants:

Picture 1. Hill/Forest/Tundra; here we have a SILVER_BONUS



Picture 2: As you see, each Peak has 1 SILVER, or 2 SILVER if Peak has <RiverYieldIncreases>



OK, but were is SILVER in snow? Why SILVER all the time appears on Peaks, that according to

\Sid Meier's Civilization IV Colonization\Assets\XML\Terrain\CIV4TerrainInfos.xml

have no <Yields/> or <RiverYieldIncreases/>?

Code:
		<TerrainInfo>
			<Type>TERRAIN_PEAK</Type>
			<Description>TXT_KEY_TERRAIN_PEAK</Description>
			<Civilopedia>TXT_KEY_TERRAIN_PEAK_PEDIA</Civilopedia>
			<ArtDefineTag>ART_DEF_TERRAIN_PEAK</ArtDefineTag>
			<Yields/>
			<RiverYieldIncreases/>
			.....

Who can explain how SILVER instead of TERRAIN_SNOW suddenly appears on TERRAIN_PEAK that according to xml file must be without any resources at all? Any ideas?
 
The yields given by peaks and hills are actually in YieldInfos:

Code:
		<YieldInfo>
			<Type>YIELD_SILVER</Type>
			<Description>TXT_KEY_YIELD_SILVER</Description>
			<Civilopedia>TXT_KEY_YIELD_SILVER_PEDIA</Civilopedia>
			<bCargo>1</bCargo>
			<iBuyPriceLow>19</iBuyPriceLow>
			<iBuyPriceHigh>19</iBuyPriceHigh>
			<iSellPriceDifference>1</iSellPriceDifference>
			<iPriceChangeThreshold>100</iPriceChangeThreshold>
			<iPriceCorrectionPercent>10</iPriceCorrectionPercent>
			<iNativeBuyPrice>-1</iNativeBuyPrice>
			<iNativeSellPrice>6</iNativeSellPrice>
			<iNativeConsumptionPercent>25</iNativeConsumptionPercent>
			<iNativeHappy>0</iNativeHappy>
[COLOR="Red"][b]			<iHillsChange>0</iHillsChange>
			<iPeakChange>1</iPeakChange>[/b][/COLOR]
			<iLakeChange>0</iLakeChange>
			<iCityChange>0</iCityChange>
			<iMinCity>0</iMinCity>
			<iAIWeightPercent>100</iAIWeightPercent>
			<iAIBaseValue>0</iAIBaseValue>
			<iNativeBaseValue>2</iNativeBaseValue>
			<iPower>0</iPower>
			<iAsset>1</iAsset>
			<ColorType>COLOR_YIELD_FOOD</ColorType>
			<UnitClass>UNITCLASS_SILVER</UnitClass>
			<iTextureIndex>2</iTextureIndex>
			<iWaterTextureIndex>2</iWaterTextureIndex>
			<Icon>,Art/Interface/Buttons/Unit_Resource_Colonization_Atlas.dds,3,14</Icon>
			<HighlightIcon>,Art/Interface/Screens/City_Management/Colonization_Yield_Highlight_Icon_Atlas.dds.dds,3,1</HighlightIcon>
			<Button>,Art/Interface/Buttons/Unit_Resource_Colonization_Atlas.dds,3,1</Button>
		</YieldInfo>

As for the silver bonus:

Code:
		<BonusInfo>
			<Type>BONUS_SILVER</Type>
			<Description>TXT_KEY_BONUS_SILVER</Description>
			<Civilopedia>TXT_KEY_BONUS_SILVER_PEDIA</Civilopedia>
			<ArtDefineTag>ART_DEF_BONUS_SILVER</ArtDefineTag>
			<BuildingType>BUILDING_BONUS_SILVER</BuildingType>
			<YieldChanges>
				<YieldIntegerPair>
					<YieldType>YIELD_SILVER</YieldType>
					<iValue>2</iValue>
				</YieldIntegerPair>
			</YieldChanges>
			<iAIObjective>0</iAIObjective>
			<iPlacementOrder>5</iPlacementOrder>
			<iConstAppearance>50</iConstAppearance>
			<iMinAreaSize>3</iMinAreaSize>
			<iMinLatitude>0</iMinLatitude>
			<iMaxLatitude>90</iMaxLatitude>
			<Rands>
				<iRandApp1>25</iRandApp1>
				<iRandApp2>25</iRandApp2>
				<iRandApp3>0</iRandApp3>
				<iRandApp4>0</iRandApp4>
			</Rands>
			<iPlayer>0</iPlayer>
			<iTilesPer>6</iTilesPer>
			<iMinLandPercent>0</iMinLandPercent>
			<iUnique>0</iUnique>
			<iGroupRange>0</iGroupRange>
			<iGroupRand>0</iGroupRand>
			<bArea>0</bArea>
[COLOR="Red"][b]			<bHills>1</bHills>
			<bFlatlands>0</bFlatlands>[/b][/COLOR]
			<bNoRiverSide>0</bNoRiverSide>
			<TerrainBooleans>
				<TerrainBoolean>
					<TerrainType>TERRAIN_TUNDRA</TerrainType>
					<bTerrain>1</bTerrain>
				</TerrainBoolean>
				<TerrainBoolean>
					<TerrainType>TERRAIN_SNOW</TerrainType>
					<bTerrain>1</bTerrain>
				</TerrainBoolean>
			</TerrainBooleans>
			<FeatureBooleans>
				<FeatureBoolean>
					<FeatureType>FEATURE_FOREST</FeatureType>
					<bFeature>1</bFeature>
				</FeatureBoolean>
				<FeatureBoolean>
					<FeatureType>FEATURE_LIGHT_FOREST</FeatureType>
					<bFeature>1</bFeature>
				</FeatureBoolean>
			</FeatureBooleans>
			<FeatureTerrainBooleans>
				<FeatureTerrainBoolean>
					<TerrainType>TERRAIN_TUNDRA</TerrainType>
					<bFeatureTerrain>1</bFeatureTerrain>
				</FeatureTerrainBoolean>
				<FeatureTerrainBoolean>
					<TerrainType>TERRAIN_SNOW</TerrainType>
					<bFeatureTerrain>1</bFeatureTerrain>
				</FeatureTerrainBoolean>
			</FeatureTerrainBooleans>
		</BonusInfo>

AFAIK bHills will make it possible for it to appear on hills and peaks, and bFlatlands would make it possible for it to appear on non-hills/peaks (but with silver, it is deactivated).

The TerrainInfo of both Hills and Peaks is set to be GraphicalOnly (which AFAIK means that their entries there are only for setting their art definitions); they are "special cases" that have their functionality regulated elsewhere.
 
Hills and Peaks are terrain heights, they are not terrain. However graphics only show terrains hence why they are "graphic only".

So basically, silver will only occur on the defined terrain types, IFF (if and only if) the plot is hills or peak. BONUS_SILVER bHills defines silver to appear on heights higher than flat (hills and peaks) whilst YIELD_SILVER defines silver +1 on peaks but not hills. As mentioned above, silver could (randomly) appear on TERRAIN_TUNDRA or TERRAIN_SNOW IFF they have FEATURE_FOREST or FEATURE_LIGHT_FOREST.

Silver will only appear on a plot that conforms to all conditions above if selected randomly. The silver bonus will only appear on a plot that has silver to start with, plus conforms to the extra conditions.

Confused? :)
 
Thank you very much, Androrc the Orc and Dale for your comments.

Today evening I will make additional tests with the resource distribution taking into account your remarks. Now I'm working on "1492: Global Colonization" mod where a number of new resources (stone, cocoa, "natural fibers", "ebony = valuable wood", tea, etc.) are included as you can see from this screen



However, the problem with correct resource distribution suddenly appears already on STONE. This resource didn't appear on peaks at all. I could create STONE on hills, but PEAKs were absolutely inaccessible.
 
:eek: that's a lot of yields!

Looks great :goodjob:

I have been playing Civ4Col with an Earth map, but with only the colonial civs playable. Works more or less like the normal Civ4Col, but I can play with colonial civs and natives of other continents; I'd like to be able to play with European civs and such on an Earth map though, so I'm looking forward to see your mod completed.
 
Back
Top Bottom