3 deterministic combat balance lab
forgejo-actions edited this page 2026-07-14 17:23:30 +00:00

Deterministic Combat Balance Lab

What This System Is

The Combat Balance Lab runs authored named encounters without rendering or a game server. It uses the canonical ability catalog, progression stats, character-stat resolver, passive and status-effect systems, enemy combat kits, hydrated mob combat projections, resistance/defense formula, and encounter wave definitions.

The lab answers whether an encounter is mechanically viable and whether a content change moved its measurable balance outside an accepted range. Fixed seed batches make every result reproducible.

How Authors Use It

  1. Open Simulation & Debug in the viewport.
  2. Enter a named encounter id under Combat balance encounter.
  3. Select Run Balance Lab for the registered fixture or a generated default fixture.
  4. Inspect completion, survival, and resource-readiness bars plus the scrubbed report/timeline.
  5. Select Level Matrix to compare one level below, at, and above the encounter recommendation.
  6. Select Strategy Matrix to compare authored build intentions and their selected equipment.
  7. Select Run Affected Balance to execute only registered encounters reachable from the current content-chain root.
  8. Select Record Baseline after intentionally accepting current metrics, then Save Balance Fixture.
  9. Select Run All Balance for the complete registered regression suite.

Fixture JSON can also be copied for review. Simulation results are projected to the Event Console with spawning and quest/content categories.

Rules And Invariants

Runs are deterministic by seed and should not depend on rendering, navigation, animation timing, or live server state. Baselines are explicit authoring decisions and should change only when balance intentionally changes.

Deterministic Runtime

Each seed executes encounter waves in authored order and preserves player health and resources between waves. The simulator:

  • resolves player health, mana, stamina, attack power, defense, critical chance, and weapon damage through progression and character-stat aggregation;
  • projects the selected authored loadout and pays canonical stamina/mana costs;
  • applies authored cooldowns and passive ability modifiers;
  • resolves deterministic critical hits, ability status applications, stack consumption, damage-taken modifiers, life steal, and passive procs;
  • materializes enemies from encounter archetypes and hydrated mob combat projections;
  • selects enemy actions with the canonical deterministic weighted combat-kit resolver;
  • applies projected attack damage through the shared defense/resistance formula;
  • records XP, gold, deterministic item drops, wave timing, action usage, passive procs, status uptime, resource starvation, and an action timeline.

The headless model assumes actors are in the combat kit's preferred range and does not simulate navigation, collision, animation timing, projectile travel, player input mistakes, or rendering. Those remain local-playtest concerns.

Metrics And Assertions

Batch reports aggregate:

  • completion and survival rate;
  • average duration, damage dealt/taken, and healing;
  • resource-starvation percentage;
  • ability and enemy-action usage, total amount, and critical count;
  • passive proc counts and status uptime;
  • experience and gold per minute.
  • average XP, gold, and deterministic item rewards per completed batch run.

Fixture assertions can bound completion, survival, duration, one ability's damage share, resource starvation, required enemy actions, status uptime, and simulation errors.

Baselines

A recorded baseline stores average duration, completion rate, survival rate, and damage taken with an allowed percentage tolerance. Completion and survival may not fall below the tolerance floor; duration and damage taken may not exceed the tolerance ceiling. Baseline failures are reported separately from authored assertions.

Baselines are intentionally explicit. Recording one is an authoring decision and saving it updates the fixture under assets/gameplay/combat_balance_fixtures.

Scenario Sandbox Integration

Scenario fixtures can set automation.simulate_combat to true. Every encounter reached by that scenario is then run through its registered balance fixture. The Scenario Sandbox succeeds only when dependency validation, state-machine execution, scenario assertions, and all combat balance gates pass.

Build Strategy Matrix

The strategy matrix evaluates each compatible authored build profile, selects its highest-scoring level-compatible tool, applies that equipment to the combat build, and runs the same deterministic encounter batch. Selection explanations and combat metrics are reported together so designers can distinguish a scoring problem from an encounter-balance problem.

Examples

A named encounter can be tested one level below, at, and above its recommendation. If completion collapses only one level below, the encounter may still be acceptable; if completion collapses at the intended level, adjust enemy kits, rewards, or player progression inputs.

Validation And Debugging

cargo test -p aether-world-domain combat_balance --lib
cargo test -p aether combat_balance --lib

The editor's dependency-aware action provides the content-facing equivalent: it traverses the content graph and runs only affected registered fixtures.