IT lexicon › Programming › Rooms and corridors

Rooms and corridors

Programming På svenska → Updated: 2026-10-26

The classic dungeon-generation recipe: scatter non-overlapping rectangular rooms, then connect them with corridors.

Rogue (1980) did essentially this on an 80×24 terminal, and it is still the default mental model for roguelike levels. You place a handful of rooms without overlap, choose which to connect — often via a spanning tree or a BSP split — and carve L-shaped hallways between them. Simple, readable, and easy to guarantee that everything stays connected.

The downside is a certain blocky sameness: it is all boxes and hallways. That is why later generators layer cellular automata, drunkard's walk or wave function collapse on top for caves and organic shapes. The base recipe survives anyway, because it almost never produces an unplayable level.

← Back to the lexicon