55 · Procedural · 2D (and 3D layouts)

Dungeon generation

Rooms and corridors from a seed.

Hand-made levels run out. A dungeon generator splits the map (binary space partitioning) or carves with random walkers, places rooms, and connects them with corridors so every room is reachable. With a seed, every layout can be replayed and shared.

←↑↓→ or WASD moveG new dungeon · C connectivity on/offD-pad to explore

Try this: Explore the generated dungeon and find the key in the far room (orange on the minimap). Press G for a new one. Turn off the connectivity check and some dungeons leave the key cut off.

Seed 3

Every room is connected. Find the key in the far room.

Prompt bit

Works for 2D or 3D in any engine (Unity, Unreal, Godot, web). Paste the short one for a quick fix, or the detailed one when you want it done properly.

Generate dungeons from a seed: split the map with BSP into leaves, place one room per leaf with a margin, connect sibling rooms with L-shaped corridors so all are reachable, finish in under 0.05 s, and regenerate if fewer than 5 rooms fit.

43 words · one sentence to paste as is

Where it's used

Common mistakes

Rooms that are unreachable, overlapping rooms, unseeded randomness so bugs cannot be reproduced, start and exit next to each other, and no checks so some maps are tiny.

Writing this with an AI assistant? See our best AI coding assistants for game developers.

Missing a concept? Request one.

Related concepts

New concepts, in your inbox.

One short email when we add new concepts, plus our weekly roundup of AI tools for game devs. Unsubscribe any time.