1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[Map Script] Tectonics

Discussion in 'Civ4 - Map Scripts' started by LDiCesare, Dec 23, 2005.

  1. 4Dingo4

    4Dingo4 Chieftain

    Joined:
    Nov 30, 2008
    Messages:
    7
    LDiCesare I recently purchased BTS and your script ROCKS! :goodjob:

    I have a simple question and I hope you can help me out.

    I would like to turn Earth 60% water into Earth 50% water. What file(s) do I need to open and what specific text do I need to alter? I'm sure it's easy but I haven't scripted on CIV before.

    Thanks a ton!!!
     
  2. tejon

    tejon Chieftain

    Joined:
    Nov 21, 2008
    Messages:
    32
    Hum. I did some more extensive testing using various settings, and found that all maps other than Mediterranean and Terra could have ice. Mediterranean is of course not supposed to. It doesn't look like Mediterranean's climate generator is being applied to Terra, because then I should see the world behaving as if the south pole were the equator, right? World size also appears irrelevant.

    The funky part is that when I tested the various climate settings they worked as expected, except that No Ice caused there to be no tundra! Maybe there's a conversion being applied twice? I couldn't find any obvious places this could happen, but again, I don't know Python and my generic codegrokking skills don't tell me what the Civ engine is doing with it all. ;)


    Are you talking about a graphical artifact, or straight lines in the terrain transitions? If the former, I'm definitely seeing nothing of the sort. If the latter, I haven't really noticed it, but I can't say for sure.
     
  3. LDiCesare

    LDiCesare Chieftain

    Joined:
    Dec 22, 2005
    Messages:
    2,612
    Location:
    France
    4Dingo4:
    You must edit tectonics.py in publicmaps. Knowing python will help. Depending on your skills you can either add an option or tweak an existing one.
    The 70%, 60% etc. scripts change the number of land and sea plates. The formulas differ based on map size and number of players, but the idea is to pick for instance the 60% settings and replace the number of sea plates so it's equal to the number of land plates (maybe +1 because there tends to be more land than sea due to sea plates collisions).

    tejon:
    I haven't tested the No Ice for a while, but I think it changes tundra to grass or plains and ice to tundra. So if you already see little or no ice, you'll see little or no tundra.
    Terra will often lack ice because there's not land enough north or south for it to happen. Or that's isolated small islands, and they tend to get enough wind/rain to be tundra at worst.
     
  4. 4Dingo4

    4Dingo4 Chieftain

    Joined:
    Nov 30, 2008
    Messages:
    7
    Awesome, then I've got three super easy questions.

    You mentioned +1 but what number should I increase by 1 to get earth/water to approximately 50% each?

    elif (userInputLandmass == 1): # "Earthlike (60% water)"
    numContinents = 1 + numPlayers*2
    numSeaPlates = numPlayers*3 - 1

    Can I use notepad to edit this code or will that screw it up?
    Is that all that I have to edit and I'm ready to play?

    T H A N K S! :crazyeye:
     
  5. LDiCesare

    LDiCesare Chieftain

    Joined:
    Dec 22, 2005
    Messages:
    2,612
    Location:
    France
    Do something like this:
    elif (userInputLandmass == 1): # "Earthlike (60% water)"
    numContinents = 1 + numPlayers*2
    numSeaPlates = 2 + numPlayers*2
    You can try with 1 + numPlayers*2 instead if you play on small/tiny maps.
     
  6. 4Dingo4

    4Dingo4 Chieftain

    Joined:
    Nov 30, 2008
    Messages:
    7
    You rock LDICesare!

    BTW, I do play on tiny maps. My favorite so far is Lakes, tiny map, 18 civs. Each civ usually gets 3 cities and all nations are really close to each other. This puts a lot of action into the early game. Plus I don't enjoy managing 10 cities right near the beginning.

    Thanks again for making such an awesome script!:goodjob:
     
  7. 4Dingo4

    4Dingo4 Chieftain

    Joined:
    Nov 30, 2008
    Messages:
    7
    I've tried a bunch of options and this is the one that seems to make the nicest looking 50/50 maps.

    elif (userInputLandmass == 1): # "Earthlike (60% water)"
    numContinents = 1 + numPlayers*3
    numSeaPlates = 2 + numPlayers*2
     
  8. Airefuego

    Airefuego Chieftain

    Joined:
    Aug 16, 2007
    Messages:
    704
    Location:
    Australia / Chile
    Apologies for such a basic question but:

    is the 'Tectonics' map script discussed in this thread a different script to the 'Tectonics' that is a map type in BTS? (I'm running 3.17 with Solver's patch)

    or did firaxis make LDiCesare's brilliant script part of BTS? :)

    thanks
     
  9. MetalMilitia-

    MetalMilitia- Chieftain

    Joined:
    Nov 22, 2004
    Messages:
    132
    Nice script, i especially like the "lakes" maps, those are just the thing ihve looked for.

    Here is the thing, there is too much plains, i would much rather have the regular climate zones. Also id like a bit less land. Anyway i can change that in the .py?
     
  10. LDiCesare

    LDiCesare Chieftain

    Joined:
    Dec 22, 2005
    Messages:
    2,612
    Location:
    France
    To get the regular climate zones, you can just remove the generateTerrainTypes method.
    To change the land amount, you have to tweak the number of land vs. sea plates. For lakes, the setting is:
    numContinents = 1 + numPlayers*3
    numSeaPlates = numPlayers - 1
    So you should change something like 1 + numPlayers*2 or whatever you find best.
     
  11. Onionsoilder

    Onionsoilder Reaver

    Joined:
    Mar 19, 2007
    Messages:
    3,173
    I have a two questions:

    1) Why does Tectonics like to generate 'lake-rivers'. Basically, when there is a nice river going that abruptly ends and is replaced by a fresh water lake, as shown below:



    Personally I would like it more if the lake was just another land tile and the river continued up to the hill one tile above the lake. Is there any way to modify the Tectonics script to do that?

    2) Making Tectonics generate more distinct continents. In most of my games I end up with 2 or 3 very large continents that are so close, often galleys can bridge the gap between the continents. I play on Huge maps mostly, so this gets annoying as it almost seems like Pangea. Is there a way to break up the 2-3 land masses into 4-5 land masses, then spread them out more so contact doesn't occur till Caravels come into play?
     
  12. Airefuego

    Airefuego Chieftain

    Joined:
    Aug 16, 2007
    Messages:
    704
    Location:
    Australia / Chile
    Bumped - can anyone answer? :)

    thanks
     
  13. LDiCesare

    LDiCesare Chieftain

    Joined:
    Dec 22, 2005
    Messages:
    2,612
    Location:
    France
    Because the base game likes it. It's not tectonics-specific. It's part of the standard code to "beautify" a starting spot by adding fresh water access.

    You'd have to tweak the starting plate seeds to do that, but you'd have to know how many continents you want, or otherwise make an explicit random roll for determining the number of continents, which may cause issues with big islands or even hotspots.
    You could also do a postprocessing to widen the seas, but it would also work only if there are already big enough distinct landmasses.
    Any way, that's a bit of python that would have to be coded.
     
  14. LDiCesare

    LDiCesare Chieftain

    Joined:
    Dec 22, 2005
    Messages:
    2,612
    Location:
    France
    Yes, it's the same. I uploaded a new version since the patch, so if you download the latest version here it's slightly better than the one coming in the official patch.
     
  15. Airefuego

    Airefuego Chieftain

    Joined:
    Aug 16, 2007
    Messages:
    704
    Location:
    Australia / Chile
    ok thanks :goodjob:
     
  16. Onionsoilder

    Onionsoilder Reaver

    Joined:
    Mar 19, 2007
    Messages:
    3,173
    I was thinking 3-7 different continents. If I had to pick, probably 4.

    Could you tell me what part of Tectonics.py I would have to modify to do this? I have some limited python experience, so I should be able to do it myself, but I peeked in the file and the sheer amount of python is to much to sort through, let alone figure out what part I need to modify.
     
  17. LDiCesare

    LDiCesare Chieftain

    Joined:
    Dec 22, 2005
    Messages:
    2,612
    Location:
    France
    The number of seeds is determined in the generatePlotType function: numContinents gives the number of land plates, so you could make it a rand of 3-7, and numSeaPlates something depending on how much water you want (probably twice as many as the land plates). The downside of this approach is you'll probably get too much flatlands, you may want more than one land plate per continent.

    Next, you'd have to set the position of the plates in the sowSeeds method.
    You want the land plates to be seeded at different positions (make sure distance with previous land is > XXX, depending on map size), and you could set some of the sea plates to be in-between the land plates.
    You can get widely varying results depending on how you set up this. For instance if you say each land plate starts at:
    x = (platenumber * mapSize/N) % mapSize + some random noise and y = random,
    you'll get evenly distributed landmasses along the x axis.
    Putting sea plates at: x = (platenumber * mapSize/N + mapSize/2N) % mapSize + some random noise and y = random
    You'd be more or less sure to get sea plates in-between N continents (more or less because if you're unlucky and all y of land plates are 0 and all y of sea plates are mapHeight, that doesn't cut it, so it needs some refininf to find the good ranges). This would be the easiest way of achieving what you want, the number of plates could be bigger than N so you don't get too flat lands, but it'd be a bit too predictable to my taste.
     
  18. Neomega

    Neomega Chieftain

    Joined:
    Feb 9, 2002
    Messages:
    11,261
    This has ended up being the best map script I have tried for FFH2. It makes the best mountain ranges, and the continent shapes aren't too bad either. I just scrapped a perfect world game, because even though the map was interesting, it just was too disjointed. This one allows analogous earthlike formations.

    My only complaint is it is awfully dry. If you choose wet terrain, then there will be no deserts, but it is not really a choice, since without wet, many civs will be nerfed badly and never get off the ground. So I am forced to choose either a map with no desert, or a map with no rivers. Is there a happy medium somehow?
     
  19. Airefuego

    Airefuego Chieftain

    Joined:
    Aug 16, 2007
    Messages:
    704
    Location:
    Australia / Chile
    Yes it's great isn't it! :king:

    But it’s true that it’s dry.

    1. I suppose this is realistic – Earth has some big broad dry patches too. (Guess why Mali is no longer a world power!) But it also can lead to very interesting games because it means your expansion pattern needs to be even more strategic to take account of terrain, rather than just basically expanding in all directions. For example, last game I had a really awesome massive grassland/food start, but basically no production at all (except whips). Two hills total among three cities! So I had to go far afield to seek out some hills. It led to a very interesting and different early game.

    The downside is that often you do start in a tough location with some really big expanses of bad terrain, which require extra skill and patience to play (or a restart if you can’t be bothered!).

    2. Playing wet tectonic does lead to some great maps with good rivers and some truly vast expanses of grassland (sometimes under jungle) which suits my favourite cottage spam cities perfectly. But yes the lack of desert is a shame. I think it also means no floodplains??
     
  20. LDiCesare

    LDiCesare Chieftain

    Joined:
    Dec 22, 2005
    Messages:
    2,612
    Location:
    France
    By too arid, you mean too few rivers?
    You can edit the script to get more. There are 2 rivers generators inside, one which is not used because it's really poor and the other one which is too complex...
    Anyway just edit the seedRivers method of the riversFromSea class (lines 1387 and following):
    Code:
    	def seedRivers(self):
    		climate = CyMap().getCustomMapOption(1)
    		if (climate == 0):                 # Arid
    			divider = 4
    		elif (climate == 1):               # Normal
    			divider = 2
    		elif (climate == 2):               # Wet
    			divider = 1
    		elif (climate == 3):               # No ice
    			divider = 2
    		maxNumber = (self.width + self.height) / divider
    You can lower the divider (Normal -> 1 means twice as many rivers) or change maxNumber to something like
    Code:
    		maxNumber = (self.width + self.height) * WHATEVER_YOU_LIKE / divider
    If you want the rivers to be longer, you can change the minRiverLength variable (increase it) and the straightThreshold variable (lower it, at least 1) (around lines 1380-1385)
     

Share This Page