Interp

From Wikipedia, the free encyclopedia

Interp is a term originated from online multiplayer computer or console gaming (usually the first person shooter genre), and refers to the interpretation (prediction) of the players movements due to network latency.

First and second generation multiplayer first person shooter games like iD Software's Doom and Quake series, and early versions of Half-Life (until approximately version 1.1.0.0), had no player interpretation. Player movement on each client's screen was displaying what the server saw, and therefore leading targets was required to hit a moving player.

Modern day prediction code makes players with different connection speeds able to play together very easily. There are actually two things new – lag prediction and player prediction, so hits are now calculated not by where the client's player model is, but where the server predicts them to be. In addition, hit calculation is more complex and calculates each player's latency in order to determine whether a hit is valid or not. Modern prediction allows the game to appear completely fluid client side even though hit calculations are still done afterwards by the server.

[edit] Example

A player is running behind the edge of a wall while another is firing.

  • Player 1's latency to the server: 50ms (50/1000ths of a second)
  • Player 2's latency to the server: 150ms (150/1000ths of a second)

Let us say that player 1 is moving behind an edge which can not be penetrated, and that player 2 is firing at player 1.

Pre-Interp netcode: P2 would have to lead P1 by an amount equal to his latency (150ms) in order to hit, assuming that P2 kept moving in a straight line. All hit calculations are performed at the server, 'as-is'. So by the time the packet frame was received by the server 150ms later, P1 would be in the location that P2 had fired upon. P1 would be behind the wall as soon as the server received the packets (50ms later in this case), even if he appeared to still be on P2's screen.

Current Interp netcode: P2 would fire at P1 directly (no leading necessary) and the server would then determine if there was a hit while taking into account each client's latency. So let us say that it is 50ms after P1 passes the edge of a wall on his client. With the old netcode, he would be officially behind the wall. But with new prediction, there is no official location for each player. The locations vary depending on the latency of each client! So not only is P1 is still on the screen on P2's client, but he is hittable as well. If P2 hit P1 right as he approached the wall, the server would validate it.