I made a simple tilemap generator, but it was obviously too simple and not enough for my game, so I made some improvements to the tilemap generator. I strongly recommend you to review my last post first.
Decorations
At first, I found the most appropriate value for the Height Noise Map Parameters is the default value, i.e, the Octaves set to 1, the Zoom Out set to 1 and the Curve set to linear. Tweaking these values would give more randomness to the map, but the randomness would get the map messy! What we want is a natural map, not a random mess, but I’ll keep it here for now and I’ll remove it in the future.
So, how to make a natural map if we can’t tweak these values? The answer is the Biomes Diagram. TukanHan uses the biomes diagram to diversify the map in the following way:
1 |
|
Obviously, this method can’t make the best use of the height noise map and the temperature noise map.
Let’s start at the beginning. What is the noise map? A noise map looks like
1 | 11111 |
Yes, the noise map consists of mountains and plains. So, a height noise map consists of mountains and plains, and a temperature noise map also consists of mountains and plains. So, at first, we can simply divide the whole map into different areas by a height noise map - that’s why we don’t tweak Height Noise Map Parameters - and then we can diversify different height areas by means of the same temperature noise map!
I mean that we can regard the temerature noise map as decorations, i.e. the different height values in the temperature noise map represent different decorations in the final map. So after populating the biomes diagram, I finally got a good map!
Falloff Map
You might realise, that water and land always appear randomly, with water taking up one half and land taking up the other, like in the picture below. That seems a little weird. Most of the time what we want is an island surrounded by water, or a patch of grass covering the land.
I learned a trick to deal with the problem from Sebastian Lague.
A falloff map looks like
The key point is to substract a falloff map from a noise map. For example, if we have a noise map, like
After applying the falloff map to it, we get
How to generate a falloff map? Sebastian Lague gives a function
The feature of this function is that it starts at the diagonal of the square and decreases from 1 to 0, and the closer you get to the centre, the faster the value decreases to 0. This is good. But sometimes it consumes too many values on the edges. If we use the terminology of a css, that means that its padding is sometimes very large, so I would recommend setting A and B as controllable parameters to control its padding.