So I am trying to figure out a way to reduce the amount of sea (or increase the amount of land) of the pangaea mapscript to make a kind of random USA Continent.
Here is what I have so far in my musings.
I think the ocean is 'controlled' in the parts before the terrain generator.
import CvMapGeneratorUtil
from CvMapGeneratorUtil import MultilayeredFractal
from CvMapGeneratorUtil import HintedWorld
You can't decrease the amount of ocean (I think maps start out as just ocean) so you actually increase the amount of land you want.
What I haven't figured out is where you do that within those files, or whether you do it in the pangea file.
I think it must be in the pangaea file... I think the others are like 'world logic' like a desert doesn't go next to grassland... (or whatever logic it uses)
There are what seem like 3 kinds of 'world' layouts pangaea uses.
class PangaeaHintedWorld:
generateSorensHintedPangaea
generateAndysHintedPangaea
PangaeaMultilayeredFractal
I don't know if these are all part of one script, or are used independently depending on map choices you make or some such..
I have found some 'sort of' mentions to land mass or size in these.
In Soren
In Andy
In Fractal
I just can't figure out what I should what I should fiddle with... also in the fractal bit I am not sure what 'sea' refers too. Where the value of 'sea' is quantified. As it is say 55+sea.
Here is what I have so far in my musings.
I think the ocean is 'controlled' in the parts before the terrain generator.
import CvMapGeneratorUtil
from CvMapGeneratorUtil import MultilayeredFractal
from CvMapGeneratorUtil import HintedWorld
You can't decrease the amount of ocean (I think maps start out as just ocean) so you actually increase the amount of land you want.
What I haven't figured out is where you do that within those files, or whether you do it in the pangea file.
I think it must be in the pangaea file... I think the others are like 'world logic' like a desert doesn't go next to grassland... (or whatever logic it uses)
There are what seem like 3 kinds of 'world' layouts pangaea uses.
class PangaeaHintedWorld:
generateSorensHintedPangaea
generateAndysHintedPangaea
PangaeaMultilayeredFractal
I don't know if these are all part of one script, or are used independently depending on map choices you make or some such..
I have found some 'sort of' mentions to land mass or size in these.
In Soren
Spoiler :
Code:
NiTextOut("Setting Plot Types (Python Pangaea) ...")
global hinted_world
hinted_world = HintedWorld(8,4)
mapRand = CyGlobalContext().getGame().getMapRand()
for y in range(hinted_world.h):
for x in range(hinted_world.w):
if x in (0, hinted_world.w-1) or y in (0, hinted_world.h-1):
hinted_world.setValue(x,y,0)
else:
hinted_world.setValue(x,y,200 + mapRand.get(55, "Plot Types - Pangaea PYTHON"))
In Andy
Spoiler :
Code:
def generateAndysHintedPangaea(self):
NiTextOut("Setting Plot Types (Python Pangaea Hinted) ...")
global hinted_world
hinted_world = HintedWorld(16,8)
mapRand = CyGlobalContext().getGame().getMapRand()
numBlocks = hinted_world.w * hinted_world.h
numBlocksLand = int(numBlocks*0.33)
cont = hinted_world.addContinent(numBlocksLand,mapRand.get(5, "Generate Plot Types PYTHON")+4,mapRand.get(3, "Generate Plot Types PYTHON")+2)
if not cont:
# Couldn't create continent! Reverting to Soren's Hinted Pangaea
return self.generateSorensHintedPangaea()
else:
for x in range(hinted_world.w):
for y in (0, hinted_world.h - 1):
hinted_world.setValue(x,y, 1) # force ocean at poles
hinted_world.buildAllContinents()
return hinted_world.generatePlotTypes(shift_plot_types=True)
In Fractal
Spoiler :
Code:
# The following regions are specific to Pangaea.py
mainWestLon = 0.2
mainEastLon = 0.8
mainSouthLat = 0.2
mainNorthLat = 0.8
subcontinentDimension = 0.4
bSouthwardShift = False
Then This.....
# Generate the main land mass, first pass (to vary shape).
mainWestX = int(self.iW * mainWestLon)
mainEastX = int(self.iW * mainEastLon)
mainNorthY = int(self.iH * mainNorthLat)
mainSouthY = int(self.iH * mainSouthLat)
mainWidth = mainEastX - mainWestX + 1
mainHeight = mainNorthY - mainSouthY + 1
mainWater = 55+sea
self.generatePlotsInRegion(mainWater,
mainWidth, mainHeight,
mainWestX, mainSouthY,
2, grain,
self.iHorzFlags, self.iTerrainFlags,
-1, -1,
True, 15,
2, False,
False
)
# Second pass (to ensure cohesion).
second_layerHeight = mainHeight/2
second_layerWestX = mainWestX + mainWidth/10
second_layerEastX = mainEastX - mainWidth/10
second_layerWidth = second_layerEastX - second_layerWestX + 1
second_layerNorthY = mainNorthY - mainHeight/4
second_layerSouthY = mainSouthY + mainHeight/4
second_layerWater = 60+sea
self.generatePlotsInRegion(second_layerWater,
second_layerWidth, second_layerHeight,
second_layerWestX, second_layerSouthY,
1, grain,
self.iHorzFlags, self.iTerrainFlags,
-1, -1,
True, 15,
2, False,
False
)
I just can't figure out what I should what I should fiddle with... also in the fractal bit I am not sure what 'sea' refers too. Where the value of 'sea' is quantified. As it is say 55+sea.