Terra world with random starting locations

saarworres

Chieftain
Joined
Nov 9, 2005
Messages
4
Location
Germany
Hello

First:
I'm german, and I use my english not as often as I should. :blush:
So the mass of my english skills are based on my school grammar long time ago. :rolleyes:

Ok let' go on with the important stuff.

I want to use the terra map without the restrictions of the player starting positions (starting positions all over the world instead of all player starts on the biggest landmass). Because the editing the scale of the Continent or Custom continent in the XML-Files generate mostly a very weird worlds (great lakes and very large areas of something i would call fjords. Mostly it looks like a rotten pangea. :groucho:
So you cannot sure that the coastline you have found is a coastline to open water or to a fjord or megalake. Apart from the lucky times you starts on one of the many small peninsulas in the fjord area) .
I had the Idea that the terra map with some upscale seems to fit all the things i want. Only the starting positions are an barrier.

Therefore I take a closer look at the „terra.py“ file in the publicmaps folder and have some questions.

Main question:
The following lines seems to be the function to control the starting positions of the civ's. At least, to me it seems to be so.

Code:
def findStartingPlot(argsList):
	[playerID] = argsList

	def isValid(playerID, x, y):
		map = CyMap()
		pPlot = map.plot(x, y)
		
		if (pPlot.getArea() != map.findBiggestArea(False).getID()):
			return False

		return True
	
	return CvMapGeneratorUtil.findStartingPlot(playerID, isValid)
I have some experience with different other scripting – languages but not with python.
But if I'm right, the following line is the key-sentence:


Code:
if (pPlot.getArea() != map.findBiggestArea(False).getID()):
			return False

		return True
	
	return CvMapGeneratorUtil.findStartingPlot(playerID, isValid)
the meaning of these lines seems the following to me:

Take the supposed starting position and check if the position is on the biggest landmass.
If not generate a new position and check again. If it does, go on with the check of distance between the Civ starting-positions.

So it should be enough to change the return to true in every case and the positions are random???
As simple as ist seems to be??

And so on:
I had edited my CIV4WorldInfo.xml to gain the gigantic map avaiable. But the values I've added seem to contradict the values hardcoded in the py-File. Which of these values had the priority?
The py-values first instead the xml-values? Or the opposite? Or will the values be reckoned?
My thoughts go to the first variant but I'm not sure. At least, do I need an new line in the py-file for the gigantic-world-size entry's in the other files? Or is this equal? In fact it seems to me that in this case the vals of the xml-files will be the important for the game and the missfits the prerequisite of an terra-map seed.

If anyone could answer one of these questions it will help me a lot. Thanks.
 
You are correct about this statement:

if (pPlot.getArea() != map.findBiggestArea(False).getID()):
return False


Changing the "False" to "True" would work. I just removed the whole thing which also works.

That will make the starting locations random. (I think)

Then there is another line above that which says something like :

startingDistanceModifier = -20

you could experiment with that number to make the civs even farther apart.


The values for the world size in the python file have precedence over the values in the XML file. AS you can see, the values in the Terra.py file are making the default world sizes larger.


I agree that the Terra map produces the best worlds. The Continents map is very primitive as can be seen by the lack of code in its python file.
 
One more thing I have to add:

The terra map produces an "Old World" and a "New World". By default all the civs start in the Old World. The New World has Barbarian Cities.

So if you make the starting positions random then some civs will start in the New World and will be plagued by Barbarians. This is very annoying if you are one of those civs. I am working on removing the Barbarian cities. But I want to make sure that random barbarians still appear once in a while.
 
Hey Thanks.
That was quick Help. :goodjob:

The babariens are a problem, but somthing that seems solvable.
Nothing that resists an determined noob like me. :crazyeye:

The removal of the function works too? Thats good. I've thought this generate an error because after the check of the distance between the player starting locations
it will refer back.

Only one question will stay if I understand you correct.
What will happen if I choose gigantic as the world size without an congruent entry in the python file? The values in the XML will make the job and the world will be as weird generated as the modified continents because this misfits the seed? Or ist this equal?
 
If you have created an extra map size (Gigantic) then I think you will need to add a new line to the terra.py file that in the section where it modifies the default map sizes. I don't have the file available at the moment so I cannot tell you exactly what to do.
 
No. I've tested it and if you add an new entry for Gigantic, this will have no contact to the Seed and what you generate will become very ugly. :D

Somthing like a World-Carpet with river-pattern. No Oceans and tiny Lakes.
So I decided to modify the entry for Huge sized worlds. This works very well.
The babarians seems not a too big problem. The storm will come, but if he does, he is not as awesome as I thought.
 
Back
Top Bottom