One of the most-used world structures in games, besides open worlds, are dungeons. In this recipe, we will use a technique that will allow us to create both.
Implementing the constructive algorithm for dungeons and islands
Getting ready
This technique works easily with a grid graph, like the one we used with the DFS maze builder. However, we will experiment with a different approach to show you how to handle space partitioning and size storage.
How to do it...
We will need to create two different classes: one for handling the nodes, and one for handling the whole tree...