Godot monte carlo balancer

From thedivergentai/GD-Agentic-Skills · View interactive version

Godot monte carlo balancer is an AI agent skill from the GitHub repository thedivergentai/GD-Agentic-Skills. Use when auditing or recalibrating game balance: build a source-driven Monte Carlo balance lab (Rust + rayon) that extracts live game data, simulates human playstyles (AFK→pro), emits win-rate/economy verdicts with confidence intervals, and bruteforce-tunes parameters. Trigger on unfair levels, unre

How to use this skill

Skill file

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-builder

The 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 TD

- 06-genre-adaptation.md — unless genre ≠ default PvE win%-band session

- 07-godot-calibration.md — only when starting calibration or Phase 0 did not waive physics/AI (waiver = fully formulaic math-only game, documented in BALANCE_PLAN.md)

Phase 0 — Audit → [references/00-game-audit.md](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](references/01-source-extraction.md)

Resource-first decision tree; inspect before any simulate.

Phase 2 — Sim → [references/02-simulation-engine.md](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](references/03-analysis-reporting.md)

Wilson/bootstrap CI verdicts; secondary agency checks; stable JSON.

Phase 4 — Economy → [references/04-economy-retention.md](references/04-economy-retention.md)

Careers, farms, interest curve, reward-cadence checkpoints.

Phase 5 — Tune → [references/05-tuning-generation.md](references/05-tuning-generation.md)

Band-scored bruteforce; emit .tres when the project is Resource-first.

Phase 6 — Genre → [references/06-genre-adaptation.md](references/06-genre-adaptation.md)

Metric overrides + Domain Skill chains.

Phase 7 — Calibrate → [references/07-godot-calibration.md](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 0

[scripts/balance-lab-template/](scripts/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](scripts/compare_balance_snapshots.py)

CI-aware snapshot diff.

[references/json-schema.md](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

Simulation Fidelity

Judging Balance

Tuning & Maintenance

Golden path (first engagement)

  1. Phase 0 → BALANCE_PLAN.md + designer lock on bands/metrics.
  2. Phase 1 extract → inspect → if unexpected (default!), stop and fix extract (example-lane-defense.md smell).
  3. Phase 2–3: one cell at 300 runs (Search overlap) → full matrix → SignOff ⊆ at 1000.
  4. Phase 4 career → farm/shop flags → Phase 7 calibrate (unless waived) → snapshot JSON.

Definition of Done

  1. inspect verified; no unexpected (default!).
  2. Seed-determinism test passes.
  3. Phase 7 PASS (or Phase 0 waiver recorded).
  4. Full matrix (all levels × all styles × all shipped input models, ≥1000 runs/cell) — every cell CI ⊆ band (sign-off law).
  5. Modes + career: currency/minute OK; no dominant farm; shop reachable.
  6. Interest curve + reward-cadence checkpoints PASS.
  7. 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

Related Skills

Prerequisites
Complements
Downstream / consumers
Master
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.