DungeonTool brings procedural dungeon generation to Unity with almost no setup. Inspired by the MarkovJunior WFC (Wave Function Collapse) algorithm, it reads your hand-drawn room layouts from PNG files and assembles them into fully connected dungeons — corridors, a start point, and a goal included — from a single method call. It ships with four ready-to-run demo scenes (2D Prefab, 2D Tilemap, 3D Block-based, 3D Edge-based) built on free Kenney (CC0) art, so you can play a finished dungeon the moment you import.
Try it in one click. Every demo scene has an on-screen control panel: press Generate for a new dungeon, Play Demo to drop in and walk it with WASD (reach the stairs), and reproduce any layout you like by its seed (on-screen seed display, seed input, and copy-to-clipboard). Zoom and pan the bird's-eye overview, then press ESC to return. In the Editor you generate straight from the Inspector with a button — no menu digging, no scripting required to see it working.
Design rooms your way. Each room is a small pixel-art PNG where color encodes the tile type — white = wall, dark gray = floor, red = exit, blue = entrance, transparent = wildcard. Add as many rooms as you like; the engine handles placement, rotation, reflection, and corridor connection automatically. No scripting is required to add or change rooms.
2D and 3D from the same rooms. The generator is designed for 2D top-down games first, but the exact same room set can be laid out flat on the XY plane for 2D or on the ground (XZ) plane for 3D — just swap the prefabs. 3D supports both block-based pieces and edge-based (modular) wall panels.
Two output modes. Choose Prefab mode to instantiate GameObjects, or Tilemap mode to write directly into a Unity Tilemap for lightweight rendering and built-in collider support.
Optional autotiling. In Tilemap mode, an optional wall atlas classifies every wall cell by its neighbors and picks the matching art — straight runs, corners, T-junctions, and pillars — while a floor atlas scatters random floor variants for visual variety. Leave them empty to use a single tile everywhere.
Built-in post-processing. Dead-end removal trims corridor branches that lead nowhere, and floating-wall trimming cleans up stray border tiles — giving you polished output without manual cleanup.
Populate it in seconds. The included Prop Placer scatters chests, barrels, decorations, or pickups across the dungeon using simple rules — area size, max count, spawn chance, rotation, and automatic avoidance of the start and goal tiles. For full control, FloorPositions and WallPositions expose every tile's world-space coordinate, and the OnGenerated event lets you drop in enemies, treasure, or traps from your own code in a few lines.
Made for large dungeons. In 2D prefab mode, the Wall Collider Merger combines hundreds of per-cell colliders into a single CompositeCollider2D to keep physics fast.
Runtime-ready API. Call Generate() from code at any time to build the next floor on the fly, with optional fixed-seed support for reproducible layouts.
Ideal for roguelikes, dungeon crawlers, puzzle games, and maze-based experiences. The generation core is pure C# with no third-party dependencies, making it easy to extend and integrate into any project.
Requirements: Unity 6 (6000.3) or later — developed and tested on 6000.3.15f1. Uses the Universal Render Pipeline (URP), 2D Tilemap Extras, and the Input System package.
A note on runtime generation. In the Editor, generation works out of the box. To generate at runtime in a standalone (desktop) build, one extra step is needed: (1) move your room PNG folder into a StreamingAssets folder (e.g. Assets/StreamingAssets/MyDungeon), (2) set Room Folder to that StreamingAssets path, then (3) build and run. No code changes are required. Runtime generation is not supported on mobile (Android/iOS). Dungeons pre-generated in the Editor and baked into your scenes run on all platforms.