basketball.casa

A basketball world simulated from the body up. Watch only.

Shooting fouls, free throws and drives that brake into the finish in the basketball simulation

The simulated league now has shooting fouls. A defender who is still running into a shooter as the ball leaves the shooter's hands, and cannot stop before reaching them, can be whistled. The shooter goes to the line: two free throws after a missed two, one after a make that counts anyway. The box score counts the free throws, and the commentary feed for the stream carries the foul and every throw. Drives changed too: a driver who reaches the basket now slows into the finish at their own braking, where before they ran at full speed and stopped dead.

Whether a defender can stop in time

A foul is not a dice roll with a set rate. It comes from the two bodies at the moment of the release: how far the defender is from the shooter, how fast they are closing on them, and how hard that defender's own legs can brake. Only the closing speed counts. A defender sliding past beside the shooter is not running into them:

gap = math.dist(now, shooter_at)
closing = (math.dist(before, shooter_at) - gap) / _SPEED_STEP_S
return closing > 0.0 and closing * closing / (2.0 * mover.brake_mps2) >= gap - _body_depth_m()

If the distance needed to stop is more than the room left before the two bodies meet, there is contact. Whether the whistle blows on that contact comes from the NBA's published Last Two Minute reviews, where contact with a defender moving into a shooter was judged a foul in 59.5% of reviewed plays (those reviews cover close games, so the figure leans toward contact that matters). Each free throw goes in at the rate NBA players shoot them, 78%.

Two box scores side by side with a free throw column; one player shows one free throw made in one try
The box score's FT column: free throws made and tried.

The first version of this rule counted a defender's whole speed, not the part closing on the shooter, and much of the contact it found was defenders moving in other directions, sideways past the shooter, who were never running into them. A check of what the rule actually counted caught it before it could be taken as a result, and it was corrected.

Rarer than in real games, and why

Fouls are rare in the simulation for now: about 0.6% of two-point shots, where roughly 16% of real ones are fouled. That number was measured, not set. The rule stands on measured rates; what differs is how often the bodies meet. Real defenders crowd a shooter and reach in, and pay for it in fouls. The simulation's defenders do not choose how close to stand or whether to reach, so contact, and the fouls it brings, is rare. No number was nudged to close that gap.

Braking into the finish

Before this change, a driver who got to the basket ran at full speed, stopped dead and then shot: over the moments before the release, the median driver was moving at 0.0 metres per second, against about 1.8 in tracking data from real games. Now a drive brakes into the finish at the driver's own braking, and the gather is where that braking starts, so nothing about where the layup begins is set by hand. In a dry run over 818 drives from 24 games before it landed, the slowest tenth of drivers were moving at 1.7 metres per second or less over those moments and the fastest tenth at 2.5 or more, with a middle of 2.0 against the 1.8 of the tracking data.

Corrected on 1 October: an earlier version of this post said drives now finish in stride. The driver comes to a stop before going up; the speed above is measured over the moments before the release, while the driver is braking, not at the release itself.