Monday, April 12, 2021

Mountains, Gandalf!

About a million years ago I designed a system for generating mountains that would allow for the creation of vaguely convincing ridges and valleys at the regional level. Now this was much better than just using diamond-square to add detail to the global heightmap, and in fact I was so impressed with my mountains that it spurred me on to try to make all the other elements in Undiscovered Worlds as good as they were. But the system does really leave a fair bit to be desired, compared to reality.

For example, here's the regional map I put at the end of my last post:


Those mountain ridges look superficially OK. But they're far too wide, really, given that one pixel is one kilometre, and they don't have any proper sub-ridges coming from them. When I initially made this system, I had difficulty doing that, and so I just added random lines of ridges sticking out in random directions from the main ridges, which makes them look a bit fuzzy but doesn't really make much sense.

Compare the Himalayas:

and the Pyrenees:


These are far busier than my mountain ranges, with all those little sub-ridges and valleys in between them.

So it's time to try to improve the mountains a bit. First, we make our main ridges thinner, and get rid of additional fuzziness. This is straightforward:


Now how do we go about adding buttresses to these ridges that make sense? I decided that the best way would be to mark key points along the ridges while drawing them, and then go through the map tile by tile. For each cell in each tile, we work out which of the key points is closest and how far away it is. It's then straightforward to identify all the ones that are a key maximum distance from the nearest key points. These form an outline some distance from the ridges. Also, any cells that are closer to their nearest key points than that, but which do not have any neighbour which (a) has the same closest key point and (b) is further from it, are cells that form the boundary between two watersheds, as it were.

The map probably explains it better. The ridges are in turquoise, cells that are the maximum allowed distance from their key points are dark pink, and the cells that are equidistant between two ridges are lighter pink:


Now all we have to do is to go over all of those marked cells and choose some of them to be the end points of buttresses. Buttresses are drawn from the key points on the original ridges out to the end points, with perhaps a bit of swerving along the way, and a gradual decrease in height.

Then we do all of that again, to create smaller, secondary buttresses that emerge from the first set of buttresses.

The result isn't as elegant as the real mountain ranges shown above, but it doesn't look totally unreasonable:


The relief map of this area looks like this:


I think that looks pleasingly rugged. Here's how the region I showed at the start of this post looks now:


There are a few other differences here, because I've been fiddling about with the grid-concealing elements that I talked about in my last post. But the main thing is that the mountains are looking a little more believable, I think.

Another range from the same world, showing how complex the ridges can sometimes get:


And finally, of course, where there are low mountain ranges, we have hills. These are now looking like this:


As I always say, it's not perfect, but it's an improvement. There will probably be endless tinkering to be done with this approach, and I wish I were able to get it more realistic in detail, but I'm quite pleased with the general effect for now.

No comments:

Post a Comment