The Dashcam Workflow
The dashcam workflow is Theatre's flagship debugging pattern. It mirrors how dashcams work in cars: always recording, you review the footage only when something happens.
The idea
You play your game normally. When a bug occurs, you press a key to mark the moment. Later, your AI agent scrubs through the spatial recording to find what happened — velocities, positions, property states — at the exact frame the bug occurred.
You do not need to narrate the bug to the agent. You do not need screenshots. You do not need to add print statements and replay. The agent reads the spatial timeline directly.
The keyboard shortcuts
| Key | Action |
|---|---|
| F9 | Mark the current frame as a bug moment |
| F11 | Pause / unpause the game |
These shortcuts are active while the game is running. They are handled by the StageRuntime autoload.
You can also click the ⚑ flag button in the top-left corner of the game viewport. From the agent side, use the clips tool's "add_marker" action to trigger a clip save, or "save" to force-flush the current buffer.
A complete debugging session
Here is a real debugging story, from start to finish.
The bug
You have a stealth game. Enemies have a detection cone — an Area3D shaped roughly like a forward-facing triangle. When the player enters the cone, the enemy alerts. But sometimes, enemies that should clearly see the player do not alert. You cannot reproduce it reliably.
Step 1: Play the game
Start the game. The dashcam begins buffering automatically — you will see a small "● Dashcam: buffering" label in the top-left corner of the game viewport. Every physics frame of spatial data is captured into a 60-second rolling buffer.
Play normally. Move around. Do some stealth sections. Wait for the bug to occur.
After about 45 seconds of play, you see it: you walk directly in front of an enemy at close range, the enemy's eyes do not move, no alert. You immediately press F9 (or click the ⚑ flag button). The dashcam saves the last 60 seconds plus the next ~30 seconds as a clip. A toast confirms: "Dashcam clip saved".
Step 2: Start the investigation
Step 3: Query the relevant window
Step 4: Find the cause
Step 5: Confirm with source
Step 6: Apply the fix
The agent opens enemy_patrol.gd, removes the monitoring = false line, and saves. On the next test run, the detection works correctly.
What made this work
- Always-on dashcam: because the buffer was running before the bug, you have data from the moment it began
- Frame marker: pressing F9 gave the agent a precise frame to anchor the search
- Condition filtering: querying only frames where
monitoring == falsefound the transition in one call instead of scanning 2,800 frames manually - Temporal reasoning: the agent found that the flag changed 0.9 seconds before the visible failure — the root cause was upstream of the symptom
Workflow variations
Quick investigation (no marker)
If the bug is obvious and repeatable:
- Trigger the bug in the running game
- Press F9 to save the clip
- Ask the agent: "Something went wrong in the last few seconds. Analyze the latest clip."
Longer buffer windows
The default dashcam buffer holds 60 seconds of pre-trigger history. To extend it, configure the dashcam via the clips tool's status action or project settings:
pre_window_deliberate_sec: seconds of history before a human/agent marker (default: 60)byte_cap_mb: memory limit for the ring buffer (default: 1024 MB)
Post-playtest analysis
After a playtest session:
- Have the tester play normally (the dashcam is always running)
- Have them press F9 whenever something seems wrong
- Collect the clip files afterward
- Ask the agent to analyze all markers across clips
Regression testing
Record a "golden run" of expected behavior. Record a later run where something changed. Ask the agent to compare the two clips for anomalies.