The land of the spiky mountains

Hey there

I’ve been working on the mapper code. If you remember my last post, I said I wasn’t sure about how to create a random organic terrain to work with. So I started thinking about how earth would have been in the beginning, a big mass of hot lava. Therefore the ground was kind of fluid, and waves from asteroid impacts and any other catastrophes would travel through it, modifying it until it got cold.

What I need to simulate is the z-axis changes in a flat surface when one or more waves travel through it. There are two forces playing here:

  • The bonds between particles, which will transmit the energy.
  • The surface of the fluid, so the particles will try to recover the initial state of z=0

Simulate that fluidly requires a powerful machine (not that I have one), however, with a little patience you can see the results.


Blue dots are under the water level, while green ones are above water level

I randomly create a non-flat surface and then let the physics work, so I can just stop the process whenever I want and work with the results. What’s the next step? First of all let’s see the result:


That’s how the terrain looks like after 200 cycles of waving. There’s no place buildings there, all is too spiky, but I’ve thought about watering it down with some rain. A little sub-process visits every point above water level, and reduces its value by one, distributing the lost height between the adjacent points. So, if I add 500 cycles of rain, this is what I got.

Steps of 50 cycles of rain between images

Nice, isn’t it?

I keep working on it


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s