Skip to content

Turbo Kart Racers computed stats

Derived Turbo Kart Racers metrics, attached as the always-on computed property of the raw stats block: whenever player.stats.turboKartRacers is present, player.stats.turboKartRacers.computed is a TurboKartRacersComputed built by computeTurboKartRacers(raw) from src/computed/modes/turbokartracers.ts. All inputs are fields of the raw TurboKartRacersStats block (its maps record, its monthlyPoints record, its periods block of TurboKartRacersPeriodStats, 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.
  • Oscillating (monthly/weekly) fields pick the live A or B bucket for the current date at compute time. Monthly: bucket A when now.getMonth() % 2 === 1 (February, April, June, August, October, December), otherwise bucket B. Weekly: whole weeks elapsed since epoch 1417237200000; bucket A when that count is odd, otherwise B.

TurboKartRacersComputed

The top-level object at player.stats.turboKartRacers.computed. The derived inputs below are plays = sum(map.plays for each raw.maps entry) and trophies = raw.goldTrophies + raw.silverTrophies + raw.bronzeTrophies.

ts
export interface TurboKartRacersComputed {
  readonly totalPlays: number;
  readonly winRate: number;
  readonly totalTrophies: number;
  readonly trophiesPerPlay: number;
  readonly goldTrophyShare: number;
  readonly lapsPerPlay: number;
  readonly boxPickupsPerLap: number;
  readonly coinsPickedUpPerGame: number;
  readonly netBananaHits: number;
  readonly bananaHitRatio: number;
  readonly blueTorpedoHitsPerPlay: number;
  readonly mostPlayedMap: string | null;
  readonly bestMonthlyPosition: number;
  readonly averageMonthlyPoints: number;
  readonly monthly: TurboKartRacersPeriodComputed;
  readonly weekly: TurboKartRacersPeriodComputed;
}
FieldFormulaMeaning
totalPlayssum(map.plays for each raw.maps entry)Total races played, summed across all maps
winRateraw.wins / totalPlaysFraction of races won (bare ratio, not a percentage)
totalTrophiesraw.goldTrophies + raw.silverTrophies + raw.bronzeTrophiesLifetime trophies of all colors
trophiesPerPlaytotalTrophies / totalPlaysAverage trophies (podium finishes) per race
goldTrophyShare100 * raw.goldTrophies / totalTrophiesPercentage of all trophies that are gold (0-100)
lapsPerPlayraw.completedLaps / totalPlaysAverage completed laps per race
boxPickupsPerLapraw.boxPickups / raw.completedLapsAverage item box pickups per completed lap
coinsPickedUpPerGameraw.coinsPickedUp / totalPlaysAverage coins picked up per race
netBananaHitsraw.bananaHitsSent - raw.bananaHitsReceivedBanana hits dealt minus banana hits suffered (can be negative)
bananaHitRatioraw.bananaHitsSent / raw.bananaHitsReceivedBanana hits dealt per banana hit suffered
blueTorpedoHitsPerPlayraw.blueTorpedoHits / totalPlaysAverage blue torpedo hits per race
mostPlayedMapargMax(map id -> map.plays, floor 0)Key of the map with the most plays; null when no map has more than 0 plays
bestMonthlyPositionminPositive(month.position for each raw.monthlyPoints entry)Best (lowest strictly positive) monthly leaderboard position ever held; 0 when no positive position exists
averageMonthlyPointssum(month.points) / count(months) over raw.monthlyPointsAverage points per recorded month; when there are no months, the sum (0) is returned
monthlycomputePeriod(monthBucket(now) === "a" ? raw.periods.monthlyA : raw.periods.monthlyB)This month's period stats from the live oscillation bucket; see TurboKartRacersPeriodComputed
weeklycomputePeriod(weekBucket(now) === "a" ? raw.periods.weeklyA : raw.periods.weeklyB)This week's period stats from the live oscillation bucket; see TurboKartRacersPeriodComputed

TurboKartRacersPeriodComputed

The shape of both monthly and weekly. Built from whichever TurboKartRacersPeriodStats slot (monthlyA/monthlyB or weeklyA/weeklyB) is live for the current date; the first four fields are copied through unchanged.

ts
export interface TurboKartRacersPeriodComputed {
  readonly boxPickups: number;
  readonly goldTrophies: number;
  readonly silverTrophies: number;
  readonly bronzeTrophies: number;
  readonly totalTrophies: number;
}
FieldFormulaMeaning
boxPickupsperiod.boxPickupsItem box pickups in the current period
goldTrophiesperiod.goldTrophiesGold trophies earned in the current period
silverTrophiesperiod.silverTrophiesSilver trophies earned in the current period
bronzeTrophiesperiod.bronzeTrophiesBronze trophies earned in the current period
totalTrophiesperiod.goldTrophies + period.silverTrophies + period.bronzeTrophiesAll trophies earned in the current period

Released under the MIT License.