Skill Chain
godot-resource-data-patterns β godot-economy-system β
(godot-combat-system | godot-rpg-stats | godot-game-loop-waves) β
godot-monte-carlo-balancer β godot-testing-patterns β godot-builderThe Iron Law: Source-Extracted, Zero Config
No hand-copied numbers in the sim. Parse Resources / source at startup so the next run reflects designer edits.
Abstract Model (mandatory Phase 0)
| Abstraction | Meaning | If absent |
|---|---|---|
| Session | Bounded attempt | β |
| Threat | Pressure toward fail | delete |
| Defense / agency | Player levers | delete |
| Faults | Attention taxes | delete |
| Resources | Consumable flow | delete |
| In-run economy | Session spend | delete |
| Meta economy | Shop / unlocks / prestige | delete |
| Grade | Stars / rank / time / score | delete |
Write BALANCE_PLAN.md. Simulate only mapped rows.
Progressive disclosure
MANDATORY: Read the linked reference before implementing that phase.
Do NOT Load:
example-lane-defense.mdβ unless Phase 0 maps to lane-defense / shift TD06-genre-adaptation.mdβ unless genre β default PvE win%-band session07-godot-calibration.mdβ only when starting calibration or Phase 0 did not waive physics/AI (waiver = fully formulaic math-only game, documented inBALANCE_PLAN.md)
Phase 0 β Audit β references/00-game-audit.md
Genre, win/fail, modes, catalog, influence graph, economy, styles + primary metric, extraction plan. Confirm with designer.
Phase 1 β Extract β references/01-source-extraction.md
Resource-first decision tree; inspect before any simulate.
Phase 2 β Sim β references/02-simulation-engine.md
Behavioral PlayStyle Γ InputModel (mouse/touch/gamepad), SessionModel for mobile, seeded SmallRng, rayon over independent jobs.
Phase 3 β Analyze β references/03-analysis-reporting.md
Wilson/bootstrap CI verdicts; secondary agency checks; stable JSON.
Phase 4 β Economy β references/04-economy-retention.md
Careers, farms, interest curve, reward-cadence checkpoints.
Phase 5 β Tune β references/05-tuning-generation.md
Band-scored bruteforce; emit .tres when the project is Resource-first.
Phase 6 β Genre β references/06-genre-adaptation.md
Metric overrides + Domain Skill chains.
Phase 7 β Calibrate β references/07-godot-calibration.md
3β5 golden cells vs headless Godot before full-matrix sign-off (unless waived).
Bundled Resources
Canonical layout after copy:
tools/
balance_lab.ps1 # from launcher.ps1
balance_lab.sh # from launcher.sh
balance_lab/
Cargo.toml
src/main.rs # clap stubs β expand per Phase 0scripts/balance-lab-template/
Copy Cargo.toml + src/ into tools/balance_lab/. Place launchers as tools/balance_lab.ps1 / tools/balance_lab.sh (siblings of the crate dir).
scripts/compare_balance_snapshots.py
CI-aware snapshot diff.
references/json-schema.md
Stable --json field contract.
CLI Contract
balance-lab inspect
balance-lab simulate --level 3 --style average --runs 1000
balance-lab career --style casual --runs 200
balance-lab mode <key> --runs 500
balance-lab bruteforce --level 4 ...
balance-lab gen-level ...
balance-lab calibrate --cells golden.json
balance-lab --json <any command>
balance-lab --seed 42 <any command>Target Bands (default; Phase 0 overrides)
Bands are defined per style Γ input_model cell. Default input model is mouse.
| Style | Input | Win-rate target | Below β | Above β |
|---|---|---|---|---|
| afk | mouse | 5% β 55% | TOO HARD | TOO EASY |
| casual | mouse | 55% β 90% | TOO HARD | TOO EASY |
| average | mouse | 70% β 95% | TOO HARD | TOO EASY |
| pro | mouse | 90% β 100% | TOO HARD | β |
| afk | touch | 5% β 55% | TOO HARD | TOO EASY |
| casual | touch | 55% β 90% | TOO HARD | TOO EASY |
| average | touch | 65% β 92% | TOO HARD | TOO EASY |
| pro | touch | 85% β 100% | TOO HARD | β |
A level is only OK when every simulated style Γ input_model cell lands inside its band. Difficulty must come from the level curve, not from punishing input speed alone.
Platform Rule: If the game ships on mobile, the matrix MUST include touch input models. A level that is OK on mouse but TOO HARD on touch is TOO HARD.
CI verdict law (single source of truth)
| Mode | Runs/cell | OK rule |
|---|---|---|
| Search / working | 100β300 | 95% CI overlaps band; else TOO_HARD / TOO_EASY / INCONCLUSIVE |
| Sign-off / DoD / snapshot | β₯1000 | 95% CI fully β band for every style Γ shipped input model |
Fighting / educational / idle often replace win% β set primary metric in Phase 0.
NEVER Do
Data & Extraction
- NEVER hardcode game numbers or skip existing Resources /
.tresβ hand copies rot into false conclusions; regex farms on Resource projects fight the data layer. Resource-first; regex only for inline formula coefficients. Flag every(default!)ininspectbefore the first simulate. - NEVER skip embedded formulas β extract coefficients; one reimplementation in sim. Shape change must fail the regex loudly.
Simulation Fidelity
- NEVER simulate only optimal play β a pro-only PASS ships an unplayable floor; AFK/casual failures are the bug players feel.
- NEVER model humans as instantaneous β zero-delay agents clear jam/fault windows real players miss; difficulty collapses into twitch gates.
- NEVER reuse desktop reaction/tap parameters for mobile β touch has lower taps/sec, higher miss chance, and occlusion; balancing against mouse numbers ships an unplayable mobile game.
- NEVER assume uninterrupted sessions on mobile β model interruptions (notifications, app switching) and session-length caps; a level requiring 12 minutes of unbroken attention fails the platform.
- NEVER let precision-dependent mechanics go untested on touch β any mechanic requiring accurate/fast pointing must be simulated with the touch accuracy model before sign-off.
- NEVER skip meta-game β omit shop/upgrades/modes/replay β βbalancedβ sessions with broken careers.
- NEVER use unseeded or
HashMap-hashed seed paths β default hasher is process-randomized β false CI diffs across machines/rayon schedules; useseed_for+ stable hash; unit-test determinism. - NEVER share
RunState/RNG across rayon jobs β cross-talk masquerades as balance noise and breaks reproducibility. - NEVER claim mathematical balance from an uncalibrated physics/AI model β Phase 7 or documented waiver; abstract DPS β Godot collisions.
Judging Balance
- NEVER judge by a single average β histograms, downtime, failure-by-kind, resource ratios hide coin-flips vs skill cliffs.
- NEVER verdict on point estimates alone β CI law (search overlap / sign-off β); β₯300 search, β₯1000 sign-off.
- NEVER declare winnable without resource-flow checks β pressure AND income vs consumption (classic starved-but-βbeatableβ bug).
- NEVER balance difficulty and economy separately β clear-time changes currency/minute; re-run careers after difficulty edits.
- NEVER over-nerf a farm without re-checking shop reachability β post-exploit patches often strand the ladder.
- NEVER balance PvP with sole AFKβpro PvE bands β matchup / MMR metrics.
Tuning & Maintenance
- NEVER tune one session in isolation β full matrix + career after changes.
- NEVER accept generated content without sim validation.
- NEVER emit
.gdfactories into a Resource-first project β emit.tres/ Resource shape. - NEVER cache
GameDataacross game-source edits. - NEVER make designers compile manually β self-rebuilding launchers; stale binaries β stale conclusions.
- NEVER stdout-only for agents β
--json+game_data_hash.
Golden path (first engagement)
- Phase 0 β
BALANCE_PLAN.md+ designer lock on bands/metrics. - Phase 1 extract β
inspectβ if unexpected(default!), stop and fix extract (example-lane-defense.md smell). - Phase 2β3: one cell at 300 runs (Search overlap) β full matrix β SignOff β at 1000.
- Phase 4 career β farm/shop flags β Phase 7 calibrate (unless waived) β snapshot JSON.
Definition of Done
inspectverified; no unexpected(default!).- Seed-determinism test passes.
- Phase 7 PASS (or Phase 0 waiver recorded).
- Full matrix (all levels Γ all styles Γ all shipped input models, β₯1000 runs/cell) β every cell CI β band (sign-off law).
- Modes + career: currency/minute OK; no dominant farm; shop reachable.
- Interest curve + reward-cadence checkpoints PASS.
- Regression JSON snapshot committed for CI.
Reference
Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing work to a peer domain β do not preload the whole lattice.
Official Documentation
- Resources β Preferred extract source for GameData (
.tresover regex farms). - JSON β Snapshot / CI balance JSON emit and parse.
- FileAccess β Reading exported balance dumps and golden cells.
- ResourceLoader β Loading designer Resources for extract/calibration.
- Command line tutorial β Headless Godot for Phase 7 calibration runs.
- Unit testing β Determinism tests around seeds and extract.
- OS β Process/env hooks for lab launchers.
- ProjectSettings β Paths and feature tags for CI balance jobs.
- RandomNumberGenerator β Seeded RNG patterns mirrored by the Rust lab.
- SceneTree β Headless scene boot for golden-cell calibration.
- Engine β Time scale / frames for headless sims.
- ConfigFile β Optional designer band overrides outside code.
Related Skills
Prerequisites
- godot-resource-data-patterns β Resource-first GameData before extract regex.
- godot-testing-patterns β Headless runners and golden cells for Phase 7.
- godot-builder β CLI/headless project scaffolding for calibration.
- godot-project-foundations β Repo layout so extract paths stay stable.
Complements
- godot-economy-system β Careers, sinks, and shop reachability inputs.
- godot-combat-system β Damage/health Resources the matrix simulates.
- godot-rpg-stats β Curves and modifiers to extract and tune.
- godot-ability-system β Cooldown/cost loadouts for style matrices.
- godot-game-loop-waves β Wave difficulty bands as sim cells.
- godot-inventory-system β Loot/economy coupling for career sims.
Downstream / consumers
- godot-genre-roguelike β Meta progression win-rate bands.
- godot-genre-tower-defense β Lane-defense style matrices (see example ref).
- godot-genre-idle-clicker β Career/minutes-to-milestone bands.
- godot-genre-fighting β Matchup matrices beyond AFKβpro PvE.
Master
- godot-master β Library router and mirrored module entry for the balance lab.