Tectonic Plates

As discussed in my post about worldbuilding keystones, tectonic plates are a core concept that's really important to get right if things like mountain ranges, island chains, and realistic(ish) landmass formations. And if the resulting height map isn't at least kind of believable and follows some semblance of natural processes, nothing else will be.

My approach so far is a little simplistic, but I got to work out some kinks of how the different parts of the app interact with each other during the development, and due to the modular nature of how the app is structured, coming back to this step later on will be very straightforward.

Tectonic plates are pieces of Earth's crust and uppermost mantle.

The theory of plate tectonics describes how these bits of crust have drifted around on the planet for the past three billion years, forming mountains when they crash into each other or trenches when they pull apart. Tectonic plates come in a variety of shapes and sizes, with each plate representing pretty distinct regions of the planet's surface.

Earth's tectonic plates (Wikipedia)

If I wanted to really simulate plate tectonics, I'd have to model the different plates, their velocities, direction, the currents of magma beneath the crust, and how the plates change shape when they collide or sink. I don't really care too much (right now) about recreating the science behind plate tectonics, though it would be interesting to model plate movement and flora/fauna evolution over time. But for the purposes of my app, I don't think it's a crucial component. And like I said earlier, I can always come back to this step and do all that stuff.

I decided to simplify the process into some steps:

  1. Identify tectonic plate "origins" to flood-fill from
  2. Expand the plates from their origins, taking into account a user-defined "jitter" to add randomness
  3. Define a type for each plate (oceanic or continental)
  4. Define a direction (random) for each plate
Assigning the tectonic plates in the app

I've decided not to worry about wrapping my map east-west, mainly because dealing with the voronoi points wrapping/repeating is a huge hassle and I've dealt with that before. Instead, I'm just assigning any tectonic plate that touches the border of the map to be a "deep" plate. This plate type is unique to the app (and not found in real life); the height map will ignore any border between deep plates. The idea is to get a big, flat ocean around a series of continents in the middle of the map. This way I can wrap around later when it comes to pathfinding, wind, climate, etc.

Assigning plate types is straightforward: I want some percent of the area to belong to continental plates, so I first sort the plates from smallest to largest, then assign their type to continental one by one until the total area of continental plates exceeds the goal. I haven't decided what that percent should be yet, but I'll play around with it until I'm happy with it.

It's totally possible for users to create their plates from scratch (well, to place the plate origins and choose the directions/types).

Editing a tectonic plate in the toolbar's plate list

I added a "Quick Start" feature that gets prompted from a popup when entering the step to automatically generate plates from the get-go. I assume most users will just automatically generate plate combinations until they're happy with the result.