How the match engine works
Most sports simulators decide a result and then write a scoreline to fit it. This one bowls the ball.
The first version of this engine was handed a win or a loss, invented a score that fitted, and shared that total across the eleven. It had the direction of causation backwards, and everything wrong with it followed from that single decision.
Two sides with the same average made the same runs, so an eleven built around Chris Gayle and AB de Villiers scored exactly what an eleven of accumulators scored. The bowler at the other end never entered into the calculation at all. And because the result came first, a side of the best players in the archive could lose to a modest one for no reason a viewer could see.
The direction, reversed
Before: a coin decides the result, a score is invented to fit, the card spreads that total across the eleven. Now: every delivery is bowled, the card is read off them, and the result is whatever the second innings did.
Nothing decides the outcome. It is the residue of about 250 deliveries, each one a contest between two named players.
What is decided on each ball
- Who is bowling — quotas, no consecutive overs, and a captain rather than a rota: the best bowlers take the new ball and are held back for the death, a man being hit about is taken off sooner than one who is not, and when wickets are wanted the ball goes to whoever is likeliest to take one.
- The bowler against the batter — his threat and his economy against the batter’s quality and tempo, and specifically against the kind of bowling being bowled.
- Whether he is set — nobody arrives at the crease in form. A batter plays himself in over about six balls in a Twenty20 and half an hour in a Test, and a tail-ender never gets there.
- Where the innings is — powerplay, middle overs, or the death.
- The situation — wickets in hand, and the rate still required. Nine down needing fifty is a plea, not a licence.
- Conditions — the surface, dew under lights, cloud cover.
Pace and spin are different problems
Every batter carries two batting ratings: one against pace and one against spin, computed from 4.5 million deliveries classified by the bowler’s own stated style. Chris Gayle in 2018/19 comes out at 55 against pace and 99 against spin. Irfan Pathan in 2011 is the exact reverse.
Forty-six per cent of players differ by eight rating points or more between the two. It is the argument every cricket conversation about a batter arrives at within a minute — he cannot play spin, he is uncomfortable against genuine pace — and until it was measured, a turning pitch meant nothing to any particular player.
Catches go down
Roughly one chance in thirty is dropped, weighted by what the fielding side actually caught per match, and a drop is a life. The rate matters more than it looks: at one chance in ten the better side lost twelve percentage points of win rate, because it creates most of the chances and therefore forfeits most of the drops. An attack that keeps beating the bat has to be worth having.
Bowlers tire
A spell is consecutive overs, and the fourth of them is not the first. Pace drops, length goes, and about a run an over comes off it. That is the whole reason a captain rotates an attack rather than bowling his best man straight through, and without it there was no cost to doing exactly that.
Rain, and a revised target
About one limited-overs match in twenty is interrupted, likelier under an overcast sky than a clear one. When rain takes overs off a chase, the target is revised upward per over rather than scaled straight down — a side with all ten wickets and half its overs has far more than half its scoring left in hand. That is the idea behind Duckworth-Lewis, and it means a side can win having made fewer runs than the other.
A Test can be drawn
A captain declares; he does not run out of overs. A side bats until its lead is enough and until enough of the match remains to bowl the opposition out, and those two pull against each other — every over batted is an over unavailable for taking ten wickets.
And a fourth innings is not always a chase. Four hundred to get with a day left is not a target, it is a warning, and a side in that position blocks. Without that behaviour a Test was drawn three times in a hundred; with it, twenty-five, which is Test cricket.
Form moves through a season
A season is not eleven players at their average, eleven times over. Somebody is in the form of his life by the sixth game and somebody has not middled it since the first — and both come out of what has actually happened rather than a dice roll before each match. A hundred pulls a man out of a trough; three failures put him in one.
Class tells further the longer the game is
The same gap in ability is worth more over fifty overs than twenty, and more again over five days. It is why Twenty20 is the format upsets live in — there is not enough of it for the better side to be proved better, which is close to why it was invented. Without this, a one-day match came out flatter than a Twenty20, which is backwards.
What the engine produces
| Measure | Twenty20 | One-day | Test |
|---|---|---|---|
| Par score | 160 | 262 | 384 |
| Run rate, powerplay | 8.2 | 5.2 | — |
| Run rate, middle overs | 8.5 | 5.1 | 3.1 |
| Run rate, death | 12.2 | 6.8 | — |
| Matches drawn | none | none | 25% |
None of those is a target the code aims at. Each is what came out of playing the deliveries, and each is checked against thousands of simulated matches on every change.
The card cannot lie
Because there is only one account of a match, a bowler’s figures of 4-0-22-3 are his four overs and his three wickets. Nothing is shared out afterwards to make the totals agree, and the ball-by-ball replay you can watch is the same innings the scorecard describes rather than a reconstruction of it.
More on how this is built
- How SPIN XI rates a cricketer — Every rating in SPIN XI is computed from ball-by-ball records of matches that were actually played. This is the method, including the three times it was wrong.
- The archive: where every number comes from — SPIN XI is built from 15,270 ball-by-ball match records published by Cricsheet. This is what is in the archive, how it is assembled, and what is deliberately not in it.
- The best seasons in the archive — The highest-rated player-seasons across 15,270 matches of Test, one-day and Twenty20 cricket — and why all-rounders dominate the top of the list.
- Which Twenty20 league is hardest to play in? — Not an opinion. A measurement of what the same players did in different leagues, from ball-by-ball records of every match.
- How to draft a side that actually wins — What ten thousand simulated seasons say about building an eleven in SPIN XI: where the rating misleads you, and what to take when the squad is thin.
- About SPIN XI — A free cricket drafting game built on the public ball-by-ball record. What it is, who made it, and what it is not.