UNITY & C#
EXPERT DEVELOPER

Plate Tectonics Simulation on a Planet

By Eduardo Martinelli | April 18, 2025

In this devlog, we are introduced to the Plate Tectonics algorithm, which is the base concept for this project, and how it was transitioning it from two to three dimensions.

What we'll cover:

  • Transitioning from a bounded 2D world to an unbounded 3D world
  • What emergent phenomena is created by this algorithm by default
  • Architecting the project to avoid future headaches

Introduction

Sid Meier's Civilization has been my most played game series of all time. It is responsible for my slightly above average performance in history trivia and my love for 4x and Grand Strategy game genres. The one thing that did break my immersion though was how static the world feels in the game. The lack of dynamism and grounding to reality really bothered a hardcore player like myself and I could never stop thinking about the idea of making a Civilization-like game that played through a larger span of time on a planet that actually changed, like our home planet in real life does.

I have this vision of a living planet which players can alter, terraform, or destroy. A planet that served the initial role of the vengeful, merciless old testament gods and gradually gets tamed by its own creation, modified, exploited, cultivated, shared and left behind.

So today we are getting started on this idea.

We are getting an old plate tectonics algorithm I implemented a long time ago. The good thing about this piece of software is that I built it with the intention of having it work in any node graph. Meaning that it should work in any connected grid, arrays, dictionaries, you name it, in any dimensions. This is how it looked back then:

Initially, my simulation was implemented on a 2D plane, which inherently introduced artificial boundaries and constraints as values on the edges of the plane needed to be handled with care. To better capture the complexity of real-world geology, I wanted to transition to a fully 3D spherical model. Keeping it brief, these are the steps I took initially:

  1. Implement a icosahedron sphere point generator. This point generator provides me with a set of points evenly distributed around the sphere, but more importantly, it provides the neighbors of each point as well. This is crucial because as I mentioned, my plate tectonics algorithm works exclusively on graph structures.
  2. Create a "Tile" unit that can draw a polygon from a center point and a few surrounding points, to make the visual for the hexagons and pentagons of the icosahedron sphere.
  3. Instantiate a tile for each point in the sphere and then use the plate tectonics output as a heightmap to deform these tiles.

The change from 2D to 3D removed the artificial edges and actually simplified edge-case handling, enhancing both realism and functionality, surprisingly. And it looked magical right from the get-go:

Emergent Geological Phenomena

A particularly exciting aspect of this project is its ability to simulate planetary deformation interactively. The planet is divided into distinct tectonic plates, each assigned specific densities that determine their initial elevations. Velocities are then applied to these plates, and the simulation is allowed to run over specified time frames, realistically modeling the shifting and reshaping of the planet’s surface. Moreover, the simulation supports interactive events, such as comet impacts, which cause craters and further deform the landscape naturally; creation of islands and plateaus due to magma flow and cooling on the surface. All without relying on traditional noise algorithms. For example, if a cell is moving towards a slower cell, they will collide. The dense cells will go down, and the lighter cells will go up. In geology this would be described as a convergent boundary.

This simple but effective system is so enticing to me because it generates natural geological formations out of the box. The resulting phenomena are convergent, divergent and transformational boundaries. And from these you can easily derive fun things such as:

  • Volcanoes: Emerging at convergent boundaries where one plate subducts beneath another.
  • Rift Valleys: Forming at divergent boundaries as plates move apart.
  • Earthquakes: Resulting from stress and friction at transform boundaries.
  • Mountain Ranges: Developing from the collision and compression of tectonic plates.

These dynamic elements enrich the simulation and create a world that truly evolves and changes over time. With additional systems layered onto the plate tectonics simulation it becomes the base for much more complex simulated systems such as: wind; water; temperature; humidity simulations.

Performance Optimization and Code Architecture

Optimizing this code was not an easy task and has been crucial for the idea to even come alive. To achieve this some things have to be true:

  • Selective Tile Updates: Only affected tiles are recalculated, minimizing computational overhead.
  • Neighbor Awareness: Updated tiles identify neighboring tiles that require subsequent updates, maintaining accuracy and consistency.

Because of the large scope of the project my approach adheres strictly to the SOLID principles of software design, a practice I’ve embraced with the .NET C# framework and the Model-View-Controller (MVC) pattern. This adherence ensures that my project remains clean, scalable, and maintainable, and that I can go back to it without feeling completely lost from time to time.

Another important aspect for the maintainability of the project is that the simulation separates data processing from visualization:

  • Management: The classic Unity Manager script. Manages the Data and View components so developers have a fine-grain control over data processing, generation and visualization.
  • Data Map: Runs simulation logic, calculations, and save data states.
  • Data View: Oversees the graphical representation of planetary changes and user interactions. Do not record, save nor modify any data to save runtime memory.

This division allows for asynchronous data handling and smooth visual updates, significantly improving the responsiveness and overall user experience.

Algorithm structure following SOLID principles|525

For Now

Embedding realistic plate tectonics within a spherical 3D model immediately feels rewarding and intentional because that is how the real world works. It has potential for a more immersive and dynamic gaming experience than the regular strategy game static map. It addresses an old pain of mine regarding how boring some strategy game worlds feel and I really believe that it will be the direction many games will take in the future. Have I mentioned that this felt easier to implement than a bounded 2D world?

What's Next

It is great that we can immediately see the geography of our planet, its mountains, rifts and continents. But I can't stop to think that every simulation game needs layers that the user can toggle for fine grain detail. So next time we will be implementing a visual solution for displaying the plates of our planet.

#procedural-generation#game-dev#unity#simulation#csharp

EDUARDO MARTINELLI

© 2026 • Fullstack Software Engineer

Thank you for checking out my work. Shoot me a message about interesting projects and collaborations!