How to control where cities can be founded

TofuSojo

Chieftain
Joined
Sep 28, 2014
Messages
41
Location
Orlando, FL
OK, what I'm trying to figure out how to do is prevent cities from being allowed to be founded in Snow & Tundra Tiles (I don't put Forests on my Tundra, in my maps) and Desert Tiles unless there is an Oasis or Flood Plains present.

I've looked through the gameplay XMLs and Luas and the UI Luas and don't see anything that controls where cities can be built. I worry that it is in the base C++ code and I don't want to make a DLL mod. There have to be rules though, since cities can't normally be built on Mountains (remember that Carthage can move their settlers onto them, so they aren't always impassable).

Does anyone know where in the files this is controlled?


If it is indeed in the base C++ code, I was thinking a work-around might be to create an invisible feature for the tiles I want (this is for custom maps I'll be making, but I'ld love it to be for standard too) on which cities can't be founded if a feature can be given any tag that prevents city founding.

Any ideas how to do that or other suggestions?
 
In the Terrains table, there are columns called Found, FoundCoast and FoundFreshWater. They can be used to control where cities can be founded.

So to achieve what you need, you should use the following XML code (untested, but should work unless I made a typo):

Code:
<GameData>
	<Terrains>
		<Update>
			<Where Type="TERRAIN_SNOW"/>
			<Set Found="0"/>
		</Update>
		<Update>
			<Where Type="TERRAIN_TUNDRA"/>
			<Set Found="0"/>
		</Update>
		<Update>
			<Where Type="TERRAIN_DESERT"/>
			<Set Found="0" FoundFreshWater="1"/>
		</Update>
	</Terrains>
</GameData>

It will allow founding cities on desert on every tile with fresh water, not only next to oasis or on flood plains (also next to a river without flood plains, or next to a lake). Doing it exactly as you described would require making a feature that prevents city founding as you suggested (using the NoCity tag), and placing it on every desert tile with fresh water that you don't want to be used for founding cities.
 
And the first xml I looked in too...I don't know how I missed that, but thank you so much! I will try some things out to see if I an get the results I want.
 
Back
Top Bottom