Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Client-side prediction
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
'''Client-side prediction''' is a [[computer network programming|network programming]] technique used in [[video game]]s intended to conceal negative effects of high [[latency (engineering)|latency]] connections. The technique attempts to make the player's input feel more instantaneous while governing the player's actions on a remote [[server (computing)|server]]. The process of client-side prediction refers to having the [[client (computing)|client]] locally react to user input before the server has acknowledged the input and updated the game state.<ref name="Bernier01">{{cite web|url=http://web.cs.wpi.edu/~claypool/courses/4513-B03/papers/games/bernier.pdf|title=Latency Compensating Methods in Client/Server In-game Protocol Design and Optimization|last=Bernier|first=Yahn W.|year=2001|access-date=2008-12-19}}</ref> So, instead of the client only sending control input to the server and waiting for an updated game state in return, the client also, in parallel with this, predicts the game state locally, and gives the user feedback without awaiting an updated game state from the server. Client-side prediction reduces latency problems, since there no longer will be a delay between input and client-side visual feedback due to network ping times. However, it also introduces a desynchronization of the client and server game states, which needs to be handled to keep the game playable.<ref name="Bernier01" /> Usually, the desync is corrected when the client receives the updated game state, but as instantaneous correction would lead to "snapping", there are usually some "smoothing" algorithms involved. For example, one common smoothing algorithm would be to check each visible object's client-side location to see if it is within some error epsilon of its [[server-side]] location. If not, the client-side's information is updated to the server-side directly (snapped because of too much desynchronization). However, if the client-side location is not too far, a new position between the client-side and server-side is interpolated; this position is set to be within some small step delta from the client-side location, which is generally judged to be "small enough" to be unintrusive to the user. Another solution to the desynchronization issue, commonly used in conjunction with client-side prediction, is called ''server reconciliation''.<ref>Gabriel Gambetta, [http://www.gabrielgambetta.com/client-side-prediction-server-reconciliation.html Client-Side Prediction and Server Reconciliation]</ref> The client includes a sequence number in every input sent to the server, and keeps a local copy. When the server sends an authoritative update to a client, it includes the sequence number of the last processed input for that client. The client accepts the new state, and reapplies the inputs not yet processed by the server, completely eliminating visible desynchronization issues in most cases. The earliest known [[first-person shooter]] to use client-side prediction is [[Duke Nukem 3D]], which had it built-in since the January 29, 1996 [[shareware]] release.<ref>{{cite journal |last=Dransfield |first=Ian |date=2018-07-14 |title=The Engine Room: Build |url=https://www.pressreader.com/uk/retro-gamer/20180614/281565176453517 |access-date=2018-11-24 |journal=[[Retro Gamer]] |issue=182 |publisher=[[Future plc]] |place=United Kingdom |pages=62β67 |issn=1742-3155}}</ref><ref>{{Citation|title=Duke Nukem 3D (v1.5 CD Version) Source Code Release - April 1, 2003|date=2019-05-15|url=https://github.com/videogamepreservation/dukenukem3d|others=See domovethings(), fakedomovethings(), and fakedomovethingscorrect()|publisher=Video Game Preservation|access-date=2019-05-15}}</ref> The technique was also a prominent feature of ''[[QuakeWorld]]'', the popular add-on to ''[[Quake (video game)|Quake]]''. While network play was included in the original ''Quake'' game, it was optimized mainly for [[LAN]] play. Having had high-speed home connections (a rarity at the time), ''Quake'''s designers overlooked their assumptions of high bandwidth and low ping times that made playing online frustrating for [[dial-up]] users.<ref>John Carmack, [http://fabiensanglard.net/quakeSource/johnc-log.aug.htm QuakeWorld .plan]</ref> After a series of experiments in a long private beta, [[id Software]] released ''QuakeWorld'' with a new predictive model that proved popular with both high and low latency players.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)