I’m exploring #programming a bunch of #terraingeneration #algorithm, to see how they work and which ones look nice. So far I’ve tried out the Midpoint Displacement and Diamond Square algorithms…
The Midpoint Displacement algorithm is pretty simple, but also kind of terrible. It makes some interesting 1D images though, and that’s probably the best use for it. Here’s a nice background of some hills. I made it using this old blog post’s code which needs a bit of fiddling with to run.
The 2D version just looks a bit… well… here… it’s not great.
It looks sort of terrain-like, but with odd square patterns, which is a limitation of the algorithm as I found out on this equally old blog post.
Then I found the Diamond-Square algorithm which makes much nicer looking landscapes that actually look realistic.
Now this looks more like landscape. I could imagine using this in a game as the world. And that’s what I want to do next. I have a 3D “engine” that can draw stuff, so it just needs expanding to draw meshes and have heights applied to them.
I sort of have this working already, it just needs tidying up and the terrain not being hard coded.