Skip to content

Automated beta trace record/replay for gameplay testing#235

Draft
timfox wants to merge 1 commit into
mainfrom
cursor/automated-beta-testing-d22f
Draft

Automated beta trace record/replay for gameplay testing#235
timfox wants to merge 1 commit into
mainfrom
cursor/automated-beta-testing-d22f

Conversation

@timfox
Copy link
Copy Markdown
Owner

@timfox timfox commented Jun 1, 2026

Summary

Adds a chocolate-layer beta trace framework on the client, inspired by Hernández Bécares et al. (An approach to automated videogame beta testing, Entertainment Computing 18, 2017). It supports recording and replaying gameplay for regression testing without relying on a full component/message-passing architecture.

What changed

  • src/client/cl_beta_trace.c: record usercmd_t streams (.betacmd), high-level JSONL events (.betaevt), and test manifests (.betatest); replay via beta_play / beta_test with success/fail pattern matching and max_time_ms.
  • Hooks: cl_input.c (cmd injection), cl_cgame.c (map_loaded events), cl_main.c (init + per-frame timeout).
  • Docs: docs/BETA_AUTOMATED_TESTING.md
  • Examples: examples/demo_game/beta_traces/ including a Petri-net JSON sample for switch-held doors (paper Fig. 10 style).
  • CI: tests/scripts/test_beta_trace_format.sh + CTest test_beta_trace_format

Console API

Command Purpose
beta_record / beta_stop Capture trace under beta_traces/
beta_play Raw usercmd replay (regression)
beta_test Replay + manifest success/fail evaluation
beta_event Log high-level events (mods/scripts)

Cvars: cl_betaTrace (default 1), cl_betaTraceLog (startup log).

Out of scope (follow-up)

  • Full Petri net executor for map-adaptive high-level replay (paper §7) — model file format is documented and validated; runtime navigation AI is not implemented yet.
  • Headless client replay in CI (requires display + game data).

Validation

  • ./tests/scripts/test_beta_trace_format.sh — pass
  • Vulkan client build — idtech3 links with beta_* commands
Open in Web Open in Cursor 

Implement client-side beta trace framework inspired by Hernández et al.
(Entertainment Computing 2017): record usercmds and JSONL high-level events,
replay for regression tests, and evaluate success/fail patterns with timeouts.

Includes documentation, demo_game example traces, Petri net JSON sample, and
CTest format validation script.

Co-authored-by: Tim Fox <timfox@outlook.com>
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.

2 participants