Treasure of Tarmin Dungeon Generator

Dungeon generator for Dungeons and Dragons: Treasure of Tarmin (1982).

HTML5 canvas figure.

Treasure of Tarmin is a first-person Intellivision dungeon crawler. It generates its random dungeon from a set of hand-authored templates. Brown doors are normal doors and grey ones are hidden.

How it Works

Compared to a dungeon generator like Hack, Tarmin’s generator feels a little less procedural. It starts with pool of sixteen chunks of dungeon that it arranges and flips to create the random level. It’s still an effective technique but one that’s going to have more authored results.

The Chunks

Each dungeon is built from these sixteen chunks, hand-made by the original developers.

HTML5 canvas figure.

The High Level Algorithm

The workspace is 12 by 12 tiles. Then each of the chunks is 5 by 5. Here’s how it fills up up the space to make a level:

  1. Pick four chunks from the pool. You can pick the same type more that once.
  2. Place each chunk in the center of the workspace to form a central quad, with a 1 tile gutter running a long the perimeter.
  3. The chunks are the mirrored in a deterministic way.
    1. North East - same as the reference
    2. South East - mirrored vertically.
    3. South West - mirrored vertically and horizontally.
    4. North West - mirrored horizontally.
  4. Then there’s a corridor that encloses the four chunk quad. And that uses up the full workspace.
  5. Finally the rooms are linked to each other and the corridor.
    1. There are fixed linked points and a plain, secret or open passage is chosen for each.

Example floors

The concentric ring room shows up here, it's a sealed chamber except for a doorway on each side.
The concentric ring room shows up here, it’s a sealed chamber except for a doorway on each side.
Twin tunnels forming a junction appear here as the top-right chunk.
Twin tunnels forming a junction appear here as the top-right chunk.
**U-shaped** chambers double back on themselves into cul-de-sacs you leave the way you came in.
U-shaped chambers double back on themselves into cul-de-sacs you leave the way you came in.
A level with slightly more boxy rooms.
A level with slightly more boxy rooms.
A door-heavy floor, with a couple of **secret doors** (grey) tucked among the plain ones (brown).
A door-heavy floor, with a couple of secret doors (grey) tucked among the plain ones (brown).
A map with a mirrored chunk.
A map with a mirrored chunk.
A room with lots of doors, wall and pocket areas.
A room with lots of doors, wall and pocket areas.

← All Sparks