davidlallen
Deity
I have just started modifying mapscripts. I am aiming for a particular feature distribution: very low percentage of grassland and forest. This is for a post-apocalyptic desert war feel.
The operative part of the python is this (assume the indentation is right)
def generateTerrainTypes():
terraingen = TerrainGenerator(iDesertPercent=50, iPlainsPercent=50)
terrainTypes = terraingen.generateTerrain()
return terrainTypes
def addFeatures():
featuregen = FeatureGenerator(iJunglePercent=10, iForestPercent=20)
featuregen.addFeatures()
def normalizeAddFoodBonuses():
"Disable default routine"
def normalizeAddGoodTerrain():
"Disable default routine"
def normalizeAddExtras():
"Disable default routine"
But I still get grassland, and I still get a *bunch* of forest.
I think the grassland is due to some fixup done by the civilization placer. I have overridden normalizeAddFoodBonus and normalizeAddGoodTerrain to be empty, but still each starting civ has a few squares of grassland around it. Once I get the map working, I will allow a little bit of grassland, but first I want to understand where it is coming from.
Of course the forest generation depends on a fractal, so it is a little random and hard to measure exactly. But, I have tried a few values for iForestPercent. When I try 0, I get a huge amount of forest, as if it has decided to ignore the threshold altogether. Same thing for 10. At 20, it "seems" like there is less forest than the default, but still way more than 20%. So the variable seems to have some effect, just not the effect I want.
I'd like to get no grassland to prove I understand where it's coming from, and only a small amount of forest. Any suggestions?
EDIT: added script and example output in attachment. Put the map script into My Games\Beyond the Sword\Public Maps; select "Fury_Road" in the map list when you start a game.
The operative part of the python is this (assume the indentation is right)
def generateTerrainTypes():
terraingen = TerrainGenerator(iDesertPercent=50, iPlainsPercent=50)
terrainTypes = terraingen.generateTerrain()
return terrainTypes
def addFeatures():
featuregen = FeatureGenerator(iJunglePercent=10, iForestPercent=20)
featuregen.addFeatures()
def normalizeAddFoodBonuses():
"Disable default routine"
def normalizeAddGoodTerrain():
"Disable default routine"
def normalizeAddExtras():
"Disable default routine"
But I still get grassland, and I still get a *bunch* of forest.
I think the grassland is due to some fixup done by the civilization placer. I have overridden normalizeAddFoodBonus and normalizeAddGoodTerrain to be empty, but still each starting civ has a few squares of grassland around it. Once I get the map working, I will allow a little bit of grassland, but first I want to understand where it is coming from.
Of course the forest generation depends on a fractal, so it is a little random and hard to measure exactly. But, I have tried a few values for iForestPercent. When I try 0, I get a huge amount of forest, as if it has decided to ignore the threshold altogether. Same thing for 10. At 20, it "seems" like there is less forest than the default, but still way more than 20%. So the variable seems to have some effect, just not the effect I want.
I'd like to get no grassland to prove I understand where it's coming from, and only a small amount of forest. Any suggestions?
EDIT: added script and example output in attachment. Put the map script into My Games\Beyond the Sword\Public Maps; select "Fury_Road" in the map list when you start a game.