More snow/ice with the Continents maps

jpinard

Martian
Joined
Jan 18, 2002
Messages
760
Location
Enceladus, Saturn
Because I'm a programming neophyte... I'm wondering if anyone else had wanted the "Continents" map option with more chilliness. I don't like the current Ice Age because the map is much smaller than the continents option.

So I have a question to get going.

* Would it be easier for me to edit/add a python script to make Ice Age bigger?

or

* Would it be easier to make an edit to lower the temperature of the Continents random map-option (if this is even possible).

and

* Can I do this in XML instead of Python since I know nothing about Python?
 
You could do this either way and both would be fairly easy and quick in Python.

If you want I could whip up a quick Continents map script for you, unless you want to do it yourself, in which I'll just tell you how. :)
 
low said:
You could do this either way and both would be fairly easy and quick in Python.

If you want I could whip up a quick Continents map script for you, unless you want to do it yourself, in which I'll just tell you how. :)

Would it be difficult to tell me how to do it? If you don't mind, it'd be a great opportunity for me to move beyond XML.
 
No problem. You could acheive this several ways...

The quickest and easiest way to do it would be to edit the "Ice_Age.py" itself.

1. Copy Ice_Age.py located in "C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\PublicMaps" and paste it into your "C:\Documents and Settings\Your Name\My Documents\My Games\Sid Meier's Civilization 4\PublicMaps" folder.

2. Now open up the new "Ice_Age.py" file and just edit the world size. You'll see this:

Code:
def getGridSize(argsList):
	# Override Grid Size function to make shorter than normal.
	# Map widths unchanged. Height reduced (lands lost to polar ice)
	grid_sizes = {
		WorldSizeTypes.WORLDSIZE_DUEL:		(10,4),
		WorldSizeTypes.WORLDSIZE_TINY:		(13,5),
		WorldSizeTypes.WORLDSIZE_SMALL:		(16,7),
		WorldSizeTypes.WORLDSIZE_STANDARD:	(21,9),
		WorldSizeTypes.WORLDSIZE_LARGE:		(26,11),
		WorldSizeTypes.WORLDSIZE_HUGE:		(32,13)
	}

	if (argsList[0] == -1): # (-1,) is passed to function on loads
		return []
	[eWorldSize] = argsList
	return grid_sizes[eWorldSize]

3. Just edit the height for whatever map size you like to play on. For example, change:

"WorldSizeTypes.WORLDSIZE_HUGE: (32,13)"

to

"WorldSizeTypes.WORLDSIZE_HUGE: (32,28)"

4. Save and exit.


The other way would be to edit the "Continents.py" file.

1. Copy Continents.py located in "C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\PublicMaps" and paste it into your "C:\Documents and Settings\Your Name\My Documents\My Games\Sid Meier's Civilization 4\PublicMaps" folder.

2. Now open up the "Ice_Age.py" file in the default "PublicMaps" folder and you'll see this:

Code:
# subclass TerrainGenerator to cool the climate compared to normal.
# Also, desert reduced, plains dramatically increased. Latitudes shifted colder.
class IceAgeTerrainGenerator(CvMapGeneratorUtil.TerrainGenerator):
	def __init__(self, iDesertPercent=20, iPlainsPercent=50, 
	             fSnowLatitude=0.4, fTundraLatitude=0.3,
	             fGrassLatitude=0.0, fDesertBottomLatitude=0.1, 
	             fDesertTopLatitude=0.2, fracXExp=-1, 
	             fracYExp=-1, grain_amount=4):
		
		self.gc = CyGlobalContext()
		self.map = CyMap()

		self.iWidth = self.map.getGridWidth()
		self.iHeight = self.map.getGridHeight()

		self.mapRand = self.gc.getGame().getMapRand()
		self.iFlags = self.map.getMapFractalFlags()

		self.grain_amount = grain_amount + self.gc.getWorldInfo(self.map.getWorldSize()).getTerrainGrainChange()

		self.deserts=CyFractal()
		self.plains=CyFractal()
		self.variation=CyFractal()

		self.iDesertTopPercent = 100
		self.iDesertBottomPercent = max(0,int(100-iDesertPercent))
		self.iPlainsTopPercent = 100
		self.iPlainsBottomPercent = max(0,int(100-iDesertPercent-iPlainsPercent))
		self.iMountainTopPercent = 75
		self.iMountainBottomPercent = 60

		self.fSnowLatitude = fSnowLatitude
		self.fTundraLatitude = fTundraLatitude
		self.fGrassLatitude = fGrassLatitude
		self.fDesertBottomLatitude = fDesertBottomLatitude
		self.fDesertTopLatitude = fDesertTopLatitude

		self.iDesertPercent = iDesertPercent
		self.iPlainsPercent = iPlainsPercent

		self.fracXExp = fracXExp
		self.fracYExp = fracYExp

		self.initFractals()

3. Copy that entire class section and paste it into your new Continents.py file.

4. At the top edit this: "class IceAgeTerrainGenerator"

to this: "class TerrainGenerator"

5. Save and exit.

Those should work. Make sure to select the appropriate map when starting a custom game. ;)
 
Back
Top Bottom