Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency
LATENCY IMPACT
Client A Client B CarA A=1, V=0 Car B A=1, V=0 CarA A=1, V=1 CarA A=1, V=2 CarA A=1, V=3 Car B A=1, V=1 Car B A=1, V=2 Car B A=1, V=3 Car A Car B Car A Car B
Can’t apply open state Door is Open & Locked Client A Client B Lock DoorOpen Door Door is Closed & Unlocked Door is Closed & Locked Door is Closed & Unlocked Door is Open & Unlocked
Client A Client B Server Shooter (Player A ) Target (Player B )
Client A Client B Server Shooter (Player A ) Target (Player B )
DUMB CLIENT AND LOCKSTEP SYNCHRONISATION
Quake Client A Read Input Rendering Quake Server Receive Input Simulate Quake Client B Read Input Rendering Mouse Keyboard Draw Lists, Game State Mouse Keyboard Draw Lists, Game State
CONSERVATIVE SIMULATIONS
Doom Client A Read Input Rendering Receive Input Simulate Doom Client B Read Input Rendering Receiv e Input Simulate Doom Client C Read Input Rendering Receive Input Simulate
Client A Message I Client=B Time=11.1 Message I+1 Client=C Time=13.5 Message I+2 Client=B Time=13.6 Message I+3 Client=C Time=18.0 Message I+4 Client=D Time=18.2 Client B Client C Client D Message Queue
TIME
Event Explode is delay at Client C until after Event Fire Client A Client B Client C Event Fire Event Explode
Client A Client B Client C Event Fire (0,1,0) Event Explode (1,1,0) Event Fire (2,1,1) Event Explode (2,1,0)
OPTIMISTIC ALGORITHMS
Client A Client B Lock Door Open Door Client C Add Zombies Remove Zombies Close Door t0t0 t1t1 t2t2 t3t3 t4t4
CLIENT PREDICT AHEAD
Client A Server P0P0 P1P1 Move P 0 to P 1 Move? P 1 to P 2 Move? P 2 to P 3 Move? P 3 to P 4 Move? P 0 to P 1 Move P 1 to P 2 Move P 2 to P 3 P2P2 P1P1 P3P3 P2P2 P4P4 P3P3 P0P0 P1P1 P2P2 P1P1 P3P3 P2P2
Client A Server P0P0 P1P1 Move P 0 to P 1 Move? P 1 to P 2 Move? P 2 to P 3 Move? P 0 to P 1 FailMove P 1 to Q 1 FailMove P 1 to Q 1 P2P2 P1P1 P3P3 P2P2 Q1Q1 P0P0 P1P1 Q1Q1 P1P1 P3P3 P2P2 Q1Q1
EXTRAPOLATION ALGORITHMS
1 st Order Model
2 nd Order Model
a) Player model sending three updates b) Ghost model path without blending toto t1t1 t2t2 c) Old ghost model and new ghost model at t 1
d) Blending between the old ghost and new ghost over several frames e) Ghost model path with blending
a) Old ghost position at t 0, new ghost position at t 0 and new ghost position at t 0 +t t0t0 New ghost t 0 +t New ghost t 0 Old ghost t 0 b) Dotted line shows the planned path to reach the target position and direction
a) Player model showing the timings of dead-reckoning updates at the peaks of a periodic motion Update at t 0 Update at t 1
b) On arrival of an update message, the ghost model plans to converge the current ghost model position with an extrapolation of the received position Correct player model path Convergence path Ghost model location at t 0 Player model update at t 0 Extrapolation of player model
c) On the next update message the ghost model is out of phase with the player model. T
toto t1t1 Player model update at t 1 a) Player model showing the object avoiding the wall Path of ghost model after update at t 0 b) After the update at t1 the ghost model cannot converge
2 nd Order Model with Error Threshold
INTERPOLATION, PLAYOUT DELAYS AND LOCAL LAG
SenderReceiver P1P1 P2P2 P3P3 P4P4 t1t1 t2t2 t3t3 t4t4
P0P0 P1P1 P2P2 P3P3 t0t0 t1t1 t2t2 t3t3 Interpolate P 0 →P 1 Playout delay
SenderReceiver P1P1 P2P2 P3P3 P4P4 t1t1 t2t2 t3t3 t4t4 t5t5 t6t6
t0t0 t1t1 t2t2 t3t3 Interpolate P 0 →P 1 Maximum latency P0P0 P1P1 P2P2 P3P3 Playout delay Sender Client A Client B
t0t0 t1t1 t2t2 t3t3 Interval (Tα) E A1 Playout delay (T ) Client A Client B Client C E C1 E C2 E B1 E B2 t4t4
PERCEPTION FILTERS
Client A Client B
x position 1.0 T network Added delay
Time 1.0 x position
Time 1.0 x position a) Both clients’ view of the ball x position using temporal corrections x position of ball as seen from Client A x position of ball as seen from Client B
Time 1.0 x position b) Both clients’ view of the ball x position without using temporal corrections x position of ball as seen from Client B x position of ball as seen from Client A
REVEALING LATENCY