Skip to content

Branching DAG map ​

Lemma: A directed acyclic graph of node types between start and end. The player picks a path from a partially visible graph at the start of a run and commits to a sequence of risks. Replaces "string of random encounters" with "chosen route through encounter types."

What it solves ​

The default roguelite shape is "random encounters in sequence." Hades' early prototypes worked that way; so did the original Moonlighter. The problem: each encounter feels like an independent dice roll, and the run feels like things happening to the player.

A branching DAG makes the run feel like the player chose its shape. Every node-choice is a small risk/reward call: take the elite for a relic, skip a rest to hit a shop, detour for the perk you need before the boss. The map turns "what's next?" into "what's my path?"

This is one of the most-imitated patterns in modern roguelites. Slay the Spire popularized it; Monster Train, Inscryption, Across the Obelisk, Wildfrost, Hades (in its softer way), Moonlighter 2 all use variants.

Variants across games ​

GameMap shapeNode typesWhat's revealed
Slay the SpireVertical DAG, 15 floors per actMonster, Elite, Event, Shop, Rest, Treasure, BossWhole act visible from floor 1
Moonlighter 2Horizontal DAG per biomeChest, Event, Potion, Blacksmith, Recipe, Elite, Miniboss, Boss, Ice/Thunder PerkFull biome path visible at start
HadesPer-biome chamber DAG, one chamber visible aheadBoon (per god), Hammer, Gold, Healing, Charon shop, Nectar, biome-specific currenciesJust the next chamber's reward (no whole-biome view); the player commits chamber-by-chamber
Cult of the Lamb2–4 fork DAG per mini-dungeon, ~12 node typesCombat, Mini-boss, Bishop, Tarot, Lore, Recruitment, Shop, Event, Prayer, Graveyard, Resource, Heart, Sacrifice door1–3 layers visible, between Spire's full-map and Hades' one-ahead view. Unique: a node type that takes a named follower from the other loop

Visual contrast ​

Spire's map (DAG node graph) isn't yet captured locally; see the wiki.

Moonlighter 2: Zephyr Fields biome mapCult of the Lamb: mid-Crusade DAG
Moonlighter 2 dungeon map showing DAG of node typesCult of the Lamb's mid-Crusade DAG with a skull boss, tarot tent and combat node
Full DAG visible at the start of the descent. Legend (left) shows the node-type vocabulary.Just the next 2–3 layers visible: between Hades' one-ahead and Spire's whole-act. Dashed-red = previewed branch, teal-solid = committed path, plain grey = available.

Both games make the map a single screen, with all node types in a legend. The player plans the run shape before the first encounter.

When to use this pattern ​

  • Any game with sequential encounters: turn-based, action, deckbuilder, even narrative.
  • When you want player agency over the run shape without committing to per-encounter procedural generation.
  • Genre-fusion games that need to give players a hook into the structure (Moonlighter 2 used the Hades-style map specifically to make the dungeon half feel "chosen" again).

Avoid when:

  • The game is open-world or non-linear by design.
  • Run length is short enough that route-planning doesn't pay off (~5 minutes or less).

Pitfalls ​

  • All paths are equivalent: if the optimal route is "always take the rightmost path," the choice is illusory. Spire and Moonlighter 2 both use procedural variation in node placement to keep this from happening.
  • One node type strictly dominates: if Elites are always worth taking, the DAG collapses to "find Elites." Cost-balance Elites with HP cost or relic-quality variance.
  • Map too readable: if every run's optimal path is computable in 10 seconds, the puzzle is shallow. Random small variations (which Elite, which event resolves to what) reintroduce uncertainty.
  • Map too noisy: if there's no signal, players just rush forward. Some node types should be obvious wins, some should be obvious traps, and the rest should be interesting trades.
  • Forced backtracking: DAGs should mostly enforce forward motion. Allowing backtracking complicates UX and undermines the "this is your path" framing.

Adjacent patterns ​

  • handcrafted-pcg-hybrid: DAG maps are the canonical example of "hand-author the units, randomize the layout."
  • bonus-with-drawback: node choices that lock in a build direction (Moonlighter 2's Ice vs. Thunder perk nodes; Spire's act bosses with their relic choices).

Released under the MIT License.