Zeetius

KBSA  Tournament is Streaming On Zeetius Tv    WATCH NOW

Engineering

Table Tennis, Wrestling, Basketball: One Engine, Three Very Different Sports

A concrete walkthrough of how the same scoring infrastructure handles a rally sport, a bout sport and a clock sport without becoming generic mush.

7 minute read

Three scoring interfaces side by side for table tennis, wrestling and basketball

We have written about scoring paradigms in the abstract. This piece is the concrete version: three sports we actually run, what each demands, and where the shared engine ends and sport-specific work begins.

Table tennis: a rally sport with a rotation problem

Scoring looks simple. Best of five or seven, games to 11, win by two, no cap. The complexity is entirely in the serve.

Service alternates every two points, except at 10-10 (deuce) where it alternates every point, indefinitely. In doubles, the receiving order rotates as well, and it changes between games. Get the rotation wrong and the umpire is manually correcting service order mid-game, which is exactly the friction the system exists to remove.

So the table tennis model tracks serve state as a first-class part of the score, derived from the point sequence rather than entered. Because it is derived, an umpire correcting a point three rallies back also corrects the serve rotation automatically — one of those details that is invisible when it works and infuriating when it does not.

There is also a data quirk we hit in production and documented the hard way: in some deployments only one side's points were being recorded per rally, with the opponent's inferred. That is fine for the scoreline and useless for rally-derived analytics, because half the events are missing. Getting both sides recorded per rally was a prerequisite for any table tennis match analysis at all.

A table tennis scoring interface highlighting the derived serve indicator and doubles rotation

Derived state beats entered state

The general principle this illustrates: anything the rules can compute from the point sequence should be computed, never entered. Serve rotation, game point, match point, whether the two-point rule is active, who receives next in doubles. Every field an umpire has to maintain by hand is a field that will eventually be wrong at 8pm on day three.

Wrestling: continuous points and sudden termination

Wrestling breaks the rally assumption completely. There is no discrete point-winning event to count — points accrue continuously within timed periods, in different values, awarded for actions of different kinds, to either wrestler, at any moment.

And a bout can end instantly. A fall terminates it regardless of score. A technical superiority margin terminates it the moment the margin is reached, mid-period. Those are not edge cases to handle after the fact; they are conditions the engine has to evaluate after every single scoring event, because the match may already be over.

Cautions and passivity add another layer: state that affects the bout but is not a score, and that can convert into points later. The scoring interface therefore needs point values, caution tracking, a fall button and a period clock — with nothing extra on screen, because a wrestling official has approximately no time to hunt for a control.

Basketball: the clock is the hard part

Basketball's scoring arithmetic is the simplest of the three — two, three or one point, attributed to a player and a team. The clock is what makes it difficult.

Game time is state that runs, stops, and must agree between the scoring device, the venue display and every spectator's screen. A clock synchronised by polling drifts visibly within a quarter. The approach that works is to transmit clock transitions — started at this timestamp, stopped at that one — and let each client compute the current value locally. Every screen then derives the same time from the same events, and a client that reconnects after a dropout computes the correct time immediately rather than resuming from a stale value.

Set & rally table tennis, badminton, tennis, pickleball, padel, volleyball
Bout wrestling, chess boxing
Clock basketball, football, handball, hockey

What is genuinely shared

Given how different those three are, it is fair to ask what the common engine actually contributes. Quite a lot, as it turns out — and none of it is scoring logic.

  • The event stream: ordered, append-only, offline-tolerant, replayable. Identical for all three.
  • Server-side replay as the source of truth, so corrections work the same way everywhere.
  • Fan-out to live pages, brackets, broadcast overlays and analytics — one publish path.
  • Tournament structure: draws, brackets, scheduling, results and rankings, which do not care what sport produced the result.
  • Offline queueing and reconciliation, written once and inherited by every sport.

What is sport-specific is the rule evaluation and the scoring interface — the two things that genuinely must be. Everything else being shared is why the thirty-first sport is a matter of weeks rather than a rewrite.