Skip to content

Arena Brawl computed stats

Derived Arena Brawl metrics, attached as the always-on computed property of the raw stats block: whenever player.stats.arenaBrawl is present, player.stats.arenaBrawl.computed is an ArenaBrawlComputed built by computeArenaBrawl(raw) from src/computed/modes/arenabrawl.ts. All inputs are fields of the raw ArenaBrawlStats block (its modes record of ArenaBrawlModeStats, its upgrades block, its datedRatings record, and top-level counters).

Conventions used below:

  • Ratios are bare (not percentages), rounded to 2 decimals. When the denominator is 0 the numerator is returned as-is (K/D convention).
  • *Share fields are percentages from 0 to 100, rounded to 2 decimals; a zero whole yields 0.
  • *ForNext* fields are the additional amount of the numerator stat needed to reach the next whole ratio (floor(num / den) + 1); 0 when the denominator is 0.

ArenaBrawlComputed

The top-level object at player.stats.arenaBrawl.computed. The totals below are summed across every entry of raw.modes: totalKills = sum(kills), totalDeaths = sum(deaths), totalLosses = sum(losses), totalGames = sum(games). Overall wins use the top-level raw.wins counter directly.

ts
export interface ArenaBrawlComputed {
  readonly modes: Readonly<Record<string, ArenaBrawlModeComputed>>;
  readonly totalKills: number;
  readonly totalDeaths: number;
  readonly totalLosses: number;
  readonly totalGames: number;
  readonly overallKdr: number;
  readonly killsForNextKdr: number;
  readonly overallWlr: number;
  readonly winsForNextWlr: number;
  readonly winRate: number;
  readonly killsPerGame: number;
  readonly bestWinStreak: number;
  readonly totalUpgradeLevel: number;
  readonly latestRating: number;
  readonly bestLadderPosition: number;
  readonly mostPlayedMode: string | null;
}
FieldFormulaMeaning
modesone entry per key of raw.modesPer-mode breakdown, same keys as the raw record; see ArenaBrawlModeComputed
totalKillssum(mode.kills for each mode)Kills summed across all modes
totalDeathssum(mode.deaths for each mode)Deaths summed across all modes
totalLossessum(mode.losses for each mode)Losses summed across all modes
totalGamessum(mode.games for each mode)Games summed across all modes
overallKdrtotalKills / totalDeathsOverall kill/death ratio
killsForNextKdrneededForNextWholeRatio(totalKills, totalDeaths)Kills still needed to reach the next whole-number overall KDR
overallWlrraw.wins / totalLossesOverall win/loss ratio (top-level wins over summed losses)
winsForNextWlrneededForNextWholeRatio(raw.wins, totalLosses)Wins still needed to reach the next whole-number overall WLR
winRateraw.wins / totalGamesFraction of all games won (bare ratio, not a percentage)
killsPerGametotalKills / totalGamesAverage kills per game across all modes
bestWinStreakmax(0, ...mode.winStreak for each mode)Highest win streak across all modes, never below 0
totalUpgradeLevelraw.upgrades.cooldown + raw.upgrades.damage + raw.upgrades.energy + raw.upgrades.healthSum of the four skill upgrade levels
latestRatingrating of the raw.datedRatings entry whose month_year key sorts latest (compared as year * 100 + month)Most recent monthly ladder rating; 0 when there are no dated ratings
bestLadderPositionminPositive(entry.position for each datedRatings entry)Best (lowest strictly positive) monthly ladder position ever held; 0 when no positive position exists
mostPlayedModeargMax(mode id -> mode.games, floor 0)Key of the mode with the most games; null when no mode has more than 0 games

ArenaBrawlModeComputed

One entry per key of raw.modes (for example 1v1, 2v2, 4v4), computed from that mode's ArenaBrawlModeStats. The winShare denominator is the top-level raw.wins.

ts
export interface ArenaBrawlModeComputed {
  readonly kdr: number;
  readonly killsForNextKdr: number;
  readonly wlr: number;
  readonly winsForNextWlr: number;
  readonly winRate: number;
  readonly damagePerGame: number;
  readonly healPerGame: number;
  readonly damagePerKill: number;
  readonly winShare: number;
}
FieldFormulaMeaning
kdrmode.kills / mode.deathsKill/death ratio in this mode
killsForNextKdrneededForNextWholeRatio(mode.kills, mode.deaths)Kills still needed in this mode to reach the next whole-number KDR
wlrmode.wins / mode.lossesWin/loss ratio in this mode
winsForNextWlrneededForNextWholeRatio(mode.wins, mode.losses)Wins still needed in this mode to reach the next whole-number WLR
winRatemode.wins / mode.gamesFraction of this mode's games won (bare ratio, not a percentage)
damagePerGamemode.damage / mode.gamesAverage damage dealt per game in this mode
healPerGamemode.healed / mode.gamesAverage healing done per game in this mode
damagePerKillmode.damage / mode.killsAverage damage dealt per kill in this mode
winShare100 * mode.wins / raw.winsPercentage of the player's overall Arena Brawl wins earned in this mode (0-100)

Released under the MIT License.