How it works
What happens when you swap a player into a moment: how we set the scene, how we turn a player-season into a playoff version of him, how each possession plays out, and every number the simulation uses. No code, just the basketball and the arithmetic.
Where a moment startsThe last dead ball before the famous play, rebuilt from the real play-by-play.
Every moment starts at the last dead ball before the famous play: after the free throws, the timeout, or the substitutions, not at the instant of the shot. That way the whole sequence plays out, so your swap can change who shoots, who rebounds, and who's open.
The score, clock, who has the ball, and the ten players on the floor all come from the real play-by-play. The play-by-play never says who was on the floor, only who checked in and out, so we work it out: a player started a quarter if he shows up in it before he ever checks in. If it's ever ambiguous, we stop and check instead of guessing.
No swap: what really happenedNo swap means you watch the real ending, play by play.
History can only change if you change something. With no swap, you watch the real ending, play by play from the real play-by-play: every shot, rebound, foul, substitution, and overtime, ending on the real final score.
Your player's playoff versionHis real playoff stats, blended with a projection from his regular season.
You pick a player and a season. Every moment is a playoff moment, so the sim needs his playoff version of that season. Some seasons have a full playoff run behind them, some have one game, some have none (his team missed, or he was hurt). We blend what he actually did in the playoffs with a projection from his regular season, trusting each by how much data backs it.
playoff version = trust × his real playoff stats + (1 − trust) × his projection trust = his playoff minutes ÷ (his playoff minutes + 300)
The projection from his regular season
projection = his regular season
× how the league changed in that season's playoffs
× his personal step-up from his other playoff runsHow the league changes: we compare the same playoff teams in their own regular season against their playoffs. Over 30 seasons, they scored fewer points per game in the playoffs every single season, about 4.3% fewer: roughly 2.4% from a slower pace and 1.7% from tighter defense.
His personal step-up: some players rise in the playoffs and some fade. We measure how much more (or less) than the league each player changed in his other playoff runs, with seasons closer to the one you picked counting more. It's trusted by how many playoff minutes back it up (half-trusted at 600 minutes), and anything beyond 0.6× to 1.6× is treated as noise.
his step-up = (his playoff number ÷ his regular-season number) ÷ (the league's same change) 1.00 = he changed exactly as much as everyone else 1.10 = he stepped up 10% beyond the league
Shooting by zone
Every shot comes from one of seven zones (at the rim, in the paint, mid-range, left corner three, right corner three, above-the-break three, backcourt heave). A player's make rate in each zone leans on his actual shots there, and on a broader average when he has few:
zone make % = (his makes + 15 × the broader average) ÷ (his attempts + 15)
The surprise elementA small random shooting swing, bigger for players with little playoff history.
Big moments aren't that predictable. In each simulated timeline, every player gets a small random swing on his shooting, bigger when he has little playoff history behind him, and capped at ±5 percentage points. A player with a small hot sample can show up hot in some timelines without taking over.
typical swing = 5 points × 40 ÷ (40 + his playoff shots)
How each possession plays outSeven steps, from the foul decision to the rebound.
The sim plays possession by possession until the game is decided, overtime included. Each possession goes like this:
- The defense decides whether to foul (see late-game decisions below).
- Getting into the offense. Bringing it up from the backcourt takes 4–6s; a trailing team late in the game pushes it in 2.5–4s. After a timeout late in the game, the ball is advanced and the inbound takes 0.8–1.6s. With under 1.5s left and no time to cross half court, it's a heave.
- Who shoots. Stars get the ball, and a player who's hot that game gets it a bit more:
his chance to take the shot ∝ his usage × his hot hand hot hand = 1 + 1 × (his shooting this game − his usual shooting) × (shots ÷ (shots + 5)) kept between 0.7× and 1.4×In crunch time, stars take over. In the last 5 minutes of the 4th quarter or overtime with the score within 5 (the NBA's "clutch" definition), "his usage" becomes his real clutch usage that season, trusted by his clutch minutes, and his regular-season usage when there isn't enough:crunch-time usage = trust × his clutch usage + (1 − trust) × his regular-season usage trust = his clutch minutes ÷ (his clutch minutes + 60)
For a 45% shooter: 2 for 2 tonight → ×1.16. 8 for 10 → ×1.23 (more shots, more trust). 1 for 5 → ×0.88. The player you swap in comes in neutral (×1.00), since he didn't play in that game. Research on whether shooters actually stay hot is mixed, so the hot hand mostly decides who gets the ball; it only nudges whether it goes in (by 0.03 × the boost above 1).LeBron James in 2015–16 used 31% of the Cavs' plays normally and 43% in 126 clutch minutes, so in crunch time the sim gives him 39.1%. Tristan Thompson fell from his usual share to 9% in the clutch. - From where. His own mix of shots by zone. When only a three will do (down 3 with one possession left, or down 4+ at the very end), only threes, and the ball goes more to players who take threes.
- Does it go in.
make chance = his zone make % × the defense on the floor (+ hot-hand nudge + surprise swing) defense on the floor = the five defenders' points allowed per 100 ÷ the league's, kept between 0.9 and 1.1
Good defenses push the make chance down by up to 10%; bad ones push it up by up to 10%.Playmaking. Take a creator off the floor and two things happen: the team scores less, and everyone else's shots get harder because the defense isn't focused on him anymore. Every player-season has an offensive lift: how many more points per 100 possessions his team scored with him on the floor than off it (the NBA's on/off splits, from 2007–08; estimated from his own usage, efficiency and passing before that). With no swap, nothing changes.
change = (lift of the player coming in − lift of the player going out) ÷ the league's points per 100 teammate's make chance × (1 + 1 × change × (his share of assisted makes ÷ 0.6)) kept between 0.85× and 1.15×Swap out LeBron James 2015–16 (the Cavs scored 114.0 per 100 with him, 98.6 without: +15.4) for a player at −2. A spot-up shooter with 90% of his makes assisted shoots ×0.85; a self-creator at 40% assisted shoots ×0.89. The player you swap in keeps his own shooting. - Fouls and turnovers. A shot draws a foul based on how often he gets to the line; threes draw fouls far less (×0.3). Fouled on a make is an and-one. Turnovers happen at the team's usual rate, and 50% of them are steals.
- Rebounds.
offense gets the rebound = their five's offensive rebounding ÷ (their five's offensive + the defense's defensive rebounding)
After an offensive rebound, the score decides: if they need a three, they kick it out; otherwise a big man under the rim puts it back (a player is a "big" if at least 35% of his shots come at the rim), and anyone else resets the offense. On a missed last free throw, the offense gets it back 12% of the time.
Late-game decisionsFouling, clock management, timeouts, and the rules of the era.
"Late" means the last 2 minutes of the 4th quarter or overtime. Fouling follows what NBA teams actually do:
| Setting | Value | What it does |
|---|---|---|
| Up 3, more than 10s left | Never foul | Play defense. Fouling early lets them make both, foul back, and get another shot at a tying three. |
| Up 3, 6–10s left | 15% | Sometimes foul to take away the tying three. |
| Up 3, 6s or less | 50% | Often foul. Overall this lands near the ~34% NBA teams foul up 3 in the final 10 seconds. |
| Trailing, other team has the ball | Foul | When the game clock is under the shot clock (they can just hold it) and the deficit is still reachable, within the last 60s. |
| Up big | Defend | No reason to foul. |
Clock management: a trailing team works 3–8s after crossing half court and shoots leaving 2–4s for a rebound or a foul. A tied team holds for the last shot, shooting with 1.2–3.5s left. A leading team runs the shot clock down to 1–5s, and dribbles it out when the game clock is shorter than the shot clock.
Timeouts start from each team's real count at that moment, by that era's rules. A trailing or tied team uses one late to advance the ball past half court. Each overtime adds 2.
Rules of the era come with each season: for example, the shot clock resets to 14 after an offensive rebound from 2018–19 on, and in 1996–97 the three-point line was 22 feet all the way around.
How results are countedHistory changed means the real loser wins, compared against the real lineup.
Every timeline plays to the end of the game, up to 4 overtimes. History changed means the team that really lost wins. For Ray Allen's moment, any Spurs win changes history; any Heat win keeps it.
Some real endings were long shots, so luck alone can change history in a lot of timelines. That's why every run also simulates the real lineup with the same random draws, and shows the difference: that difference is what your swap did.
Every timeline is seeded: the same moment, the same swap and the same seed always play out exactly the same way.
Every settingEvery adjustable number, explained.
Every adjustable number the simulation uses. The ones marked STARTING VALUE are first guesses that will be tuned by checking no-swap simulations against how real games ended.
| Setting | Value | What it does |
|---|---|---|
| Playoff trust | 300 minSTARTING VALUE | Playoff minutes at which his real playoff stats and his projection count equally. |
| Zone trust | 15 shotsSTARTING VALUE | Shots from a zone at which his own make rate and the broader average count equally. |
| Step-up trust | 600 minSTARTING VALUE | Playoff minutes at which his personal step-up is half-trusted. |
| Step-up limits | 0.6×–1.6×STARTING VALUE | Step-ups outside this range are treated as noise. |
| Surprise swing | ±5 pts | Largest random shooting swing a player can get in a timeline. |
| Surprise half-point | 40 shotsSTARTING VALUE | Playoff shots at which the swing is half its largest. |
| Hot-hand strength | 1STARTING VALUE | How much shooting above or below his usual tonight shifts his share of shots. |
| Hot-hand half-point | 5 shotsSTARTING VALUE | Shots tonight at which the hot-hand signal is half-trusted. |
| Hot-hand limits | 0.7×–1.4×STARTING VALUE | A nudge, so stars still lead. |
| Hot-hand make nudge | 0.03STARTING VALUE | How much the hot hand shifts whether it goes in. |
| Crunch time | 5 min, within 5 | When clutch usage takes over (the NBA's clutch definition). |
| Clutch trust | 60 minSTARTING VALUE | Clutch minutes at which his clutch usage and his regular-season usage count equally. |
| Playmaking strength | 1STARTING VALUE | How strongly a change in the lineup's offensive lift moves teammates' shooting. |
| Typical assisted share | 60%STARTING VALUE | Players assisted more often than this rely more on creators. |
| Playmaking limits | 0.85×–1.15×STARTING VALUE | Most a teammate's shooting can move from a swap. |
| Defense limits | 0.9–1.1STARTING VALUE | Most the defense on the floor can move make chances. |
| Late game | 120s | When late-game rules (fouling, timeouts, clock management) kick in. |
| Heave | 1.5s | Below this, with no time to cross half court, it's a heave. |
| Threes fouled | ×0.3STARTING VALUE | How much less often a three draws a shooting foul than a two. |
| And-one | ×0.4STARTING VALUE | Make chance when fouled on the shot, relative to unfouled. |
| Steals | 50%STARTING VALUE | Share of turnovers that are steals (the ball stays live). |
| Free-throw rebound | 12%STARTING VALUE | Offense gets a missed last free throw back. |
| Big man | 35%STARTING VALUE | Share of shots at the rim that makes a rebounder a putback threat. |
| Overtimes | 4 | Most overtimes a timeline can go. |
| Bring-up (backcourt) | 4–6sSTARTING VALUE | Time to get the ball past half court. |
| Bring-up (trailing late) | 2.5–4sSTARTING VALUE | Same, when they're hurrying. |
| Inbound (frontcourt) | 0.8–1.6sSTARTING VALUE | After a timeout advances the ball. |
| Normal possession | 8–18sSTARTING VALUE | How long a possession runs before a shot. |
| Trailing work / reserve | 3–8s / 2–4sSTARTING VALUE | Trailing late: time spent before shooting, and time left for a rebound or foul. |
| Last shot | 1.2–3.5sSTARTING VALUE | Tied late: shoot with this much left. |
| Leading: shot clock left | 1–5sSTARTING VALUE | Leading late: shoot with this much on the shot clock. |
| Intentional foul | 1–3sSTARTING VALUE | Time it takes to commit a foul. |
| Putback / kick-out | 0.5–1.2s / 1–2sSTARTING VALUE | After an offensive rebound. |
| Rebound gather | 0.3–0.8sSTARTING VALUE | Time for the ball to come down. |
Want the full technical version? The engine is open source, and every calculation is documented with formulas and real examples in the project README. Or go try a swap →