Dungeon Generation

A random dungeon is a dungeon in a role-playing video game which is procedurally generated by the computer using an algorithm, such that the dungeon is laid out differently every time the player enters it, and a player often never plays through quite the same dungeon twice, as there are innumerable possibilities for how they generate.

How to interact: Click the canvas to generate a new dungeon layout. The visualization shows the generation process in real-time:

  • Dark areas represent walls and solid rock
  • Lighter areas show rooms and walkable spaces
  • Corridors connect rooms together
  • Colored highlights show the pathfinding algorithm at work

The algorithm uses a combination of BSP (Binary Space Partitioning) tree subdivision and graph-based pathfinding to ensure all rooms are accessible.