This post first appeared on Reddit, in the /r/roguelikedev sub-reddit. You may read the original post here.

Work-in-progress height-map.

Work-in-progress height-map.

An example Voronoi diagram.

An example Voronoi diagram.

As usual, my github is https://github.com/thebracket/bgame. All the work for this week is tucked away in the third-dimension branch!

Development has been ponderous, because I was out of commission with a cold. I always write odd code when I have a fever, so I made a branch and took a deep-dive into a few areas I’d been thinking about. I don’t really have much to show off this week, but it should finish bearing fruit in time for Christmas! I haven’t decided what’s being kept yet (hence the branch)…

Compiler WTFs: I ended up with a piece of code that only worked if I turned off optimization. Very odd (and unfortunate: the world-gen code is a LOT slower without compiler optimizations). Then my use of “optional” suddenly blew up. It turns out that my dev-box updated, and suddenly std::experimental::* was no longer in the default C++ library. I ended up using the Boost equivalent, which is probably more portable anyway.

3D maps: I really like the “simulated 3D” look I’ve been going with, but I’ve also been finding it limiting for the type of game I’d like to be writing/playing. DF does 3D quite well (ASCII/gridded voxels), so I’ve been playing around with that. I’ve got a nice smooth renderer going, but it needs a bunch more work. I’m currently enjoying the results enough to think it’s worth it. 🙂

World Gen: The existing version makes some pretty worlds, and they even make sense – but they aren’t all that great of a playing surface. Not enough flat areas, in particular, makes actually building something more tricky than it should be. So I took a dive into a few different strategies, which while they create a less realistic result produce something more useful from a game perspective. Voronoi diagram of areas with similar altitude, a random factor, and hydrological erosion (with rain map catching shadows from hills) and then flooding up so that a percentage of the map is ocean has proven to be quite good – but I’m spending far too much time tweaking it! Also having fun with performance, generating worlds in three dimensions.

Clean-up: Always a good idea to periodically go over and clean-up crufty bits of code, so I’ve done a lot of that.