• Civilization 7 has been announced. For more info please check the forum here .

[1.0.2.13] Krakatoa Placement Bug (and fix)

Barathor

Emperor
Joined
May 7, 2011
Messages
1,202
v 1.0.2.13

This one has bothered me for a long time and while working on a modding project I stumbled upon why this wonder may be broken (and fixed it).

In CIV5Features, Krakatoa looks like this:

Code:
		<Row>
			<NaturalWonderType>FEATURE_VOLCANO</NaturalWonderType>
			<LandBased>false</LandBased>
			<AdjacentTilesCareAboutPlotTypes>true</AdjacentTilesCareAboutPlotTypes>
			<AdjacentTilesAvoidAnyland>true</AdjacentTilesAvoidAnyland>
			[B][COLOR="Red"]<AdjacentTilesRequireShallowWater>true</AdjacentTilesRequireShallowWater>
			<RequiredNumberOfAdjacentShallowWater>1</RequiredNumberOfAdjacentShallowWater>[/COLOR][/B]
			<AdjacentTilesCareAboutFeatureTypes>true</AdjacentTilesCareAboutFeatureTypes>
			<AdjacentTilesAvoidIce>true</AdjacentTilesAvoidIce>
			<MaximumAllowedAdjacentIce>0</MaximumAllowedAdjacentIce>
			<ChangeCoreTileToMountain>true</ChangeCoreTileToMountain>
			<ChangeCoreTileTerrainToGrass>true</ChangeCoreTileTerrainToGrass>
			<SetAdjacentTilesToShallowWater>true</SetAdjacentTilesToShallowWater>
		</Row>

However, it's specifying terrain that it "cares" about without changing the default value of the parent parameter (or whatever you want to call it) that's at the top of the list:

Code:
		<!-- Adjacent Tiles: Terrain Types -->
		[B][COLOR="Red"]<Column name="AdjacentTilesCareAboutTerrainTypes" type="boolean" default="false"/>[/COLOR][/B]
		<Column name="AdjacentTilesRequireGrass" type="boolean" default="false"/>
		<Column name="RequiredNumberOfAdjacentGrass" type="integer" default="0"/>
		<Column name="AdjacentTilesRequirePlains" type="boolean" default="false"/>
		<Column name="RequiredNumberOfAdjacentPlains" type="integer" default="0"/>
		<Column name="AdjacentTilesRequireDesert" type="boolean" default="false"/>
		<Column name="RequiredNumberOfAdjacentDesert" type="integer" default="0"/>
		<Column name="AdjacentTilesRequireTundra" type="boolean" default="false"/>
		<Column name="RequiredNumberOfAdjacentTundra" type="integer" default="0"/>
		<Column name="AdjacentTilesRequireSnow" type="boolean" default="false"/>
		<Column name="RequiredNumberOfAdjacentSnow" type="integer" default="0"/>
		[B][COLOR="Blue"]<Column name="AdjacentTilesRequireShallowWater" type="boolean" default="false"/>
		<Column name="RequiredNumberOfAdjacentShallowWater" type="integer" default="0"/>[/COLOR][/B]
		<Column name="AdjacentTilesRequireDeepWater" type="boolean" default="false"/>
		<Column name="RequiredNumberOfAdjacentDeepWater" type="integer" default="0"/>
		<Column name="AdjacentTilesAvoidGrass" type="boolean" default="false"/>
		<Column name="MaximumAllowedAdjacentGrass" type="integer" default="99"/>
		<Column name="AdjacentTilesAvoidPlains" type="boolean" default="false"/>
		<Column name="MaximumAllowedAdjacentPlains" type="integer" default="99"/>
		<Column name="AdjacentTilesAvoidDesert" type="boolean" default="false"/>
		<Column name="MaximumAllowedAdjacentDesert" type="integer" default="99"/>
		<Column name="AdjacentTilesAvoidTundra" type="boolean" default="false"/>
		<Column name="MaximumAllowedAdjacentTundra" type="integer" default="99"/>
		<Column name="AdjacentTilesAvoidSnow" type="boolean" default="true"/>
		<Column name="MaximumAllowedAdjacentSnow" type="integer" default="0"/>
		<Column name="AdjacentTilesAvoidShallowWater" type="boolean" default="false"/>
		<Column name="MaximumAllowedAdjacentShallowWater" type="integer" default="99"/>
		<Column name="AdjacentTilesAvoidDeepWater" type="boolean" default="false"/>
		<Column name="MaximumAllowedAdjacentDeepWater" type="integer" default="99"/>

So, AdjacentTilesCareAboutTerrainTypes is still at "false" and overrides the parameters below it. This is why Krakatoa spawns out in the middle of the ocean, because it's not looking for shallow water. It plops down into the ocean, and then once placed, it converts the adjacent tiles to shallow water (coast).

When you look at the logs, it shows the ridiculous amount of candidate plots this wonder has since it's counting all those ocean tiles (over 1,500 on standard maps, while a high number of candidates for a properly working wonder is only around 200).

Also, this wonder spawns on maps quite often and most times wastes a good natural wonder slot that something more useful could've used instead. Also, Krakatoa wastes sea resources when it spawns out in the middle of nowhere.

Here's a potential fix I uploaded on the Steam Workshop (which includes images and data):
http://steamcommunity.com/sharedfiles/filedetails/?id=109008878


This is the code:

Code:
	<Natural_Wonder_Placement>
		<Update>
			<Where NaturalWonderType="FEATURE_VOLCANO"/>
			<Set AdjacentTilesCareAboutTerrainTypes="true"
				 RequiredNumberOfAdjacentShallowWater="4"
				 CoreTileCanBeAnyTerrainType="false"
				 CoreTileCanBeShallowWater="true"
			/>
		</Update>
	</Natural_Wonder_Placement>

Basically, I set AdjacentTilesCareAboutTerrainTypes to what it should be: "true". But, I also added that the core tile must be shallow water (instead of BOTH shallow and deep). This'll help pull it closer to land so players can actually utilize it. If not, it can spawn on the 4th tile from land in the ocean if the coastal distance is maxed out at 3.

Also, I increased RequiredNumberOfAdjacentShallowWater from 1 to 4 so that it doesn't spawn on the tips of any branches of coastal tiles stretching out to the ocean. This keeps it tighter to the land a majority of the time.
 
Is there any way you could post this in the civfanatics downloads area? I have a mac and it seems like actually *downloading* the mods from steam is impossible (or I haven't been able to find out how), but download a zip from civfanatics is no problem.

Sounds like a great bug fix and I'd love to use it!
 
I just feel this topic needs a bump (as somehow this problem still persists) and Jpbar deserves a thanks for the mod fix!
 
Top Bottom