[Map Script] Continental Drift Map Script

axatin

King
Joined
Jul 24, 2022
Messages
630
This map script is a reworked version of Tectonic by @Haftetavenscrap and @N.Core. Like the original map, it is based on simulating tectonic plates and their movement. The worlds generated by it are similar to a mix of Continents, Fractal and Archipelago maps. Many settings are available to customize the map.


Key changes compared to Tectonic:
  • Several changes were made to reduce the randomness of the map generation. In particular, the amount of land generated is now much less random
  • The total amount of land is reduced. When standard settings are used the number of land tiles is somewhere between the typical values for Continents and Fractal maps and those for Communitas
  • An option 'Land Cohesion' was added: This option controls how much continents cluster, i.e. whether the maps tend to have several smaller continents or few larger ones
  • An option "Ocean Rifts" was added. If enabled, the maps are guaranteed to have at least two landmasses separated by deep ocean rifts, making it necessary to be able to cross deep ocean to meet all civs
  • Reduced amount of land generated in polar regions
  • Increased the number of atolls and lakes
Spoiler Example Maps (Standard size, all map settings on the default value) :

Screenshot (1451).png

Screenshot (1452).png

Screenshot (1454).png

Screenshot (1455).png


Spoiler Example Maps (Standard size, all settings on "Random") :

Screenshot (1459).png

Screenshot (1460).png



Screenshot (1463).png

Screenshot (1464).png

Screenshot (1467).png

Screenshot (1468).png

Screenshot (1461).png

Screenshot (1462).png




Thanks to @N.Core for the permission to modify the map!

Version 2:
  • Fixed a bug in river generation
Version 3:
  • Fixed the map script not working on versions below 5.0
 
Last edited:
For those liking massive maps, you can open Continental_Drift.lua with notepad, find those lines and change huge size accordingly
Code:
    local worldsizes = {
            [GameInfo.Worlds.WORLDSIZE_DUEL.ID] = {44, 26},
            [GameInfo.Worlds.WORLDSIZE_TINY.ID] = {60, 40},
            [GameInfo.Worlds.WORLDSIZE_SMALL.ID] = {72, 46},
            [GameInfo.Worlds.WORLDSIZE_STANDARD.ID] = {88, 58},
            [GameInfo.Worlds.WORLDSIZE_LARGE.ID] = {114, 70},
            [GameInfo.Worlds.WORLDSIZE_HUGE.ID] = {166, 104} -- original {140, 88}
166x104 is Giant Earth size but with original map proportions and normal size setting.

EDIT: it is advised to raise also the land percentage (line 668) by at least a 10%:
Code:
local landSize = 0.35 -- original: 0.25
 
Last edited:
Holy mountains what's with that strip in the middle?
There are many mountain ridges on the map, so the plate motion setting must be "ramming speed". The strip in the middle seems to be two fractal/island plates that collide and that happen to have water at the boundaries.
 
Very good looking maps! Are the starting locations assigned the standard way by VP or is that modified too?

With other mapscripts I've struggled with uneven starting placement when there are small continents or big islands close to each other separated by only coastal waters. Sometimes the algorithm treats them as different landmasses and when two civs don't fit on one minicontinent, both are left empty and all civs are crammed together on bigger land. This gives huge advantage to those situated close to empty land and disadvantage to those in the middle of neighbors.

Another question: can an ocean be horizontal to add randomness?
 
Very good looking maps! Are the starting locations assigned the standard way by VP or is that modified too?

With other mapscripts I've struggled with uneven starting placement when there are small continents or big islands close to each other separated by only coastal waters. Sometimes the algorithm treats them as different landmasses and when two civs don't fit on one minicontinent, both are left empty and all civs are crammed together on bigger land. This gives huge advantage to those situated close to empty land and disadvantage to those in the middle of neighbors.

Another question: can an ocean be horizontal to add randomness?
The starting location assignment is unchanged. Azum said he has some ideas on how the VP algorithm could be improved.

The oceans could be made horizonal, but that would heavily influence the climate zones present on the map, I don't think that's desirable. And the horizontal axis of the map is longer than the vertical one, so horizontal ocean rifts would reduce the space available for land tiles.
 
The oceans could be made horizonal, but that would heavily influence the climate zones present on the map, I don't think that's desirable. And the horizontal axis of the map is longer than the vertical one, so horizontal ocean rifts would reduce the space available for land tiles.
Orientation doesn't matter, as long as there are 2+ continents at the end.
 
Does this have to be installed as a mod or can I just put the lua file into the Assets/Maps folder? I'm currently using a modpack so can't use mods as well.
 
You can put it into Assets/Maps, it'll work fine, but note that the text of some of the map options will be missing ("TXT_KEY_MAP_OPTION_FRAGMENTED" will be displayed instead of "Fragmented").
 
Version 2 released, fixing a bug in river generation (rivers sometimes ended on land). The link in the OP has been updated.
 
The mapscript doesn't work for me, when the game loads everything is covered by fog, the minimap looks as if the map is 100% water, and clicking to start the game immediately pops up the defeat screen.

Happens with default map settings, different map sizes, I tried putting the script in the documents folder instead of loading it as a mod, tried disabling every mod except this one + VP, nothing worked.
 
Version 2 was bugged, it used a function that doesn't exist yet in 4.22 and that will only be available in the upcoming version 5.0. Version 3 of the map script is now out, which works again on 4.22. Sorry for that
 
Last edited:
This mapscript is great. I do have issues with the mountain generation patterns though. The mountains spawning next to water tiles seems to happen so often, especially with ramming speed plates. However, when not doing ramming speed, mountains are few and far between. There doesn't seem to be a way to get an ideal balance of mountains and hills without making whole coastlines unusable due to the mountain ranges 'sticking' to coastal tiles. Is there a tweak we can make that prevents mountains from sticking to coast except for Rock of Gibraltar?
 
Back
Top Bottom