games/fort-nash: data-driven trail-kit migration + shared-schema dedup

games/fort-nash: data-driven trail-kit migration + shared-schema dedup

#33 in Riparion/riparion-retro — merged 2026-06-12

Summary

Migrates fort-nash to the same data-driven architecture as kaintuck: all content and flow live in an embedded fort_nash.ron interpreted through a per-game trail-kit::fortnash schema module, with a golden-trace oracle (golden_trace_is_stable, 0xc26eed8bea10a5f7) holding behavior byte-identical to the hand-written engine.

Single source of truth. Every scalar, table, coefficient, date, checkpoint, event, outcome, minigame param, score, ending, and menu is data. Code retains only what the effect model deliberately can't express — RNG draws and multi-conditional incident flow (run_special events, rider tactics, gunfight tails, mountain passes, illness/cold rolls). The Terrain enum and all scalar consts were deleted and repointed to scenario().

Shared-schema dedup. Byte-identical trail-kit plumbing is now generic and imported by both games (as Tier already was):

  • SetPiece<G> / SetPieceOption<G> over the per-game Gate enum
  • MinigameSpec<P> over the per-game params enum
  • embed_scenario! macro collapses both scenario_data.rs loaders

Per-game Effect/Outcome/EffectCtx/apply_effects stay separate (justified: kaintuck carries token-substitution state + catastrophe-gate fields fort-nash lacks).

Review hardening.

  • scenario_is_self_consistent validates every event-table Special/Minigame string is launchable and every Die/DieIfBroke cause round-trips through GameOverCause::from_key — a data typo now fails a test instead of panicking mid-game.
  • The generic minigame host renders a recoverable StuckMinigame panel instead of a blank screen on a param/id desync.
  • The Trail "Go hunting" button is shown-disabled-with-hint again (not hidden): SetPieceOption gains disable_gate + disabled_hint.

Test plan

  • cargo test -p fort-nash — 53 pass incl. golden_trace_is_stable + scenario_is_self_consistent
  • cargo test -p kaintuck — 32 pass, golden trace unchanged
  • cargo test -p trail-kit, cargo clippy (zero warnings), cargo check --target wasm32-unknown-unknown for both games

Versions: trail-kit 0.1.0→0.1.2, fort-nash 0.1.4→0.1.6, kaintuck 0.1.3→0.1.4.

🤖 Generated with Claude Code

Last updated 2026-06-13