Capsule: balance
Use when tuning costs, supply, sight, sizes, unit/building stats, or any number a player feels.
Read first
- docs/design/balance.md — balance definitions & constants
- Final source-of-truth map and guardrails
- Client mirror boundary inventory
- §5.1 Target theme and MVP combat loop
- §5.2 Current implementation constants
Code map
server/crates/rules/src/defs.rs— authoritative unit/building stat recordsserver/crates/rules/src/faction.rs— authoritative faction catalogs, train/build/research availability, and Rust-exported ability/command-card metadataserver/crates/rules/src/balance.rs— stable public balance surface; internalserver/crates/rules/src/balance/*.rsmodules group timing, map, economy, supply, body, support-weapon, upgrade, ability, and stat-helper definitionsserver/crates/sim/src/command_budget.rs— sim-owned command admission caps mirrored by the client and checked by faction catalog parityserver/src/config.rs,server/crates/sim/src/config.rs— compatibility shims for local callersclient/src/config.js— stable public facade for the UI/render/fog mirror; internalclient/src/config/*.jsmodules split timing, Rust-owned rules mirror data, faction helpers, and client-owned presentation data
Invariants
- Mirror. Change the Rust rules balance surface and
client/src/config.jsfacade together when the value is visible to the client (cost, supply, sight, size, anything used by HUD/render/fog). Server-only tuning (damage curves, internal timers) stays in Rust rules/sim code. Command budget values stay sim-owned but must continue to match the client exports. - Parity. Run
node scripts/check-faction-catalog-parity.mjsafter client-visible rules, faction catalog, upgrade, ability descriptor/effect, resource amount, or mirrored config changes. /wiki/statsis generated from Rust rules definitions and faction catalogs. Runnode scripts/check-wiki.mjsafter visible rules, catalog, upgrade, or ability metadata changes so the generated reference tables and client catalog mirror are checked together.- Patch notes: collect player-facing bullets as you work (changed stats, economy, combat behavior, UI affordances, expected strategic impact). Factual, evidence-backed; if uncertain, say what changed and what to watch in playtest.
Cross-capsule triggers
- Any rule/behavior change beyond a number → server-sim.md.
- New field on the wire → protocol.md.