Bash.tv → GitHub → itch.io

Evaluate a game's difficulty and balance with evidence instead of gut feeling. Define targets (win rate, run length, time to kill, economy pace), simulate the rules thousands of times with a seeded Monte Carlo runner and parameter sweeps, find cliffs and dominant strategies, check difficulty curves and economy inflation, combine with real playtests and telemetry-style logging, and change one va...

Download skill (.zip) Files on GitHub

Game balance testing

1. Set targets first

Write in docs/GDD.md what “balanced” means for this game, as numbers:

Target Example
First-run win rate 20–40% for a roguelike; 90% for level 1 of a casual game
Run / level length 3–6 minutes
Time to kill (basic enemy) 1–2 s with the starting weapon
Deaths before first win 3–8
Economy Can afford the first upgrade after ~2 minutes
Choice health No option picked more than 2× as often as the next best

2. Simulate the rules (fast, thousands of runs)

Model the core loop in a small module, using the same numbers as config.js (assets/example-sim.mjs shows the shape), then run:

node <skill>/assets/balance-sim.mjs my-sim.mjs --runs 2000
node <skill>/assets/balance-sim.mjs my-sim.mjs --sweep healPerWave=0,1,2        # one parameter, several values
node <skill>/assets/balance-sim.mjs my-sim.mjs --set enemyHp=40 --sweep playerDps=10,12,14

It prints win rate and mean / p10 / median / p90 for every number the run returns. Example output from the example sim: healPerWave=0 → 0%, 1 → 44%, 2 → 100%. That’s a cliff: one point of healing flips the game, so a finer control is needed.

Bots don’t need to be smart: a “decent player” bot (fixed accuracy, simple choices) plus a “bad” and a “great” variant shows the spread. If the game’s rules are pure functions (game-architecture), import them directly instead of re-writing them.

3. Look for

4. Confirm with play

Simulations miss feel. Play it yourself (or the viewer plays it) and log key events to the console in a consistent format: [bal] death wave=4 t=73s cause=bat. Read them with read_preview_console or playwright. Compare against the targets.

5. Change one thing at a time

Change one value, re-run the same sim and seeds, record before → after in the GDD decision log: “enemyDps 0.4 → 0.35: first-run win rate 12% → 31% (target 20–40%).” Update config.js and the GDD together.