← ClaudeAtlas

unity-headless-simlisted

Add a headless, seeded, batch Monte Carlo simulation mode to a Unity game, so thousands of full runs play out with no rendering and the results come back as win rates with 95% confidence intervals. Covers auditing whether the project can be stepped deterministically, adding an external fixed-step driver, a bot runner that plays many runs per process, parallel batch launch with disjoint seeds, aggregation, determinism checks, and an optional decision-replay model. Use when the user wants to measure balance, win rate, difficulty, or build strength in a Unity project by running many games instead of playtesting; mentions Imaginary Space, 虛數空間, 虚数空间, headless, batchmode, nographics, Monte Carlo, mass simulation, bot runs, seeds, or "run 10,000 games".
satan0124/unity-headless-sim · ★ 1 · AI & Automation · score 74
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