PROCEDURAL DUNGEON GENERATOR
IN DEVELOPMENTTechnical Designer & Sole Developer
Overview
A runtime procedural dungeon generator designed for a roguelike dungeon crawler. It assembles pre-built 3D rooms on a grid, connects them with corridors, and enforces designer-set rules: a room limit, a shop, upgrade rooms at dead ends, crossroads that always lead somewhere, and an exit placed far from the start. The same seed always produces the same dungeon.
Built solo in Unreal Engine using only Blueprints. I kept the scope deliberately constrained as my first procedural generation project and focused on clear rules, designer-friendly parameters, and a data-driven room set. It is currently a working prototype: layout generation only, with no gameplay yet.
Design Goals
- Built for a roguelike dungeon crawler.
- Constrained scope for a first procedural generation project, using only Blueprints.
- A hard room limit, with the exit always placed far from the starting room (set by an Exit Depth Ratio).
- Rules enforced by the structure of the data, not by patching layouts afterwards.
- Easy for a designer to tune: every key rule is an exposed parameter.
How It Works
- 1
Seed
A seeded random stream makes every dungeon reproducible. Seed 0 generates a random one.
- 2
Grow
Starting from the Start room, rooms attach to open doors through short corridors until the room budget is used.
- 3
Exit & Upgrades
The Exit goes on the deepest door that fits. Upgrade rooms go on leftover doors.
- 4
Validate
Every rule is checked. If one fails, the layout is thrown away and the next seed is tried, up to Max Attempts. Nothing is spawned until a layout passes, so retries are cheap.
- 5
Build
The passed layout becomes instanced meshes. Unused doors are sealed with plugs and the player spawns in the Start room.
Rules Enforced by Design
Upgrade and Exit rooms are dead ends
Their room data has exactly one door.
Crossroads always offer 2 or 3 paths
T and X rooms have 3 or 4 doors, and a room is rejected if a path has no space. Validation also checks every path is filled.
Upgrade rooms are never successive
Each room tracks whether it already has an upgrade attached, and neighbors are checked before placing one.
The Exit is far from the start
Doors are scored by depth first and grid distance second, and the Exit must reach a minimum depth.
The shop can appear anywhere
Its position is a random slot in the growth budget.
Combat rooms can follow each other freely
No restriction on Combat rooms.
Longer paths vs side branches
A Branch Bias parameter controls how often growth continues from the newest door versus a random one.
Technical Highlights
Data-driven rooms
Each room is a Data Table row (room type, mesh, footprint cells, door sockets, weight). Adding a room variant means building the mesh and adding one row.
Two-pass architecture
All layout logic runs on a 2D integer grid first. Meshes are only built once the layout passes validation.
Performance
Rooms are pre-built meshes rendered as Hierarchical Instanced Static Meshes, one component per unique mesh, so even large dungeons cost very few draw calls.
Reproducibility
A seeded random stream, including a custom seeded shuffle, because the built-in shuffle ignores seeds. A good layout can be recreated by entering its seed again.
Consistent mesh standard
All rooms are modeled on a 600 uu dungeon cell with identical door openings, so rooms, corridors and plugs snap together without seams.
Blueprint challenges solved
Copy-modify-write-back for struct arrays, and passing the random stream by reference so results stay deterministic.
Design Parameters
- Seed (0 = random) and Max Attempts
- Max Rooms
- Max Shop Rooms
- Max Upgrade Rooms
- Crossroad Chance
- Branch Bias
- Exit Depth Ratio
- Min and Max Corridor length
- Cell Size
- Room Table, Corridor Mesh and Door Plug Mesh assets
- Debug Draw
Gallery
Six different generated layouts.
- Start
- Combat
- Crossroad
- Shop
- Upgrade (dead end)
- Exit
- Corridors
Status & Next Steps
Current state
Working prototype. Layout generation only, no gameplay yet.
Planned / Exploring
- Add more variety to the room set.
- Explore a room generator that builds rooms before the dungeon generator handles the layout.
Direction
I haven't decided yet whether this will grow into a full game or become a tool for developers to use. Both directions are still open.