Combat balancing: headless duel simulator (reuses CombatSystem) + balance-invariant tests #105
Labels
No labels
alpha:wave-0
alpha:wave-1
alpha:wave-2
alpha:wave-3
area:assets
area:combat
area:ecology
area:infra
area:render
area:scripting
area:ui
area:world
enhancement
epic
migration
post-alpha
roadmap
tech-debt
type:bug
type:chore
type:design
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
marco/IsoMmo#105
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
A tool to tune combat safely: it drives the actual server combat code (
CombatSystem/CombatFormulas) in a headless harness, runs many simulated duels for a matchup, and reports the outcome — win-rate, time-to-kill (TTK) distribution, hit-rate, avg damage. It starts from the current production parameters; you tweak one knob (e.g. Swordsmanship skill, STR, weapon damage, swing speed) and immediately see how win-rate/TTK move. Because it reuses the real code, the sim IS production — a formula change shows up here, no drift/reimplementation.Envisioned use (owner): "parte coi parametri attuali; cambio il livello di skill di sword e l'app mi simula una serie di scontri e mi mostra i risultati."
Why
Balance (especially PvP) is only tractable if you can measure it. Closed-form DPS/EHP/TTK gives first-order intuition; the randomness (hit rolls, damage variance, swing timing) needs Monte Carlo. This turns "is this change mathematically sensible?" into a fast objective loop: change param -> simulate -> read win-rate + TTK -> invariants green -> merge.
Scope (MVP)
tools/IsoMmo.CombatSim) that:Mobiles with configurable stats/skills/equipped weapon (defaults from currentGameOptions+ item catalog),CombatSystem) to the death with a seeded RNG,--a str=50 dex=50 sword=70 --b sword=40 --runs=5000 --seed=1.Design notes
CombatSystem/CombatFormulasverbatim — do NOT reimplement the math (the whole point). Likely requires making the combat RNG injectable/seedable so runs are reproducible and the harness runs without the tick loop / networking /World.Mobileinstances + a deterministic clock stepping swing cooldowns; no persistence/AoI needed.SpellSystem) and 1vN.Companion: balance as automated tests
Encode balance goals as xUnit statistical tests over the sim engine (run in CI):
Definition of Done
sword=40vssword=70) visibly shifts the reported win-rate/TTK — demonstrable with two runs.CombatSystem: a deliberate tweak to aCombatFormulasconstant changes the sim output (proves no reimplementation).dotnet test(mirror ~= 50%, bounded TTK, no-dominant-build).Stretch (separate follow-up)
An interactive GUI front-end over the same sim engine (sliders for skill/stat/weapon -> live win-rate/TTK), reusing the headless engine so there is one source of truth.
Notes
Research/foundation for the combat/PvP epic (roadmap #12: M8 combat; fed by #8 M6 stats & skills). The engine is the deliverable; the interactive app is a natural follow-up over the same engine.
Interactive UI mockup of the Duel Lab attached (
duel-lab.zip— unzip and open the HTML). It shows the envisioned console: two fighters as composited real UO paperdolls (body + worn armor + worn sword layered), live win-rate/TTK, TTK histogram, a win-rate heatmap matrix (Sword A x Sword B), a skill sweep curve, and balance-invariant pass/warn/fail chips. The Fighter-A Swordsmanship slider updates the results live. Mock data for now; the real tool drivesCombatSystem.