Skip to main content

Cross-Act Chained "?" Events Lab

Stop shipping disposable one-off "?" slot machines that players mash Skip on. Test the 3-layer cross-act event architecture from Zhaoshi Wulin live: a 3-act chain_flags delayed payoff machine with an Act 2 temptation fork (flag=9 termination), 100% active_chain_continuations priority injection verified over 200 simulated runs, and SCENE_ALIASES mapping 10 story acts to 4 reusable scene artworks (-60% art cost).

Act 1·Hook
Act 2·Fork
Act 3·Payoff
flag=0 · UNARMED
Gold
30 G
Upgrades
+0
Payoff Score
0 pts
Act 1 · "?" Question Event Queue Preview⚡ Continuation at #1 (100%)
#1 ⚡
cold_iron_1
#2
Filler ?
#3
Filler ?
#4
Filler ?
Live Engine State X-RaySerializable Run State
chain_flags: { cold_iron: 0 }   // 0=未起 1=埋钩 2=留坯 3=奇宝 9=断链
active_chain_continuations: ["cold_iron_1"]
seen_events: []
SCENE_ALIASES["cold_iron_1"]: "scene_smithy"

Click "Step on Act 1 ? Node" to begin: pay 15G for zero-power Cold Iron and watch the 3-act chain unfold!

200-Run Proof: Does the Chain Pay Off?
⚡ Priority Queue ON100% Complete
🎲 Shuffled in 12-Card Pool8.5% (91.5% lost!)
SCENE_ALIASES · 10 -> 44 Assets · -60%
cold_iron_1 → scene_smithycold_iron_2 → scene_smithycold_iron_3 → scene_smithy10→4
Payoffs 0Cashed 0Sank 0
Roguelike Core Kit ->
01

3-act chain_flags state machine: Act 1 cost -> Act 2 temptation cash-out (flag=9) vs hold (flag=2) -> Act 3 rare payoff

02

active_chain_continuations priority injection + seen_events dedup: 100% payoff rate vs ~5% in raw shuffled pools

03

SCENE_ALIASES maps 4 cross-act chains (10 story acts) to 4 master scene assets, cutting art cost by 60%

04

Includes live 200-run Monte Carlo pool-dilution proof + serializable run-state X-Ray debugger

Installable Agent Skill · Free

Drop straight into Claude Code, Cursor, or Codex

Paste into your AI agent chat
Read https://gameskill.dev/labs/cross-act-events/skill.md and apply this skill to my game
Go Deeper · Companion GameSkill Pro Kit

Companion pack "Roguelike Opening & Narrative Kit" ships runnable JS/TS + Godot 4 (.gd) + Unity (.cs) source code — unlock all 12 multi-engine Pro packs + 84 commercial WAV SFX + 8 2D VFX shaders from $8.25/mo ($99/yr, save 36%) or $12.9/mo.

Full SKILL.md Specification & Verification Checklist

Cross-Act Chained "?" Events Contract

90% of roguelike "?" nodes feel like disposable slot machines: players mash Skip by their second run because choices leave zero memory across acts. Great roguelike events turn a single click into cross-act foreshadowing and payoff.

1. The 3 Mandatory Architecture Layers

  1. Layer 01 — Three-Act Delayed State Machine (chain_flags):
    • Persist a lightweight serializable integer dictionary on the run state: run.chain_flags: Record<string, number> (0 = unstarted, 1 = Act 1 hook planted, 2 = Act 2 temptation resisted, 3 = Act 3 climax completed, 9 = permanently terminated/cashed out).
    • Act 1 (Hook, 0 -> 1): Ask for a small real sacrifice (e.g., -15 Gold) for an item with zero immediate combat power (e.g., Raw Cold Iron).
    • Act 2 (Temptation Fork, 1 -> 9 or 1 -> 2): Offer a juicy immediate cash-out (e.g., +22 Gold + Common Relic) that writes flag = 9 (terminating the chain) versus resisting for a modest temper bonus (+1 Upgrade, flag = 2).
    • Act 3 (Doubled Payoff, 2 -> 3): Reward restraint with a signature Rare Relic + free upgrade.
  2. Layer 02 — Guaranteed Priority Queue Injection (active_chain_continuations + seen_events):
    • Never shuffle active chain continuations back into the regular random "?" pool — in a 12-event pool across 3 "?" nodes per act, Act 2 reach collapses to ~25% and full Act 3 completion collapses below 10% (>90% abandoned stories!).
    • Before rolling from the regular shuffled pool, compute active_chain_continuations(currentAct, run.chain_flags) filtered by !run.seen_events.includes(id).
    • If non-empty, pop the continuation with 100% priority on the first "?" node of the new act, and record every served event ID in seen_events so no filler repeats within a run.
  3. Layer 03 — Scene Asset Aliasing (SCENE_ALIASES, 10 Acts -> 4 Scenes):
    • Map multi-act story IDs to shared backdrop asset keys via a static dictionary (SCENE_ALIASES), e.g.:
      • cold_iron_1 / cold_iron_2 / cold_iron_3 -> scene_smithy
      • meteor_iron_1 / meteor_iron_2 / meteor_iron_3 -> scene_foundry
      • demon_spring_1 / demon_spring_2 -> scene_demon_spring
      • old_board_1 / old_board_2 -> scene_old_board
    • Result: 4 cross-act chains (10 distinct narrative acts) reuse 4 master scene illustrations, cutting event art production cost by 60% while giving solo devs serialized worldbuilding.

2. Verification Checklist

  • Choosing the Act 2 temptation cash-out writes flag = 9 and guarantees Act 3 continuation never spawns.
  • Choosing Act 1 hook (flag = 1) + Act 2 resist (flag = 2) achieves 100% Act 2 and Act 3 delivery across 200 simulated runs when priorityQueue is enabled.
  • Regular filler events never repeat within the same run (seen_events deduplication).
  • Every chained event ID resolves through SCENE_ALIASES to a valid shared backdrop key with >= 50% asset reuse savings.

More interactive labs in this track

Extracted from a real game · Zhaoshi Wulin

Every formula in these labs ships inside our upcoming Steam wuxia deckbuilder

3 martial-arts characters, 39 enemies, 70 relics, 19 kungfu finishers built in Godot with AI agents. Every time we solve a hard design or feel problem, we turn it into an interactive lab and skill here.