Dissertation, BSc Games Computing, University of Lincoln · May 2025 · Project page: Dungeon Delvers


A large generated dungeon

The question

Most procedural dungeon generators make flat, single-floor layouts. They work, but they waste the third dimension and tend to give you one long path with dead ends. My dissertation asked: how can procedural generation be pushed to make complex, multi-level 3D dungeons that are actually fun to explore?

Four algorithms, one prototype

The original plan was ambitious: build four generators (cellular automata, Perlin noise, wave function collapse and a graph-based method), then playtest all four side by side.

A few weeks in, it was obvious that building, debugging and testing four systems properly wasn’t going to fit. So I changed the plan. I compared the four methods on paper first, looking at connectivity, performance, how well they extend into 3D and how much control a designer gets, and then put all my time into the winner: TinyKeep, a graph-based algorithm. It guarantees every room is reachable without any clean-up pass, which was the big one. One polished prototype beat four half-finished ones.

How it works

The generator runs in stages, and I built debug gizmos for each one so I could watch it happen.

1. Scatter the rooms. Rooms of random sizes are dropped onto each floor and they overlap badly. Rather than write my own separation code, I gave each room a box collider and a kinematic rigidbody locked to X and Z, and let Unity’s physics push them apart until nothing overlapped.

2. Connect everything. I take the centre of every main room and run a Delaunay triangulation over them (red). That gives every sensible connection. Then Kruskal’s algorithm with a union-find picks the minimum spanning tree (blue): the shortest set of links that still reaches every room.


My first spanning tree had a nasty bug: every room connected to something, but the dungeon could split into islands that never joined up. Everything after this step depends on the tree being right, so I rebuilt it until nothing could be left out.

3. Add loops back in. A pure tree means lots of dead ends and backtracking. A “loops” slider adds a share of the unused triangulation edges back, so players can circle round instead of retracing their steps.

4. Carve corridors. Each link is split into an L shape (so corridors line up with the grid instead of running diagonally), then carved tile by tile, skipping anything a room already occupies. Unused rooms are removed, unless a corridor runs through them, in which case they’re kept. That way long corridors pass through interesting spaces instead of being empty tubes.


5. Stack the floors. For each floor, the generator looks for a room lined up with one on the floor below and turns it into a shaft you drop through. When there’s a choice, it picks the one furthest from the previous floor’s shaft, so you have to cross each floor rather than fall straight to the bottom.


A two-floor dungeon

The corridor system I rewrote three times

Corridors were the hardest part.

  • Version 1 had no grid. Corridors spawned from the middle of one room towards the next, and constantly ended up inside other rooms.
  • Version 2 grew each corridor (and its walls) outwards from a midpoint until it hit something. It worked, but it was painfully slow, because everything had to grow gradually so it wouldn’t miss collisions with other floors.
  • Version 3, the final one, tracks every tile in a 3D grid. Corridors only fill free cells, so they can’t overlap rooms and they generate in real time, even on big layouts.


Version 1: corridors from room midpoints, often inside other rooms

The lesson I took from it: if you keep fighting an approach, change the data structure, not the patch.

Tools that saved me

I exposed floors, dungeon radius, cell size and room count as sliders, added panels to toggle every debug view, and built a step-by-step mode that pauses after each stage. Being able to generate, look, tweak and regenerate without recompiling made the whole thing faster to debug.

What players said

Fifteen people played two five-minute sessions and filled in a questionnaire:

  • 13 of 15 found nothing confusing or impassable (I tracked down and fixed the two issues that were reported)
  • 10 of 15 said the layout strongly pushed them to explore
  • 13 of 15 agreed the complexity made exploring more enjoyable
  • The loops and the interconnected floors were the most mentioned highlights, and most people rated navigation “somewhat challenging”, which is about where I wanted it

The most common requests were a mini-map or signposting, a clearer difference between main routes and side loops, and more secrets to find.

What I’d do next

  • A mini-map, and lighting or floor materials that make main routes stand out
  • More than one connection between floors, and a way to climb back up (stairs or lifts instead of drop shafts)
  • More variety: hidden rooms, simple puzzles, and mixing in noise-based chambers for more natural shapes

It’s a foundation more than a finished game, but it does what I set out to prove: graph-based generation can make multi-level dungeons that people enjoy getting lost in.