TExcelTAD
Home › Multiplayer Game Networking › Extrapolation & Dead Reckoning

Extrapolation & Dead Reckoning

Interpolation shows remote objects in the past and never guesses. Extrapolation does the opposite: it takes the last known position and velocity and predicts where the object is now. The name dead reckoning comes from ship navigation (position from speed, heading and time) and from military simulators (the DIS standard), which used it to keep thousands of vehicles in sync over slow networks.

Where extrapolation shines, and where it fails

Works well Works badly
vehicles, ships, planes: heavy things that can't turn instantly human characters who stop and turn every few hundred milliseconds
projectiles, falling objects (physics is predictable) anything controlled by twitchy input
filling short gaps when the interpolation buffer runs dry long gaps: the error grows with time
racing games, flight sims, space games fast competitive shooters

The error of an extrapolation grows with the time since the last update and with how much the object's motion changed. A car turning at 30 m/s goes far off course in 200 ms; a jogging character reverses direction faster than any update can tell you.

Snapping vs blending

When a new update arrives, the extrapolated position is usually wrong by some amount. Snapping straight to the new estimate makes objects jitter. A common fix is to blend: over a short time, move from where we were drawing it towards the new extrapolated path. Here a remote car drives right at 20 m/s, then turns down at t = 300 ms. Updates arrive every 100 ms, 50 ms late. We compare three display strategies with the truth:

ts · try it yourself
type V = { x: number; y: number };
const truth = (t: number): V => (t <= 300 ? { x: t * 0.02, y: 0 } : { x: 6, y: (t - 300) * 0.02 });
const vel = (t: number): V => (t <= 300 ? { x: 0.02, y: 0 } : { x: 0, y: 0.02 });

const LATE = 50;
const updates = [0, 100, 200, 300, 400, 500].map((t) => ({ t, p: truth(t), v: vel(t), arrive: t + LATE }));

let offset: V = { x: 0, y: 0 };                        // blended: correction still to hide
let prev: (typeof updates)[number] | null = null;
const project = (u: (typeof updates)[number], now: number): V => ({ x: u.p.x + u.v.x * (now - u.t), y: u.p.y + u.v.y * (now - u.t) });
const DECAY = 0.6;                                         // keep 60% of the correction each frame
const err = (a: V, b: V) => Math.hypot(a.x - b.x, a.y - b.y).toFixed(2).padStart(5);

console.log('   t   hold err   extrapolate err   blended err');
for (let now = 250; now <= 560; now += 30) {
  const last = updates.filter((u) => u.arrive <= now).pop()!;
  const hold = last.p;
  const extrap = project(last, now);
  if (prev && prev !== last) {                             // new update: the old path and the new one disagree
    const old = project(prev, now);
    offset = { x: old.x + offset.x - extrap.x, y: old.y + offset.y - extrap.y };
  }
  prev = last;
  offset = { x: offset.x * DECAY, y: offset.y * DECAY };   // ...fade that jump out over a few frames
  const shown = { x: extrap.x + offset.x, y: extrap.y + offset.y };
  const real = truth(now);
  console.log(`${String(now).padStart(4)}   ${err(hold, real)}       ${err(extrap, real)}          ${err(shown, real)}`);
}
   t   hold err   extrapolate err   blended err
 250    1.00        0.00           0.00
 280    1.60        0.00           0.00
 310    2.01        0.28           0.28
 340    2.15        1.13           1.13
 370    1.40        1.98           1.98
 400    2.00        2.83           2.83
 430    2.60        3.68           3.68
 460    1.20        0.00           2.72
 490    1.80        0.00           1.63
 520    2.40        0.00           0.98
 550    1.00        0.00           0.59

Holding the last position is always about one update behind (here 1 to 2.6 units). Extrapolation is perfect while the car drives straight, then overshoots past the corner (the update sent at the corner still says "moving right") until the next update arrives at 450 ms. At that moment the extrapolated car pops 3.7 units sideways in a single frame. The blended column hides the pop: it keeps the old path's error and fades it out (to 60% each frame), trading a slightly longer error for smooth motion. Real games use smarter blends (projective velocity blending, cubic splines) and cap extrapolation to a few hundred milliseconds, after which the object stops and waits.

Extrapolating with the engine's physics

For physics objects, the best extrapolator is the physics engine itself: put the object at the received position and velocity, and let the local simulation run it forward. Collisions with static geometry then come out right (the ball bounces off the wall instead of passing through), and when the next update arrives, blend towards it. Rocket League famously runs the ball forward on clients this way, then corrects.

In practice

  • Use interpolation for other players in shooters and action games, with a short extrapolation (≤ 100–250 ms) only when the buffer runs dry.
  • Use extrapolation for vehicles and projectiles, and in games where showing others in the past is unacceptable (racing positions at the finish line are judged by the server anyway).
  • Send velocity (and maybe acceleration) with positions for any object you extrapolate; estimating velocity from two jittery positions amplifies the noise.
  • Never let extrapolation decide game rules (hits, finish order). It's a display technique; the server decides.

Test yourself

Why is extrapolation poorly suited to human characters in a shooter?

  1. They are too slow
  2. They change direction faster than updates arrive, so predictions overshoot
  3. Characters have no velocity
  4. It uses too much bandwidth

What does blending towards a new extrapolated position avoid?

  1. Packet loss
  2. Visible pops when each update corrects the displayed position
  3. The need for velocity
  4. Server load