Skip to content

UHC computed

Derived UHC Champions statistics, attached as .computed on the raw UHCStats 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).

Scoring, stars and titles

UHC score is kills + wins * 10, summed over the seven scoring modes: solo, team, redVsBlue, noDiamonds, brawl, soloBrawl, duoBrawl. The vanillaDoubles mode is excluded from the score, the star, and the main totals (it only appears in totalsIncludingVanillaDoubles and favoriteMode).

The star level is the index of the first score threshold above the current score. The thresholds (base values times 10) are:

StarScore threshold belowTitle
110Recruit
260Initiate
3210Soldier
4460Sergeant
5960Knight
61,710Captain
72,710Centurion
85,210Gladiator
910,210Warlord
1013,210Champion
1116,210Champion
1219,210Champion
1322,210Champion
1425,210Champion
15unboundedChampion

There are only ten titles; the title index is the star level clamped to 1..10, so stars 10 and above all read Champion.

UHCComputed

The root object returned by computeUHC(raw: UHCStats).

ts
export interface UHCComputed extends UHCTotals {
  readonly starLevel: number;
  readonly starTitle: string;
  readonly KDR: number;
  readonly killsForNextKdr: number;
  readonly scoreForNextStar: number;
  readonly killsPerWin: number;
  readonly headsPerWin: number;
  readonly extraUltimateRatio: number;
  readonly modes: Readonly<Record<string, UHCModeComputed>>;
  readonly totalsIncludingVanillaDoubles: UHCTotals;
  readonly favoriteMode: string;
  readonly perksUnlocked: number;
  readonly mostUsedKit: string;
}
FieldFormula / meaning
starLevelIndex of the first score threshold above kills + wins * 10 (see table above).
starTitleTitle for the star level, clamped to the ten titles (Recruit through Champion).
KDRratio(total kills, total deaths) over the scoring modes.
killsForNextKdrKills needed, with zero further deaths, to reach the next whole KDR.
scoreForNextStarNext star's score threshold minus the current score; 0 at the top (infinite) threshold.
killsPerWinratio(total kills, total wins).
headsPerWinratio(total headsEaten, total wins).
extraUltimateRatioratio(total extraUltimatesCrafted, total ultimatesCrafted).
modesPer scoring mode computed stats, keyed by mode name (solo, team, redVsBlue, noDiamonds, brawl, soloBrawl, duoBrawl). See UHCModeComputed.
totalsIncludingVanillaDoublesThe same six counters summed over all eight modes, i.e. the scoring modes plus vanillaDoubles.
favoriteModeThe mode (of all eight, including vanillaDoubles) with the highest activity score kills + wins + deaths; "" if all are below 0 (floor is -1, so any mode with activity 0 or more can win).
perksUnlockedNumber of keys in raw.perks.
mostUsedKitargMax over raw.kits (kit name with the highest use count); "" if none.
(inherited)All UHCTotals fields, summed over the seven scoring modes.

UHCTotals

ts
export interface UHCTotals {
  readonly kills: number;
  readonly wins: number;
  readonly deaths: number;
  readonly headsEaten: number;
  readonly ultimatesCrafted: number;
  readonly extraUltimatesCrafted: number;
}
FieldFormula / meaning
killsSum of kills across the included modes.
winsSum of wins.
deathsSum of deaths.
headsEatenSum of headsEaten (golden heads eaten).
ultimatesCraftedSum of ultimatesCrafted.
extraUltimatesCraftedSum of extraUltimatesCrafted.

On UHCComputed itself these cover the seven scoring modes; on totalsIncludingVanillaDoubles they also include vanillaDoubles.

UHCModeComputed

Computed per scoring mode (in UHCComputed.modes).

ts
export interface UHCModeComputed {
  readonly KDR: number;
  readonly killsForNextKdr: number;
  readonly winShare: number;
}
FieldFormula / meaning
KDRratio(mode kills, mode deaths).
killsForNextKdrKills needed in this mode, with zero further deaths, to reach the next whole KDR.
winSharepercent(mode wins, total scoring-mode wins): this mode's percentage of the player's wins (0 to 100).

computeUHC

ts
export function computeUHC(raw: UHCStats): UHCComputed;

Builds the whole computed block from the parsed UHCStats.

Released under the MIT License.