Building Better Terrain

Click-bait title aside, I believe the best way to generate better terrain is to become better at layering effect after effect on top of each other until you reach a point of decent visual interest.

This is an extension of Isle Terrain, where I described a range of these effects. Silly me, I made the big mistake of telling instead of showing! Here, instead, I'll start out with a neat animation. Neat!



Skipping past the two first steps which are pretty straightforward, I'll describe a bit more in depth how each step works.



"More complicated noise". If you want to be specific, it is the sum of two Perlin noises, one with half the frequency of the other. Oh, and it's actually the square root of each of them, which creates more gentle hilltops, since the noise goes between 0 and 1, where sqrt() squeezes values towards 1.

For Isle Terrain, I of course wanted the terrain to be an island! This was accomplished by lowering the terrain by the distance to the centre. This exacerbates the tendency of Perlin noise to create central mountains, but that's solved later.

Before they are used in any noise-function, the x and y coordinates are distorted by Perlin noise. I regret putting this step so early, since its effect is pretty subtle at low frequencies. However, it purportedly gives more fluid Perlin noise.

A new colour palette is introduced, which is completely different for water and land. For water, the coast-line is exaggerated. For land, the colour is more flat, since it'll become much less flat in just a few seconds.

To create a relief-like effect, faux light and shade is added to the map, depending on the direction of the terrain steepness. The altitude at any point is compared to five arbitrary points up and to the left of the pixel. At the current point, this also highlights how booooring the terrain is, since we see a similar bumpy texture all over the place.

Mountains! That's what we needed. The mountains are an added layer of Perlin noise that is only applied on land. The noise distribution is folded, so that the middle values around 0,5 do not create mountains, while both the low and high values give tall mountains.

Quite a subtle effect, contour lines and dithering are added to create a more gritty-feeling terrain. Sometimes, the contour lines also help with making the terrain feel voluminous.

But the mountains are not quite done yet. They need to be much less gentle. Remember how I said that the terrain was made from square-rooted Perlin noise to create flat hills? Here we'll do the opposite. Squaring the mountain distribution also makes a better phasing-out towards the flat plains.

Still, the mountains are too smooth. A high-frequency Perlin noise is added with strength proportional to how mountainous the area is, creating the biggest differences around the highest parts of the mountain ranges. Once again, this value is folded to create /\/\/\-shaped terrain.

The last problem we have is that the island has three mountain ranges, which all look alike. Adding in some biome specific colouring will give off a better large-scale impression of the terrain.

And that about does it! Actually, it does not. I've been working for days on getting erosion to work, and it simply won't work. I'm getting fed up with it, so I think, unfortunately, I'll have to leave this to be the end of the Isle Terrain saga.

Comments