Skip to content

Warlords computed

Derived Warlords statistics, attached as .computed on the raw WarlordsStats parser block. It is always present (always-on), computed from the parsed stats alone.

All ratios use the shared ratio(a, b) helper: the result is rounded to 2 decimals, and a zero denominator yields the numerator (K/D convention). percent(part, whole) yields a 0 to 100 value rounded to 2 decimals, with a zero whole yielding 0. neededForNextWholeRatio(n, d) is the extra numerator needed, with the denominator unchanged, to reach the next whole ratio floor(n / d) + 1 (it is 0 when the denominator is 0).

Games played is derived as wins + losses (the parser exposes no combined games counter at the top level); all per-game fields divide by that.

WarlordsComputed

The root object returned by computeWarlords(raw: WarlordsStats).

ts
export interface WarlordsComputed {
  readonly kdr: number;
  readonly killsForNextKdr: number;
  readonly wlr: number;
  readonly winsForNextWlr: number;
  readonly classWlr: Readonly<Record<string, number>>;
  readonly classWinsForNextWlr: Readonly<Record<string, number>>;
  readonly winRate: number;
  readonly kda: number;
  readonly assistRate: number;
  readonly killsPerGame: number;
  readonly mvpRate: number;
  readonly teamColorWinShare: number;
  readonly damageToHealingRatio: number;
  readonly damagePerGame: number;
  readonly healingPerGame: number;
  readonly damagePreventedPerGame: number;
  readonly mostPlayedClass: string;
  readonly flagEfficiency: number;
  readonly avgDominationScore: number;
}
FieldFormula / meaning
kdrratio(kills, deaths).
killsForNextKdrKills needed, with zero further deaths, to reach the next whole KDR.
wlrratio(wins, losses).
winsForNextWlrWins needed, with zero further losses, to reach the next whole WLR.
classWlrratio(class wins, class losses) for every class in raw.classes, keyed by class name.
classWinsForNextWlrPer class: wins needed, with zero further losses, to reach that class's next whole WLR. Same keys as classWlr.
winRateratio(wins, wins + losses): fraction of games won (0 to 1 scale).
kdaratio(kills + assists, deaths).
assistRateratio(assists, kills + assists): share of the player's kill involvements that were assists (0 to 1).
killsPerGamekills / (wins + losses).
mvpRatemvpCount / (wins + losses): MVP awards per game.
teamColorWinSharepercent(winsBlu, winsBlu + winsRed): percentage of team-attributed wins earned on the blue team (0 to 100).
damageToHealingRatioratio(damage, healing).
damagePerGamedamage / (wins + losses).
healingPerGamehealing / (wins + losses).
damagePreventedPerGamedamagePrevented / (wins + losses).
mostPlayedClassThe class in raw.classes with the highest gamesPlayed; "" if there are no classes.
flagEfficiencyratio(flagConquerSelf, flagConquerSelf + flagReturns) from the Capture the Flag mode: share of the player's flag interactions that were own captures rather than returns (0 to 1).
avgDominationScoreratio(domination.totalScore, domination.wins): average Domination score per Domination win.

computeWarlords

ts
export function computeWarlords(raw: WarlordsStats): WarlordsComputed;

Builds the whole computed block from the parsed WarlordsStats (top-level counters, raw.classes, and raw.modes.captureTheFlag / raw.modes.domination).

Released under the MIT License.