Last week, I set up the basic renderer for the voxel game. This week, I’m going to write the terrain generator.
I took a crack at recreating Minecraft in one week using a custom C++ engine and Vulkan. I was inspired by Hopson, who did the same using C++ and OpenGL. Hopson was, in turn, inspired by Shane Beck, who was inspired by Minecraft, which was inspired by Infiniminer, which was presumably inspired by real world mining.
I’ve been playing some roguelikes recently, so I wanted to try writing my own procedural dungeon generator. There are a lot of different ways to approach this problem, but I eventually decided to base mine off of TinyKeep’s algorithm, described here. I extended the algorithm to work in 3D, to create dungeons with multiple floors.
The code for this example available in this Github repo. I’m using Unity3D for this demonstration, but these concepts are, of course, usable in any game engine.