Sometimes, you want to add some hand-crafted content into the mix of your level. You might want to use a whole level as a set-piece, and carefully place everything. You might want to include a cool structure on a map. This chapter walks you through designing prefabs, and teaches you to place them as either whole maps or into existing maps.
You've probably seen Waveform Collapse (WFC), if you follow gamedev media. It exploded onto the scene, and started being used in everything from Caves of Qud to AAA titles. It's a complicated algorithm that takes one source image and makes something similar (but not the same). This chapter walks you through the algorithm, and modifies it to better fit the Roguelike genre - adjacency is influenced by tile connectivity to encourage useful maps, and it takes a map as a source - so it can make your existing map creation algorithms more interesting.
This chapter uses Voronoi diagrams to generate hive maps - not at all unlike the inside of an ants nest or bee hive. It discusses the use of different distance heuristics to adjust the shape of your result.
The DLA chapter introduced enforced symmetry and brush size for map generation, and this chapter takes it one step further - using it for other algorithms. Drunkard's Walk in particular can benefit from this system.
Despite the scary name, Diffusion-Limited Aggregation Maps (DLA) are actually relatively easy to implement - and can produce beautiful results. This chapter walks you through the basic algorithm, with tunables for where the particles start and the rules for how they carve your map. It introduces brush sizes and enforced symmetry for your map builders.
Mazes and labyrinths (optionally including a Minotaur) are a mainstay of D&D and Roguelikes. This chapter walks you through the creation of a perfect maze - one that is guaranteed to be solvable, and well-connected. It also talks about the pros and cons of including this type of map in your game.
The Drunkard's Walk algorithm makes maps by simulating a large number of tunnelers moving randomly through a level, carving out the map as they go. This chapter walks you through implementing the algorithm, along with settings and tunables to help you get the map type you want - while remaining random on each play-through.
Cellular Automata is a great algorithm family, taking chaos and making order. It produces nice, organic levels with high connectivity - ideal for creating the feel of a large natural cavern, or a forest level. This chapter walks you through the algorithm, its implementation, and how it can make fun levels.
Sometimes, you want to simulate the insides of a building - and not waste much space. This chapter walks you through using Binary Space Partition to sub-divide your dungeon space and make an interior map.
This chapter discusses how to build dungeons using a Binary Space Partition to sub-divide the map into regions, and then place rooms and corridors inside it. It's similar to how Nethack makes its dungeons, and can lead to a fun dungeon-bashing experience.
In order to learn about map building, it's a good idea to be able to see it in progress. This chapter builds a test harness that can `snapshot` each iteration of your map development, and play it as a small movie when a map is created.
So far, we've only had one type of map. That's about to change - but to support it, we need to build a generic Map Builder interface. This chapter walks you through using Rust traits to build a generic interface, and use it to make a varied experience for your player.
Roguelikes show their origins in D&D dungeon-bashing in many ways, and traps are a mainstay. This chapter teaches you how to include basic traps in the game, dividing them up between triggers and effects. It also introduces the concept of hidden objects and gives the player a chance to notice the trap before walking blindly into it.