2026-11-10 · #gamedev #unreal #architecture

A room graph for a roguelite

part of ~/projects/catabasi

Why

Catabasi needed floors that change every run but still feel designed. My first instinct was spatial: place rooms in the world and stop them from overlapping. That’s a hard problem, and it wasn’t the one we had.

What I tried

I stripped the problem down to logic only. No geometry, no overlap, no placement. Each room is a node, each transition is an edge, and rooms have roles instead of shapes. Before writing any code, I designed the role taxonomy and the graph model and asked whether a graph was even the right structure. It was.

That gave a clean split:

  • The plugin (CatabasiLevelGen) takes a seed and the designer’s layout and returns an FLevelGraph. It has no idea Unreal levels exist.
  • The Driver in the game reads the graph and decides what room comes next.
  • The Spawner streams that room’s map and reports where the entry door ended up.

Designers author a layout of slots: Pinned (this exact room), Typed (any combat room) and Free (anything that fits). The generator fills the slots and connects them.

What broke

Baked lighting. Rooms can’t be spawned as actors if their lighting is baked, so every room became its own map, streamed in with dynamic level streaming. Doors then had to snap together. Rotating around a door instead of the room’s origin is one line of math, A’ = P + R(A − P), and it took me longer than I’d like to admit.

What I learned

  • A smaller model of the problem beat a clever algorithm for the big one.
  • Keeping the generator ignorant of the game made it testable, and maybe one day shippable on its own.
  • Writing the architecture down before the code made every later refactor a conversation instead of an archaeology dig.