## Thursday, September 29, 2016

### Colorful continents

I took a break from finishing the Planets program up to play a bit with a terrestrial land mass generation approach very loosely inspired by plate tectonics.  There are more complicated, simulation-driven approaches that more accurately simulate this type of of thing, but they can take minutes to hours to run.  There's a faster approach that works quickly enough, but has what seems to me less believable continent shapes, and another slow one that often ends up with even poorer results.

Here's the approach I'm going to try.  I only got through step 3 today.

1. Generate an initial land mass.  In the example photo below, the initial land mass was simply a circle.  More interesting results could be obtained using something like the polygon map generator I've mentioned before, and I'll probably go there in the future.
2. Assign land to plates via a probablistic growth algorithm, but just covering the land mass, not the wider world.  All these plates will be considered continental, not oceanic, plates.
3. Shift the eastmost and westmost plates to east and west.
4. Shift the remaining plates either to random unoccupied parts of the map, or collide them with the already-shifted plates. (Yes, so far this is rather more like the original continental drift theory than plate tectonics.)
5. Break the unoccupied space on the map (i.e. the oceans) into plates, which will be considered oceanic.
6. Generate a list of all plates vs. all other plates, with an additional floating point number in the range -1..1 being probablistically generated for each combination.  This represents the force of collision or spreading between the two plates.
7. In the vicinity of plate borders, use the number from above to determine if we're creating a rift or mountains, and the degree of depth or height involved.
8. The results from 7 could then be used to directly generate a basic elevation map, possible with some fractal component added in for additional noise.  Alternately, the height/depth values of each cell and the adjacent cells could be used to control a mixture of noise from different distributions of noise. So if it hills in half the adjacent cells and mountains in this cell and mountains in the other half of the adjacent cells, we'd consider it 2/3 mountains and 1/3 hills, and mix noise from hill distribution and a mountain distribution.  Which sounds very confusing, so I will consider a fuller explanation if I wander down that path later.

 A round central land mass was split into three "continents" of which two were shifted.  This is the result of steps 1-3.

I can skip steps 3-4 to generate a supercontinent like Pangea.  I can use fractals if I simply want a whole bunch of small islands, or if I want mostly land with small bodies of water interspersed, like that world from Star Wars 7. Alternately, I could use the results up through step 4 as the input for that fast planet generation approach mentioned earlier.  We'll see when I get a chance to experiment some more.