← Back to the Dungeon Route Planner

Dungeon Route Planner – Documentation

Dec 2, 2026 · Allen

Dungeon Route Planner is a Blueprint-only procedural dungeon generator for Unreal Engine 5.7 and later. It plans a grid of rooms and corridors from a seed, checks the boss room can be reached, builds the dungeon on the server and replicates it to every player. Bring your own art: the pack ships with simple grey-box pieces coloured by room type.

Top-down view of a dungeon built by the Dungeon Route Planner, a procedural dungeon generator for Unreal Engine 5, with grey-box rooms and corridors, a red boss hub and a green start hub

Quick start

The fastest way to see the pack working is the demo map, which opens by default.

  1. Open DungeonRoutePlanner.uproject in Unreal Engine 5.7 or later.
  2. L_DRP_Demo opens automatically. If it doesn't, open Content/DungeonRoutePlanner/Maps/L_DRP_Demo .
  3. Press Play.

You start in the Start hub of a freshly generated dungeon. Yellow discs mark the spawn points, and the grey boxes are traps.

First-person view inside the green Start hub of the Dungeon Route Planner demo, with grey-box doorways leading out to the dungeon
KeyAction
W A S DMove
MouseLook
SpaceJump
F9Generate a new dungeon with a new seed (host only)
Up ArrowRaise Danger by 0.25 and rebuild with the same seed (host only)
Down ArrowLower Danger by 0.25 and rebuild with the same seed (host only)

The top-left HUD shows the current Seed, Danger and your Health. Touch a trap box to take damage; at 0 health you return to the Start hub.

To try multiplayer, set Number of Players to 2 and Net Mode to Play As Listen Server in the Play options, then press Play.

Add it to your own project

Everything lives in one folder, Content/DungeonRoutePlanner . No plugins or C++ are needed.

  1. Add the pack to your project from Fab (Add to Project), or open this project, right-click the DungeonRoutePlanner folder and choose Migrate, then pick your project's Content folder.
  2. Open your level and drag BP_DRP_Planner (in Blueprints/Core ) into it.
  3. Place it where you want the dungeon's corner. The planner's location is grid cell (0, 0), and the dungeon grows in the +X and +Y directions from there.
  4. Press Play. With Auto Generate On Begin Play ticked (the default), the server builds a dungeon straight away.

Your players won't be moved into the dungeon automatically, because that depends on your game. See Multiplayer below for the pattern the demo uses.

The Demo and Maps folders are examples only. Nothing in the core planner depends on them, so you can delete them once you've seen how they work. The demo is also the only part that uses Enhanced Input.

How it works

Diagram of the Dungeon Route Planner generation flow: Generate, Clear old dungeon, Plan a layout, then a Boss reachable? check that retries up to Max Plan Attempts; if yes, On Plan Complete fires, every piece is built with On Piece Spawned per piece, and On Dungeon Built fires to place players, enemies and loot

generation flow · 4 steps, 1 check, 3 events

If a plan fails the reachability check, the planner tries again. If every attempt up to Max Plan Attempts fails, On Plan Failed fires instead and nothing is built. On Piece Built is also called on each piece as it spawns, so pieces can set themselves up.

Planner settings

Select the planner in your level to see these in Details. Hover any setting for its tooltip.

Unreal Engine Details panel for BP_DRP_Planner, part 1: the Transform and Generation settings, including Cell Size, Seed and the Easy and Max valuesUnreal Engine Details panel for BP_DRP_Planner, part 2: the remaining Generation settings plus the Pieces, Difficulty and Debug categories
CategorySettingWhat it does
GenerationSeedThe number that decides the layout. The same seed always gives the same dungeon. -1 picks a random seed each time.
GenerationAuto Generate On Begin PlayBuilds a dungeon as soon as the level starts. Untick it to call Generate yourself, for example after a lobby.
GenerationMax Plan AttemptsHow many times the planner retries a layout that fails validation before giving up (default 10).
DifficultyDanger0 to 1. Scales how dangerous the dungeon is, including how many traps it places and how many dead ends. Passed to every piece through On Piece Built.
PiecesCorridor PiecesOne list of Blueprints per corridor shape: DeadEnds, Straights, Corners, TJunctions and Crossroads. Put your own corridor pieces here.
PiecesSpecial PiecesThe same five shape lists, for special rooms. The pack fills DeadEnds and Straights; leave a list empty if you have no special version of that shape.
PiecesStart Piece ClassThe Start hub Blueprint (default BP_DRP_Hub_Start). The demo places players at its EntryPoint arrow.
PiecesBoss Piece ClassThe Boss hub Blueprint (default BP_DRP_Hub_Boss).
PiecesDoor Plug ClassThe Blueprint that seals openings leading nowhere (default BP_DRP_DoorPlug).
PiecesTrap ClassesThe traps that can be placed (default BP_DRP_Trap_Box). Add your own trap Blueprints here.
DebugShow Debug PlanDraws the plan as lines and prints progress messages. Off by default.
GenerationBuild RoomsUntick to plan without spawning any pieces, which is handy for testing seeds quickly with the debug lines.
DebugEnable Regenerate KeyLets the host press a key to build a new dungeon.
DebugRegenerate KeyThe key for the above. Default F9.

Generation tuning: the Easy and Max pairs

Most Generation settings come in pairs. Danger blends between them: at Danger 0 the planner uses the Easy value, at Danger 1 the Max value, and anything in between is mixed proportionally. Raise a Max value to make high-Danger dungeons harder without changing easy ones.

SettingEasy → Max (default)What it controls
Cell Size1000Width of one grid cell in Unreal units. Every piece must fit one cell.
Grid Size20 → 24Number of cells along each side of the grid.
Boss Distance0.5 → 0.85How far from the start the boss room sits, as a fraction of the grid.
Boss Doors3 → 4How many entrances the boss room has. Each one gets its own route.
Wander0.3 → 0.5How much routes wander instead of heading straight for the boss.
Detour Chance0.3 → 0.6Chance a route takes a detour.
Route Gap2 → 4Minimum spacing between routes, in cells.
Extra Loops3 → 6Extra links that turn branches into loops.
Connectors2 → 5Passages joining one route to another.
Connector Max Len6Longest connector, in cells.
Dead Ends4 → 12Number of dead-end branches.
Dead End Min Len / Max Len3 / 6Shortest and longest dead end, in cells.
Dead End Turn Chance0.3Chance a dead end turns as it grows.
Dead End Treasure Chance0.25Chance a dead end is marked as a treasure spot.
Special Chance0.1 → 0.15Chance a corridor becomes a special room.
Trap Chance0.15 → 0.45Chance a corridor cell gets a trap.
Min Traps Per Route2 → 3Fewest traps on each route.
No Adjacent TrapsOnStops traps being placed on neighbouring cells.
Safe Radius3Cells around the Start hub kept free of traps.
Start Tries50Attempts to find a valid start position.
Passage Tries30Attempts to fit each passage before skipping it.

Internal variables (eye closed) are read-only from outside. You can still read Seed, Danger, Is Built, Start Piece and Boss Piece from your own Blueprints.

What each setting does in practice

The tables above say what each setting is. This section says what you'll see in the dungeon when you change it. For settings with an Easy and a Max value, change both to move the whole range, or change only Max to affect high-Danger dungeons only.

Seed and difficulty

SettingWhat you'll seeTurn it upTurn it down
SeedPicks one exact layout. Same seed + same Danger + same settings = same dungeon, on every machine.A different number gives a different layout (see Choosing seeds below).-1 picks a new random seed each time.
DangerMoves every Easy/Max setting at once, from Easy (0) to Max (1).Bigger grid, boss further away, more doors, routes, loops, dead ends and traps.Smaller, more direct dungeon with fewer traps.

Size and layout

SettingWhat you'll seeTurn it upTurn it down
Cell SizeHow big each grid square is in the world. Must match your pieces.Bigger, more spread-out dungeon (only if your pieces are bigger too).Smaller dungeon (only with smaller pieces).
Grid SizeThe area the dungeon can fill.More room: longer routes and more space for branches.Tighter, more compact dungeon.
Boss DistanceHow far the boss room is from the start.Longer walk to the boss.Boss is closer to the start.
Boss DoorsNumber of ways into the boss room, each with its own route.More routes and more choice for players.Fewer routes; at 1, one main path.
Route GapHow far apart routes must stay.Routes spread out across the map.Routes can run side by side.
WanderHow much each route snakes about.Winding, maze-like routes.Straighter routes towards the boss.
Detour ChanceHow often a route takes a detour.More detours, longer journeys.More direct routes.

Joining routes together

SettingWhat you'll seeTurn it upTurn it down
Extra LoopsLinks that turn branches into loops.More circular paths; players can go round instead of backtracking.More tree-like layout with more backtracking.
ConnectorsPassages from one route to another.Routes cross over more; easier to switch paths.Routes stay separate.
Connector Max LenLongest a connector can be.Connectors can join routes that are further apart.Only short links between nearby routes.
Passage TriesHow hard the planner tries to fit each passage.More passages succeed in crowded grids (slightly slower).Some passages are skipped.

Dead ends

SettingWhat you'll seeTurn it upTurn it down
Dead EndsNumber of side branches that lead nowhere.More side paths to explore (and to hide loot in).Cleaner layout with fewer branches.
Dead End Min Len / Max LenHow long each dead end is.Longer side branches.Short stubs.
Dead End Turn ChanceHow often a dead end bends.Twisty side branches.Straight side branches.
Dead End Treasure ChanceHow many dead ends are marked as treasure spots.More rewards at the end of side paths.Fewer treasure spots.

Rooms and traps

SettingWhat you'll seeTurn it upTurn it down
Special ChanceHow many corridors become special rooms (yellow in the demo).More special rooms.Mostly plain corridors.
Trap ChanceHow many corridor cells get a trap.More traps.Fewer traps.
Min Traps Per RouteThe fewest traps on each route, whatever Trap Chance rolls.Every route is guaranteed to be dangerous.Some routes can be quiet.
No Adjacent TrapsStops traps sitting next to each other.(On) Traps are spaced out.(Off) Traps can cluster.
Safe RadiusCells around the Start hub with no traps.Players get a longer safe start.Traps can appear close to the start.

Behind the scenes

SettingWhat you'll seeTurn it upTurn it down
Start TriesAttempts to find a valid start position.Fewer failed plans on crowded settings.Faster, but more plans may fail.
Max Plan AttemptsRetries of a whole layout before On Plan Failed fires.Fewer failures with extreme settings.Gives up sooner.
Build RoomsWhether pieces are spawned.(On) Builds the dungeon.(Off) Plans only; use with Show Debug Plan to test seeds quickly.
Auto Generate On Begin PlayWhether the dungeon builds when the level starts.(On) Builds straight away.(Off) Call Generate yourself, for example after a lobby.

If plans start failing (On Plan Failed fires, or the red message appears), the settings are asking for more than the grid can hold. Raise Grid Size, or lower Boss Doors, Route Gap, Dead Ends or Connectors.

Choosing seeds

Small seeds that are close together, such as 1, 2 and 3, can give layouts that look alike. For dungeons that are drastically different from each other, use big seed numbers (six digits or more) and make big jumps between them, for example 104729, then 583127, then 921053. Leaving Seed at -1 already does this: it picks a large random seed each time, and the demo HUD shows which one so you can note down layouts you like.

Blueprint API

Call these on the planner from any Blueprint. Get the planner with Get Actor Of Class (BP_DRP_Planner) or a reference placed in the level.

Functions

FunctionInputsWhat it does
GenerateNew Seed (Integer), New Danger (Float)Clears any current dungeon, then plans and builds a new one. -1 for a random seed. Danger is clamped to 0–1. Server only.
Clear DungeonnoneDestroys every piece, door plug and trap the planner spawned. Server only.
Get All Spawn PointsnoneReturns an array of Transforms, one for every spawn-point arrow in every built piece.

Events (event dispatchers)

Bind to these with Bind Event to … on the planner. They fire on the server.

EventGives youFires when
On Plan CompleteSeedA valid plan is found, before anything is spawned.
On Piece SpawnedPiece, Cell, Cell TypeEach piece is spawned. Good for per-room setup.
On Dungeon BuiltStart Piece, Boss Piece, SeedEverything is spawned. This is the main hook for placing players, enemies and loot.
On Plan FailedSeedNo valid layout was found within Max Plan Attempts. Call Generate again with another seed.

A player or actor that starts after the dungeon is built will miss On Dungeon Built. Check Is Built right after binding, as the demo character does.

Piece interface: BPI_DRP_Piece

Every piece implements this through BP_DRP_PieceBase.

Interface functionWhat it's for
Get Spawn PointsReturns the world transforms of the Arrow components under the piece's SpawnPoints component.
On Piece Built (Cell Type, Danger)Called on each piece after it spawns. Override it in your pieces to add props, lights or variation based on room type and Danger.

Using your own art

The grey-box pieces are placeholders. Each one is a child of BP_DRP_PieceBase, so you replace the art and keep the logic.

Pieces in the pack

FolderPieces
Pieces/CorridorCorner, Cross, DeadEnd, Straight, TJunction
Pieces/HubsHub_Start, Hub_Boss
Pieces/SpecialSpecial_DeadEnd_01, Special_Straight_01
PiecesDoorPlug (seals openings that lead nowhere), PieceBase (parent of all of them)

Make your own piece

  1. Duplicate the example piece with the same shape (for example BP_DRP_Corridor_Straight), or right-click BP_DRP_PieceBase and choose Create Child Blueprint Class. Duplicating is easier, because the openings are already in the right place.
  2. Add your meshes. Match the example's footprint and the position of its openings. The planner rotates pieces to fit, so the openings must be where the example has them.
  3. Keep the piece centred on 0, 0, 0. A piece built from a corner will spawn shifted by half a cell.
  4. Give your meshes collision (for example BlockAll) so players can walk on them.
  5. Add Arrow components under SpawnPoints wherever enemies or loot could appear. The arrow's forward direction is the facing.
  6. Leave Replicates and Always Relevant ticked (inherited from the base), so clients see the piece.
  7. Select the planner and set your piece in its Pieces settings.

Piece size and orientation

One cell is 1000 × 1000 units at the default Cell Size (the example floor is the engine Cube scaled 10 × 10 × 1). Build each piece in the Blueprint editor at rotation 0, with its openings facing as below. +X is the red arrow (north) and +Y is the green arrow (east). The planner turns pieces in 90° steps to fit each cell.

ShapeOpen sides at rotation 0
DeadEnd+X (north)
Straight+X and −X (north and south)
Corner+X and +Y (north and east)
TJunction+X, +Y and −X (north, east and south); closed on −Y (west)
CrossAll four sides

Replace BP_DRP_DoorPlug's mesh with your own wall or closed door.

The colours come from M_DRP_Grid and its instances (MI_DRP_Grid_Start, _Boss, _Corridor, _Special, _Trap, _DoorPlug). They're there to make room types easy to tell apart while you build.

Spawning enemies and loot

BP_DRP_DemoSpawner (in Demo/Blueprints ) is a complete, commented example. It places a marker on every spawn point; replace the marker class with your own enemies or pickups.

The pattern, all on the server:

  1. On BeginPlay, use Switch Has Authority and continue only on Authority.
  2. Get the planner and Bind Event to On Dungeon Built.
  3. Right after binding, check Is Built. If it's already true, run your spawn logic straight away.
  4. In the spawn logic, destroy anything you spawned last time. Clear Dungeon only removes what the planner spawned, not your actors.
  5. Call Get All Spawn Points, loop over the result and Spawn Actor from Class at each transform.
  6. Keep the spawned actors in an array, so step 4 can clean them up after the next build.
  7. Tick Replicates on whatever you spawn, so clients see it.

Targeting specific rooms

Traps

The pack includes one example trap, BP_DRP_Trap_Box: a box that damages whatever touches it. Higher Danger places more traps.

How it works

BP_DRP_TrapBase has a DamageBox collision component set to overlap. When something overlaps it, the trap checks it's on the server and calls Apply Damage with its Trap Damage value. Damage happens once each time something starts touching it.

Make your own trap

  1. Right-click BP_DRP_TrapBase and choose Create Child Blueprint Class, or duplicate BP_DRP_Trap_Box.
  2. Add your mesh, and resize DamageBox to cover the dangerous area.
  3. Set Trap Damage.
  4. Add your trap to the planner's Trap Classes list in its Pieces settings.

Taking damage

The trap uses Unreal's standard damage system, so anything with an Event AnyDamage receives it. BP_DRP_DemoCharacter shows a simple health setup. The actor being hit needs a collision component that generates overlap events; a Character's capsule does by default.

Multiplayer

The server plans and builds the dungeon, and clients receive the result. Clients never generate anything themselves.

Putting players in the dungeon

The demo character shows one way to do it. On the server, each character binds to On Dungeon Built and moves itself to the Start hub's EntryPoint arrow, with a small random offset so players don't overlap. It also checks Is Built when it spawns, which covers late joiners. Look at Go To Start in BP_DRP_DemoCharacter.

The pack was tested with a listen server and two players in Play In Editor.

Large dungeons

Always Relevant keeps every piece updated on every client. That's simplest and is fine for most dungeon sizes. For very large dungeons, you can untick it on your pieces and let Unreal's normal distance-based relevancy decide what each client receives.

Regenerate key, debugging and AI navigation

Regenerate key (F9)

While testing, the host can press F9 to build a new dungeon with a random seed. It's meant for development.

The demo's Up and Down Arrow Danger keys live in the demo map's level Blueprint, not in the planner.

Debugging

Dungeon Route Planner with Show Debug Plan ticked: colour-coded lines draw each planned route over the grey-box dungeon, with progress messages listed in the top-left corner

AI navigation

The dungeon is built at runtime, so the navigation mesh has to be built at runtime too.

  1. Choose Edit > Project Settings > Navigation Mesh and set Runtime Generation to Dynamic.
  2. Place a Nav Mesh Bounds Volume that covers the whole area the dungeon can use (from the planner's position, in +X and +Y).
  3. Spawn AI after On Dungeon Built, and give the navigation mesh a moment to rebuild before AI start moving.

Limitations

Version 1.0 is deliberately focused. Knowing the limits up front saves time.

How to add multi-cell rooms

This is an advanced change to BP_DRP_Planner. The Boss hub already does everything a large room needs (reserving cells, exposing doors, being reached by routes, spawning once), so the method is to copy how the planner handles the Boss hub. Make a backup or commit before you start.

How the planner stores a dungeon

1. Build the room piece

  1. Create a child of BP_DRP_PieceBase, for example BP_MyGame_Hall_2x2.
  2. Make its footprint a whole number of cells (2 × 2 cells is 2000 × 2000 units at the default Cell Size).
  3. Centre it on 0, 0, 0, the same way BP_DRP_Hub_Boss is centred.
  4. Leave an opening in the wall of every cell that can be a door, and add Arrow components under SpawnPoints.

2. Add a cell type and settings

  1. Open E_DRP_CellType and add a new entry at the end, for example LargeRoom. Adding at the end keeps existing values unchanged.
  2. In the planner, add variables in the Pieces category: Large Room Class (class of BP_DRP_PieceBase) and Large Room Size (IntPoint, for example 2, 2).
  3. Optionally add an Easy/Max pair in Generation, such as Large Rooms Easy and Large Rooms Max, blended by Danger like the other pairs.

3. Reserve the cells in Plan Dungeon

  1. Open Plan Dungeon and find where Boss Centre and Boss Door Cells are chosen. Do the room's work right after the Boss hub is placed and before routes are carved, so routes treat the room as an obstacle.
  2. Pick a centre for the room using the planner's Stream (random from the seed), so the same seed always gives the same room. Never use the plain Random nodes; they break seeds.
  3. Reject the spot if any of its cells are already in Cells, are outside the grid, or are within Safe Radius of the start. Try again a limited number of times, as Start Tries does.
  4. Add every cell of the room to Cells with Type = LargeRoom.
  5. Choose one or more door cells on the room's edge, and keep them in a new array, for example Large Room Door Cells.

4. Connect the room

  1. Give each door a corridor. The simplest way is to carve a passage from the door to the nearest existing corridor cell, the same way connectors are carved (respect Connector Max Len and Passage Tries).
  2. Mark the door side of the edge cell as open, and the matching side of the corridor cell next to it, so Is Side Open agrees from both directions.
  3. If the room must always be reachable, add its door cells to Check Reachable, in the same loop that checks Boss Door Cells. A plan that can't reach it will then be retried.

5. Build it in Build Dungeon

  1. In the per-cell spawn loop, skip cells whose Type is LargeRoom, the same way hub cells are skipped, so no corridor pieces spawn inside the room.
  2. After the loop, spawn Large Room Class once at the room's centre: the planner's location plus (centre X × Cell Size, centre Y × Cell Size). For an even-sized room the centre is between cells, so add half a Cell Size.
  3. Call Register Piece with the spawned actor, the centre cell and LargeRoom, so On Piece Spawned fires, On Piece Built is called and Clear Dungeon removes it later.
  4. For every possible door that wasn't used, call Spawn Plug to seal it, as the hubs do.

6. Test it

  1. Set a fixed Seed, tick Show Debug Plan and untick Build Rooms. Check the room's cells and doors appear in the debug drawing.
  2. Tick Build Rooms and check the room spawns in the right place, with plugs on the unused doors.
  3. Press F9 many times. Watch for the red "plan failed" message: if it appears often, the grid is too crowded, so lower the room count or raise Grid Size.
  4. Test with two players on a listen server. Your room inherits Replicates and Always Relevant from the base, so clients should see it with no extra work.

Troubleshooting

ProblemLikely cause and fix
Nothing buildsThe planner isn't in the level, Auto Generate On Begin Play is unticked, or Generate is being called on a client.
The dungeon appears off to one sideExpected: the planner is the grid's corner, and the dungeon grows in +X and +Y. Move the planner.
Red "plan failed" messageNo valid layout within Max Plan Attempts. Try another seed or raise Max Plan Attempts, and check every piece slot in Pieces is filled.
Pieces overlap or leave gapsA custom piece isn't centred on 0, 0, 0, or its footprint differs from the example piece.
Openings don't line upA custom piece's openings aren't in the same place as the example piece of that shape.
Clients can't see the dungeonReplicates was unticked on a custom piece.
Get All Spawn Points returns nothingYour pieces have no Arrow components under SpawnPoints, or it was called before On Dungeon Built.
Enemies pile up after regeneratingYour spawner isn't destroying what it spawned last time. Clear Dungeon only removes the planner's own actors.
Traps don't hurtThe hit actor has no Event AnyDamage, its collision doesn't generate overlap events, or Trap Damage is 0.
F9 does nothingYou pressed it in a client window, or Enable Regenerate Key is unticked.

Version, support and contents

Version1.0
EngineUnreal Engine 5.7 and later
TypeBlueprint only, no C++, no plugins
NetworkingServer-authoritative, replicated; tested with a listen server
Platform testedWindows
Supportallen@follysedge.co.uk

Contents of Content/DungeonRoutePlanner

Blueprints/
  Core/        BP_DRP_Planner
  Interfaces/  BPI_DRP_Piece
  Pieces/      BP_DRP_PieceBase, BP_DRP_DoorPlug
    Corridor/  Corner, Cross, DeadEnd, Straight, TJunction
    Hubs/      Hub_Start, Hub_Boss
    Special/   Special_DeadEnd_01, Special_Straight_01
  Traps/       BP_DRP_TrapBase, BP_DRP_Trap_Box
Data/
  Enums/       E_DRP_CellType, E_DRP_Direction, E_DRP_PieceShape
  Structs/     S_DRP_Cell, S_DRP_PieceChoice, S_DRP_PieceSet
Materials/     M_DRP_Grid and six room-colour instances
Demo/          Character, game mode, controller, spawner, marker, input, HUD
Maps/          L_DRP_Demo

Changelog

VersionChanges
1.0First release