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).
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!
3-act chain_flags state machine: Act 1 cost -> Act 2 temptation cash-out (flag=9) vs hold (flag=2) -> Act 3 rare payoff
active_chain_continuations priority injection + seen_events dedup: 100% payoff rate vs ~5% in raw shuffled pools
SCENE_ALIASES maps 4 cross-act chains (10 story acts) to 4 master scene assets, cutting art cost by 60%
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
Read https://gameskill.dev/labs/cross-act-events/skill.md and apply this skill to my gameCompanion 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
- 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 -> 9or1 -> 2): Offer a juicy immediate cash-out (e.g.,+22 Gold + Common Relic) that writesflag = 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.
- Persist a lightweight serializable integer dictionary on the run state:
- 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_eventsso no filler repeats within a run.
- 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_smithymeteor_iron_1 / meteor_iron_2 / meteor_iron_3 -> scene_foundrydemon_spring_1 / demon_spring_2 -> scene_demon_springold_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.
- Map multi-act story IDs to shared backdrop asset keys via a static dictionary (
2. Verification Checklist
- Choosing the Act 2 temptation cash-out writes
flag = 9and 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 whenpriorityQueueis enabled. - Regular filler events never repeat within the same run (
seen_eventsdeduplication). - Every chained event ID resolves through
SCENE_ALIASESto a valid shared backdrop key with>= 50%asset reuse savings.
More interactive labs in this track
Drag your hero (with giant exposed greatsword!) across the secret Trigger Box under knee-high grass: toe 2px in = invisible, half a step out = instant alert! Compare MOBA vs Assassin vs AAA Stealth.
Watch 10 enemies surround you at 60fps: compare raw Free-For-All instant melt (1.5s) vs Sifu / Arkham Attack Token queue (max 2 tokens + 340ms parry stagger + outer-ring circling).
Minute-0 blessings are a personality test, not flat RNG! Play the 60fps Canvas shrine: Safe Floor vs Build-Defining (with Slot #1 new-unlock override) vs High-Risk Boss Relic + Curse.
Not to torture you — to kill second-half boredom! Test 4 Zhaoshi Wulin bosses + 3-phase Cangfeng (100 - 70 hard-clamps at 45 HP!), shield-only transitions (never heal), and moveset upgrades.
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.