Roguelike design — and the Tunnel Rat concept
How to build a roguelike on the Deckline: what the genre actually is (factored, so you can pick the parts), the fairness ethic that makes permadeath fun, the grid tactics, the constrained-glyph bestiary, item identification, and the keyboard-first quality-of-life aids — then a worked candidate cart, Tunnel Rat.
Sources: John Harris, Exploring Roguelike Games (CRC Press, 2021) — the practical bible; and the IJEMS 2022 player-psychology paper (permadeath as the engine of meaning; the frustration→mastery loop is the retention mechanic).
Authority / neighbours: world-engine.md (procedural worlds), maps.md (tunnels are a .map), ADR-0047 (the experience tier — the drone loop), ADR-0045 (the pursuit substrate — ICE), synthesis-atari-graphics.md (mono→dither; the pursuit-AI mechanic), screen-design-rules.md. Build task: GWP-674.
0. Why roguelikes fit the Deckline
Section titled “0. Why roguelikes fit the Deckline”Almost every defining roguelike trait is something the deck already is:
- Procedural worlds → the World Engine (“random within form”).
- Grid-based → the 128×75 cell grid; entities take one cell.
- ASCII display → amber-on-black is the roguelike native look, not a retro affectation.
- Turn-based → fits a keyboard-first, contemplative deck (no twitch reflexes; you take your time).
- Permadeath → maps onto the run/save model; loss is the point, not a bug.
The IJEMS paper’s takeaway: permadeath + difficulty + scarce saving turn play into a journey where the player cycles blame → anger → negotiation → acceptance → mastery. That arc is the retention loop. The deck is built for exactly this kind of deliberate, high-stakes play.
1. What a roguelike is — the Berlin Interpretation
Section titled “1. What a roguelike is — the Berlin Interpretation”The canonical definition is factored, not a checklist (Harris Ch. 7). It splits traits into High- and Low-value factors, and explicitly accepts that good roguelikes can skip some. Use it to decide which knobs a cart turns on.
| Factor | What it means | Deck fit / Tunnel Rat |
|---|---|---|
| Random environment (High) | World generated for replayability; item placement random | ✓ World Engine generates the tunnels |
| Permadeath (High) | Start over on death; saves are “suspend saves,” deleted on load | ✓ run model |
| Turn-based (High) | One command = one action; not time-sensitive | ✓ recommended for the deck |
| Grid-based (High) | Uniform tile grid; one entity per tile | ✓ cell grid |
| Non-modal (High) | Move/fight/act in one mode; every action always available | aim for it (shops/menus are the usual violations) |
| Complexity (High) | Several solutions to a goal via item/monster/item-item interactions | the design target (tool/ICE interactions) |
| Resource management (High) | Manage limited resources (food, potions) | ✓ drone power / heat / bandwidth |
| Hack’n’slash (High) | Killing things matters; player-vs-world (no monster/monster diplomacy) | ✓ ICE are obstacles |
| Exploration & discovery (High) | Careful exploration + learning unidentified items, anew each run | ✓ the core loop |
| Single-player / ASCII / dungeons / numbers / monsters-like-player / tactical (Low) | Nice-to-haves; Harris discounts ASCII as a priority | mostly ✓ by default |
Roguelike vs roguelite: Harris reserves roguelike for terminal/turn-based games with randomized worlds + permadeath; roguelite for games that keep randomization + permadeath but drop turn-basis (action/real-time). For the deck, lean roguelike (turn-based) — it suits keyboard-first contemplative play. (This is a per-cart decision; see §7.)
2. The design ethic: fairness under permadeath
Section titled “2. The design ethic: fairness under permadeath”Permadeath only feels fair if the game is designed for it. The dictum (Harris Ch. 6), worth memorizing:
The First Law of Roguelike Design: Provided reasonable play, the player’s character should not be killed or suffer great permanent harm in one attack.
“Reasonable play” = the developer’s intended normal style — not paranoid play (searching every tile against instadeath traps). Corollaries:
- Critical moments. Most turns aren’t dangerous; a few are “in check” — one wrong move ends the run. The craft is making critical moments recognizable and escapable, and never springing an unavoidable one-shot under reasonable play.
- Escape tools. Provide a spread — one-use, multi-use, infinite, equippable — so a cornered player has options (flee, blink, stun, wall-off).
- Push back criticality. Improving state (more HP, speed, vision/detection) makes once-deadly situations survivable. Progression is widening the safety margin.
- Procedural fairness is the author’s burden. Hand-built levels can avoid unfair setups; a generator can’t, so the rules (entities, tools, sight) must guarantee survivability across whatever the generator produces. Even “instadeath” monsters in NetHack obey the Law because the player has usually had a chance to gain the relevant defense.
3. Gridland tactics (the moment-to-moment loop)
Section titled “3. Gridland tactics (the moment-to-moment loop)”The genre’s tension lives in grid movement (Harris Ch. 4):
- Diagonals. Diagonal moves cost the same as orthogonal; cut corners (a zig-zag corridor is walked straight diagonally). Enemies exploit this — round a corner into the corner cell and the chaser gets a free hit. Movement is tactics.
- Line of sight — the key primitive. Ranged/caster enemies “cannot attack what they can’t see.” Breaking LOS around a corner forces them to close to melee. On the deck this reskins perfectly: ICE can’t trace what it can’t see — duck behind a node and the sentry has to come to you.
- Doors as a resource → firewalls. A door isn’t just an obstacle; close/lock it to block (handless) pursuers. Reskin: a firewall you raise/lower to wall off a subnet.
- Speed: world-centric, not player-centric. Schedule actors on a tick clock (an actor acts every N ticks) rather than “monsters move per player move.” This is exactly the World Clock — reuse it; it also resists the flee-hit-flee exploit.
- Escape, regeneration, loops. Characters heal fast by resting; flee to a new level to escape (some pursuers don’t follow); kite tough foes around a loop or pillar to heal between hits. “He who fights and runs away, lives to flee another day.”
4. The bestiary in a constrained glyph set (the “Letter Q” problem)
Section titled “4. The bestiary in a constrained glyph set (the “Letter Q” problem)”Roguelikes represent a whole bestiary in ~26 letters — solved with case (upper/lower = different species), color, a few symbols (@ human, & demon, : lizard), and terrain-disguise (mimics, ghosts as blank cells). The constraint becomes a theme (Rogue adds one monster per level; dragons at 22; the Amulet at 26).
The deck has the same constraint, sharper: a mono amber Code Page (256 glyphs) plus the soft-glyph plane, but no colour. So:
- Shape carries the load. With no colour channel, distinguish entities by glyph shape + the legend (the same legend mechanism as
maps.md§4 — tile/entity code → glyph + semantics). - Soft-glyph for custom creatures. Use the soft-glyph plane for bespoke ICE/creature glyphs beyond the Code Page.
- State via inverse / dither. “Alerted,” “damaged,” “cloaked” → inverse video or dither density (mono→dither, per
synthesis-atari-graphics.md), not colour. - Lean into the theme. A constrained roster is a feature: a tight, legible bestiary reads better than a sprawl.
5. Item identification — “part hack and slash, part scientific method”
Section titled “5. Item identification — “part hack and slash, part scientific method””A defining pillar (Harris Ch. 1): unknown items (potions/scrolls/wands) have scrambled-but-consistent appearances within a run — you learn them by experiment (or an identify tool), at some risk. Discovery-anew-each-run is half the replayability.
The cyberpunk reskin writes itself: unidentified exploits / payloads / daemons. A scavenged payload might open a port, heal the drone, or brick it — you don’t know until you run it (or burn a scan tool). Appearances are consistent within the run (“the jagged-sigil payload” is always the same this run). This is the deck-native version of the unknown-potion loop, and it’s the most characterful roguelike pillar — keep it.
6. Quality-of-life travel aids (for a keyboard-first deck)
Section titled “6. Quality-of-life travel aids (for a keyboard-first deck)”Modern roguelikes (Crawl, Harris Ch. 28) remove movement tedium — and the deck, being keyboard-first (the nEmacs lineage), should ship these from the start:
- Auto-explore — pathfind to the nearest unexplored cell, auto-pick-up useful items, halt the instant anything interesting appears (monster/trap/item). Turns the game into a “situation generator,” focusing attention on decisions, not steps.
- Autotravel — go to a known location or branch by pathfinding; cycle stairs/exits by distance.
- Search / stash — remember every item’s location; text-search to recall “where was that payload?”
- Legibility coding → mono: bad/useless/special items distinguished by glyph + inverse + dither (Crawl uses red/gray/white; we use shape/brightness).
These aren’t cheating — when a feature makes you wonder how you played without it, it’s fixing a real friction.
7. The Tunnel Rat concept (a worked candidate, not committed)
Section titled “7. The Tunnel Rat concept (a worked candidate, not committed)”Tunnel Rat — drive a drone through procedurally-generated tunnels to gain access to other ports/networks. A net-infiltration roguelike.
It’s a dungeon crawl wearing a cyberpunk skin, and the reskin is clean:
| Roguelike | Tunnel Rat |
|---|---|
@ adventurer | the drone |
| corridors / rooms | tunnels / nodes |
| dungeon levels / branches | ports / subnets |
| the Amulet (goal) | target data / root access |
| monsters | ICE / sentries / daemons (pursuit-AI, ADR-0045) |
| unidentified items | scavenged exploits / payloads (§5) |
| doors | firewalls (§3) |
| HP / food | drone integrity / power / heat |
| permadeath | the drone is traced and fried — lose the run |
Which Berlin knobs (recommended): turn-based · grid · procedural (World Engine) · permadeath (run) · resource management (power/heat) · complexity (tool↔ICE interactions) · identification (unknown payloads). I.e. a roguelike, not a roguelite.
KN-86 stack ties: tunnels are a .map (maps.md) generated by the World Engine; the drone control loop is an experience-tier surface (ADR-0047); ICE behaviour is the pursuit-AI mechanic (the games-book thread in synthesis-atari-graphics.md, GWP-658); CIPHER can voice the trace/alert flavour.
Open decisions (for Josh, not pre-locked):
- Turn-based vs real-time (roguelike vs roguelite). Recommendation: turn-based.
- Permadeath model — full per-run permadeath vs a run with meta-progression (salvage/reputation carried in Universal Deck State); how a fried drone reconciles with the offline-first save model.
8. Build roadmap (→ GWP-674)
Section titled “8. Build roadmap (→ GWP-674)”A vertical slice, in dependency order:
- Procedural tunnel level — World Engine → a
.map(cave/BSP/drunkard’s-walk; “random within form”). - Drone movement + LOS — grid move (diagonals), line-of-sight as the core tactical primitive.
- ICE archetypes — 2–3 behaviours on the pursuit-AI (chaser, ranged/tracer that LOS-breaks defeat, sentry).
- One unidentified-payload interaction — the scientific-method hook.
- Trace / permadeath fail state.
- QoL — auto-explore at minimum.
Deps: the map system (GWP-672), the mechanics/pursuit-AI (GWP-658), the World Engine, the experience tier (ADR-0047).
9. How agents should use this guide
Section titled “9. How agents should use this guide”- Designing any roguelike/roguelite cart? Start from the Berlin factors (§1) — decide which knobs, don’t cargo-cult the whole list. State the roguelike-vs-roguelite choice explicitly.
- Obey the First Law (§2): no one-shot death under reasonable play; make critical moments recognizable + escapable; ship escape tools.
- Grid tactics (§3): LOS is the core primitive (ICE can’t trace what it can’t see); doors=firewalls; reuse the World Clock for world-centric ticks.
- Bestiary (§4): shape + soft-glyph + legend (no colour); state via inverse/dither.
- Keep item identification (§5) — it’s the most characterful pillar, and it reskins to exploits.
- Ship the QoL aids (§6) — the deck is keyboard-first; auto-explore/travel/search are table stakes.
- Tunnel Rat (§7) is a candidate, not a commitment — surface the open decisions before building.