unity-headless-simlisted
Install: claude install-skill satan0124/unity-headless-sim
# Imaginary Space (虛數空間): Unity headless simulation
Run the game's own code thousands of times with no rendering, a bot at the controls, and a fixed random seed per run. Collect one line per run, then aggregate into win rates with confidence intervals.
The rule that makes this work: **use the game's real simulation code; never write a second copy of the rules** (in Python or anywhere else). A copy drifts from the game silently, and every content change has to be made twice.
Measured on the project this came from (a 2D survivor-like, all logic in C#, no physics): a 15-minute run takes 2 to 3 seconds headless; 10 parallel processes finish about 1,000 runs in under 6 minutes.
## Files in this skill
| Path | What it is |
|---|---|
| `templates/HeadlessRunner.cs` | MonoBehaviour that parses command-line flags, steps the sim inside a per-frame time budget, plays many runs per process, writes `runs.txt` |
| `templates/IHeadlessSim.cs` | The small interface the game implements for the runner |
| `templates/GameLoopPatch.cs` | Before/after example of splitting `Update` so the sim can be stepped from outside |
| `scripts/audit_unity.py` | Scans a Unity project for things that break headless stepping or determinism |
| `scripts/sim_batch.py` | Launches the built player in parallel with disjoint seeds, aggregates `runs.txt`, checks determinism |
| `references/pitfalls.md` | Silent failures found in practice, and how each one showed up |
| `references/decision-model.md` | Optional la