Skip to content

feat(practice): ghost replay system — play against the dead#379

Draft
stephenkirk wants to merge 35 commits intodevfrom
practice-2
Draft

feat(practice): ghost replay system — play against the dead#379
stephenkirk wants to merge 35 commits intodevfrom
practice-2

Conversation

@stephenkirk
Copy link
Member

@stephenkirk stephenkirk commented Mar 18, 2026

Why

Practice mode had no opponent. You could test builds against vanilla blinds, but the PvP blinds — the part that actually matters — required a second human. Ghost replays let you practice against recorded match data instead.

Summary

  • Parse Lovely log files (or pre-built JSON) into ghost replay tables containing per-ante enemy scores, metadata (seed, stake, deck, ruleset, gamemode), and player names.
  • Two-column replay picker UI: match list on the left, detail panel with joker sprites on the right. Supports perspective flipping (play as either side).
  • Ghost PvP rounds auto-resolve locally using recorded scores instead of waiting for network messages. All network actions suppressed in ghost mode.
  • Log parser available as both in-game Lua (lib/log_parser.lua) and standalone Python/HTML tools (tools/).
  • Match history recording (lib/match_history.lua) stores completed MP games as replayable ghost data.

Isolation fixes

  • action_start_game clears MP.SP.practice and MP.GHOST on both host and client paths, preventing stale ghost state from leaking into real MP.
  • ease_ante event suppression patch extended to ghost mode, fixing double ante increment.
  • Ghost replay gamemode stored on MP.LOBBY.config and similar still needs migration to MP.GHOST.gamemode to prevent config bleed into subsequent lobbies.

What it doesn't do

  • Server-side replay recording. Ghosts are client-derived from logs or local match history.
  • Replay playback (watching hands play out). This is score-only ghost data.
  • Validate that the ghost's ruleset/gamemode matches your practice config.

Test plan

  • Load ghost replay → start practice run → PvP blinds use ghost scores
  • Flip perspective → ghost scores swap correctly
  • Back out of ghost picker → create real MP lobby → verify no ghost state leaks
  • Join as client → verify no ghost state leaks
  • Ghost mode ante progression increments by 1, not 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant