本文へ移動
cccskills
無料GitHub で公開

gameplay-recording-replay

Build a deterministic gameplay record/replay test artefact for Unity, Unreal, or Godot - record a player session, save it to disk, replay it bit-for-bit, and assert that the resulting game state matches the original. Covers Unity Input System's InputEventTrace API (Enable / Disable / WriteTo / ReadFrom / Replay) for input-level capture, Unreal's Replay System (DemoRec / DemoPlay / DemoStop console commands plus DemoNetDriver + NetworkReplayStreamer, default storage at %LOCALAPPDATA%/{Project}/Saved/Demos) for replication-stream capture, and Godot's community-pattern deterministic-RNG + input-script replay since Godot ships no first-party replay system. Use when authoring a regression-test artefact for player-recorded sessions, building a netcode replay for spectator / esports, or producing reproducible bug repros for cert teams.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qaスター 13(GitHub 13 + cccskills 0)
連携ツールUnity

実行スコア 未検証

インストール方法を見る

含まれるファイル(3)

  • SKILL.md14.7 KB
  • .tessl-plugin/plugin.json982 B
  • references/engine-record-replay-apis.md7.6 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

gameplay-recording-replay

Overview

A deterministic replay artefact is a recorded session of player input or replicated state that can be played back to recreate the original game state. Three reasons games invest in replays:

  1. Regression tests. Record a scripted playthrough; replay it in CI; assert the final state matches the original. Catches physics drift, AI determinism breaks, save-format regressions.
  2. Bug repros. Players record a session; QA replays it inside the build with the bug; cert teams attach the replay to the ticket.
  3. Esports / spectator / clip sharing. Match replays surfaced in-product.

This is a workflow that produces, per engine, a working record/replay setup plus a CI regression test that runs it. The full per-engine record, replay, and CI code lives in references/engine-record-replay-apis.md; this file is the cross-engine decision surface.

The three engine surfaces differ:

EngineRecording surfaceStability of public docs
UnityInput System's InputEventTrace (input-level)Public - com.unity.inputsystem@1.8 API
UnrealReplay System (replication-stream level) - DemoRec / DemoPlay / DemoStopPublic - Replays in Unreal Engine
GodotNo first-party replay - community pattern: deterministic RNG seed + recorded InputEvent scriptCommunity - Godot documentation does not ship a replay subsystem [author opinion, per docs.godotengine.org]

Composes with:

  • unity-test-framework, unreal-automation-system, godot-gut-tests - the host test framework the replay runs inside.
  • multiplayer-state-machine-coverage - Unreal's Replay system shares NetworkReplayStreamer with its multiplayer stack; multiplayer fixtures can replay captured sessions.
  • platform-cert-overview-reference - replays are evidence artefacts for cert (Xbox XR-003 title quality, attaching a repro to a CFR).

When to use

  • Producing a deterministic regression test for a story playthrough / level traversal / damage script.
  • Building an in-product replay feature (spectator mode, instant replay, clip sharing).
  • Producing reproducible repro artefacts for cert teams.
  • Investigating a determinism regression - "this build diverges from the previous build's replay at frame 4823."

How to use

  1. Lock determinism first for the capture level you need - fix the Step 1 sources of non-determinism (fixed timestep, seeded RNG, synchronous loads) before recording anything.
  2. Pick the capture level from the Step 2 per-engine contract table - Unity and Godot capture input (which needs determinism); Unreal captures the replication stream (which does not).
  3. Record and replay with the engine's API - full working code in references/engine-record-replay-apis.md.
  4. Choose the assertion model (final-state hash, per-checkpoint, or per-frame) and wire the replay into a CI regression test (Step 3).
  5. Embed a build hash + replay-format version in the replay header so CI can tell a real regression from a stale replay (Step 4).

Inputs

Gather before walking the workflow:

InputWhereWhy
Engine + versionProjectDetermines which API surface applies
Determinism baselineGame design - is fixed-tick physics on? RNG seeded? AI deterministic?Replays only work when the game's per-frame outputs are functions of (state + input)
Recording scopeInput-only? Full replication stream?Trades off file size against determinism guarantees
Target storage locationApplication.persistentDataPath, %LOCALAPPDATA%/<Project>/Saved/Demos, etc.Where replay files land
Replay length budgetSeconds / minutesInputEventTrace buffer sizing
Assertion modelFinal-state hash? Per-frame? Checkpoint-only?Drives the test harness shape

Workflow

Step 1 - Establish determinism

Replays are worthless if the game is non-deterministic. Before any recording work, lock down:

Source of non-determinismLock-down
Variable timestep / Time.deltaTimeRun physics on FixedUpdate (Unity) / TickGroup (Unreal) with a fixed delta
Unseeded RandomSeed every RNG at session start; record the seed in the replay header
Async load timingForce synchronous load during replay (SceneManager.LoadScene sync; AssetRegistry::Tick to drain)
Multithreaded game logicPin to one thread or commit to ordered consumption of results
Frame-rate-dependent FXTag visual-only systems and skip them in headless replay runs

If you can't lock determinism, replay can still be useful as a visual debug artefact, but it won't drive regression assertions.

Step 2 - Record and replay per engine

Each engine captures at a different level, with a different determinism contract. Pick the row that matches your engine, then lift the working record + replay code from references/engine-record-replay-apis.md.

EngineCapture levelDefault storageDeterminism contract
UnityInput events (InputEventTrace, buffer-sized)Application.persistentDataPath / repo test/Needs Step 1 - replay reproduces input; state matches only if the sim is a pure function of state + input
UnrealReplication stream (DemoNetDriver + NetworkReplayStreamer)%LOCALAPPDATA%/<Project>/Saved/DemosReconstructs the server's streamed view - does not require local determinism
GodotInput events + RNG seed (community pattern)FileAccess path of choiceSame contract as Unity - needs Step 1

The key split: input-level replay (Unity, Godot) depends on determinism; replication-stream replay (Unreal) does not, because the Unreal simulation already ran on the server and the replay just re-streams its output. This is why Unreal replays handle full multiplayer matches while Unity/Godot replays are for pinned single-player.

Step 3 - Wire replays as CI regression assertions

Per engine, the CI loop is:

  1. Check the replay file into the repo under test/replays/.
  2. CI job loads the build, plays the replay, hashes the final game state.
  3. Compare the hash against the baseline (also in repo).
  4. Mismatch → CI fails the build.

The per-engine harness code (Unity [UnityTest] PlayMode fixture, Unreal LatentIt latent command, Godot GUT fixture) is in references/engine-record-replay-apis.md.

Step 4 - Define a fail-safe for replay drift

Real-world replays drift when:

  • The game build version changed and the replay was recorded against an earlier version.
  • A non-deterministic source slipped in (new async loader, new particle system using Random).
  • The save format changed.

The harness must distinguish bug-in-build from replay-stale. Encode the build hash + replay format version in the replay header; CI rejects replays whose replay_format < current_format, then either re-records (acceptable for visual replays) or fails the build (regression test replays).

Worked example - Unity speedrun regression

Inputs:

  • Engine: Unity 6.0, Input System v1.8.
  • Determinism: Physics at FixedUpdate, 60 Hz; RNG seeded from replay header; AI scripted via deterministic state machines.
  • Recording scope: Input-only via InputEventTrace.
  • Storage: Assets/Tests/Replays/level1.trace (committed to the repo).
  • Length budget: 90 s - fits comfortably in 4 MB buffer (recordFrameMarkers = true per the API page).
  • Assertion: SHA-256 hash of GameStateRoot.Serialize() at T=90 s.

Step 1 - physics on FixedUpdate, RNG seeded from replay header, async loads forced synchronous in headless mode.

Step 2 - recorder MonoBehaviour creates InputEventTrace, enables on level start, writes to level1.trace on first level completion.

Step 3 - CI fixture (UTF [UnityTest]) reads the trace, replays it, hashes the final GameStateRoot, compares to the baseline hash committed in Assets/Tests/Baselines/level1.hash.

Step 4 - replay header includes replay_format = 2 and build_hash = <git-sha>. CI fails the build with a clear "replay stale" message when format < 2 rather than silently passing.

Anti-patterns

Anti-patternWhy it failsFix
Recording input without seeding RNGReplay diverges by frame ~30Step 1 - every RNG seeded; seed in replay header
InputEventTrace without Dispose()Memory leak per API page - "must be disposed of … or they will leak memory on the unmanaged (C++) memory heap"Always using / Dispose()
InputEventTrace without recordFrameMarkers = trueReplay reissues events back-to-back instead of respecting timing per API pageSet recordFrameMarkers = true before Enable()
Comparing per-frame state instead of checkpointsFalse-positive failures from float-precision driftHash at coarse-grained checkpoints (every N seconds or per level)
Treating Unreal replays as deterministic input replaysThey're replication-stream replays - different determinism contract per Replays pageDocument the contract; don't assume input-level determinism
Storing replay format version implicitlyReplay-stale failures get misdiagnosed as bugsEmbed replay_format + build_hash in the header
Replays committed without their baselinesAsserting nothingCommit replay.trace + baseline.hash as a pair
Replays > 30 min in CIReplay run time dominates total job timeSplit into checkpointed mini-replays
Replay scrubbing in test fixturesMany engines don't expose deterministic scrubbing for testsLinear playback only in regression fixtures; scrubbing is a feature, not a test surface
Replays storing PIISaved player names / chat messages in attached reprosStrip PII from replay headers before sharing

Limitations

  • Input-level replay (Unity) and replication-stream replay (Unreal) are different contracts. Unity replays depend on determinism; Unreal replays reconstruct the server's view and do not. Don't conflate them in a multi-engine team.
  • Godot has no first-party replay system per the Godot documentation home; the community pattern in Step 2 is sufficient for deterministic single-player but doesn't generalise to multiplayer.
  • Unreal replays bloat with high-bandwidth replication. The .replay file under %LOCALAPPDATA%/<Project>/Saved/Demos grows with replicated-property volume - large open-world games produce GB-scale replays. Use checkpoint-only replays for long sessions.
  • Build-version coupling. Replays recorded against build N rarely play correctly on build N+1 if the netcode / save format changed. Treat the replay file as a build-pinned artefact.
  • No public common exit-code definition for replay-failed states in either Unity or Unreal - parse the test framework's result file (UTF NUnit XML or Unreal automation JSON) for the failure detail, don't rely on engine exit code.
  • No assertion API on Unreal DemoNetDriver replay completion in public docs - the spec / latent-command harness must poll the demo time and time-out. See Replays in Unreal Engine.
  • PII in replays. Player chat, gamertags (per Microsoft XR-046 modern-gamertag display rules), and inventory data can land inside replay attachments - strip before sharing with cert / publisher.

References

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

Builds a CI gate that fails the build on **new** WCAG / a11y violations introduced by a PR while grandfathering pre-existing violations on a per-rule / per-page baseline. Aggregates verdicts from axe-core / pa11y / Lighthouse a11y / WAVE / IBM Equal Access scans. Use when a project has accumulated a11y debt and a strict "zero violations" gate would block every PR - the ratchet pattern lets the team ship while preventing regressions.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

Workflow skill that builds an A/B-test validity checklist from an experiment proposal, walking the canonical design-correctness gates - pre-registered OEC/power/guardrails, randomization unit + SRM check, assignment integrity, telemetry, peeking discipline, novelty/primacy, post-experiment SRM re-check - into a per-experiment checklist + sign-off form. Use when launching, auditing, or governing an experiment. For pitfall mechanics (guardrails, peeking) see experiment-results-interpreter's references; to read an already-valid result use experiment-results-interpreter; for per-SDK harness tests use experiment-sdk-testing - this gates DESIGN, not SDK code.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

The single install-flow skill: the reference contract for the PWA install flow (installability gate fields, `beforeinstallprompt` handshake, per-platform paths - Android WebAPK / iOS Share menu / Firefox no-op - and the `display-mode` post-install signal, in references/install-flow-reference.md) plus the build-an-X workflow that emits the Add-to-Home-Screen suite. Walks the four-stage timeline, emitting one test per gate cell per [web.dev/articles/install-criteria][install-criteria], the deferred-prompt → `prompt()` → `userChoice` chain per [web.dev/articles/customize-install][customize-install], the iOS Safari manual-metadata branch (`apple-touch-icon`) per [web.dev/learn/pwa/installation][learn-pwa], and the post-install `(display-mode: standalone)` MQ assertion. Output: a Playwright spec with per-stage cells plus a coverage matrix. Use when a PWA's manifest, icons, or install handler change, when install conversion drops at an unknown stage, or when triaging a flaky install assertion.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

Build-an-X workflow that uses an LLM to map existing tests to spec sections - given a spec doc + the test suite, the LLM identifies which tests cover which sections, surfaces uncovered sections (gap), and recommends specific tests to add. Output is a coverage matrix per spec ID. Scope is mapping tests that already exist and naming the gaps, not authoring tests for new acceptance criteria. Use when a spec doc and a test suite both exist but nobody can say which requirements are actually covered - before a release sign-off, an audit, or a decision about where to spend the next round of test effort.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

Generates tests from natural-language specs (acceptance criteria, user stories, requirements) using an LLM, with confidence scoring per test case (LLM self-assessment plus heuristics: assertion quality, naming, completeness), batching uncertain cases for human review, and integration with the team's existing test framework. Use when the user asks to generate unit tests from acceptance criteria, convert user stories to test cases, automate test creation from requirements, or augment a spec-driven test suite with AI-generated stubs that are then curated before merge.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

Configures Allure Report (test-runner adapter install, `allure-results` directory wiring, `categories.json` for failure classification, `history-trend.json` retention via the copy-history-between-runs pattern), runs the Allure CLI to convert `allure-results` to a static HTML site, and uploads the report as a CI artifact. Use when the team needs richer test reporting than JUnit XML - step-level attachments, per-test history, retry tracking, and severity / epic / feature labeling across framework-agnostic adapters (pytest, Jest, JUnit, TestNG, NUnit, Mocha). As a rich static HTML report generator, it is the open-source alternative to the sunset ExtentReports (JVM/.NET per-test HTML narrative); for hosted cross-run flakiness analytics rather than a static per-run report use currents-integration.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

testland のスキルをすべて見る

このスキルの問題を報告する