Procedural Map Generation Techniques (Roguelike Celebration 2020)
This is a great survey of roguelike map generation techniques by
Herbert Wolverson, covering a ton of different techniques. He uses animated illustrations to demonstrate how different algorithms work: random room placement, BSP subdivision (used by Nethack), cellular automata (good for caves), drunkard’s walk (aka random walk), diffusion limited aggregation (including adding attractors and symmetry for more control), Voronoi cells (plus using different distance algorithms), Perlin noise (commonly used for landscapes, but Ken Perlin’s invention is useful for a lot of stuff), and the use of prefabs (or “vaults”). He proposes the use of a Dijkstra map as a way of reading the map so you can do things like remove unreachable areas, or place the starting point in a reasonable spot, or figure out which parts of the map are on the golden path.
One important thing Herbert highlights is the importance of context and control in designing a level generator: the randomness is “fed into an algorithm that that approximates what you want to get but ensures that it is different every time.”
He also talks about combining generators, which is something that can get lost when cataloging different techniques: there’s no one perfect algorithm for generating a roguelike map, and combining multiple techniques can result in something much more interesting than a single generative operation could make on its own.
His tutorial for making a roguelike in Rust has a lot of universally applicable algorithmic stuff, including even more map generation algorithms, so there’s also lots of material if you want to go beyond the already information-dense talk itself.
Overall, this is a great starting point for expanding your toolkit of map generation techniques. I particularly like Herbert’s examples for controlling the maps and combining techniques: there’s a lot of scope for getting creative with how you put together different elements of your map generator–particularly if they also tie in with other parts of your design or narrative.