Introduction to Networked Graphics Latency Compensation.

Slides:



Advertisements
Similar presentations
Numbers Treasure Hunt Following each question, click on the answer. If correct, the next page will load with a graphic first – these can be used to check.
Advertisements

Symantec 2010 Windows 7 Migration EMEA Results. Methodology Applied Research performed survey 1,360 enterprises worldwide SMBs and enterprises Cross-industry.
Symantec 2010 Windows 7 Migration Global Results.
1 A B C
AKC Rally Signs These are copies of the 2008 AKC Rally signs, as re-drawn by Chuck Shultz. Use them to print your own signs. Be prepared to use a LOT of.
Simplifications of Context-Free Grammars
Variations of the Turing Machine
1 Concurrency: Deadlock and Starvation Chapter 6.
Zhongxing Telecom Pakistan (Pvt.) Ltd
AP STUDY SESSION 2.
1
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 4 Computing Platforms.
Processes and Operating Systems
STATISTICS HYPOTHESES TEST (I)
1 Hyades Command Routing Message flow and data translation.
A Trajectory-Preserving Synchronization Method for Collaborative Visualization Lewis W.F. Li* Frederick W.B. Li** Rynson W.H. Lau** City University of.
David Burdett May 11, 2004 Package Binding for WS CDL.
1. 2 Begin with the end in mind! 3 Understand Audience Needs Stakeholder Analysis WIIFM Typical Presentations Expert Peer Junior.
1. 2 Begin with the end in mind! 3 Understand Audience Needs Stakeholder Analysis WIIFM Typical Presentations Expert Peer Junior.
LAW 11 Offside.
Prepared by: Workforce Enterprise Services For: The Illinois Department of Commerce and Economic Opportunity Bureau of Workforce Development ENTRY OF EMPLOYER.
Local Customization Chapter 2. Local Customization 2-2 Objectives Customization Considerations Types of Data Elements Location for Locally Defined Data.
Custom Services and Training Provider Details Chapter 4.
CALENDAR.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt BlendsDigraphsShort.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt Wants.
The 5S numbers game..
Break Time Remaining 10:00.
EE, NCKU Tien-Hao Chang (Darby Chang)
Turing Machines.
Table 12.1: Cash Flows to a Cash and Carry Trading Strategy.
PP Test Review Sections 6-1 to 6-6
Microsoft Confidential. We look at the world... with our own eyes...
Outline Minimum Spanning Tree Maximal Flow Algorithm LP formulation 1.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt Vocabulary.
Localisation and speech perception UK National Paediatric Bilateral Audit. Helen Cullington 11 April 2013.
Operating Systems Operating Systems - Winter 2010 Chapter 3 – Input/Output Vrije Universiteit Amsterdam.
Exarte Bezoek aan de Mediacampus Bachelor in de grafische en digitale media April 2014.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
Lilian Blot PART III: ITERATIONS Core Elements Autumn 2012 TPOP 1.
Adding Up In Chunks.
MaK_Full ahead loaded 1 Alarm Page Directory (F11)
1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt Synthetic.
Artificial Intelligence
Splines IV – B-spline Curves
GEtServices Services Training For Suppliers Requests/Proposals.
: 3 00.
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Speak Up for Safety Dr. Susan Strauss Harassment & Bullying Consultant November 9, 2012.
1 Titre de la diapositive SDMO Industries – Training Département MICS KERYS 09- MICS KERYS – WEBSITE.
Converting a Fraction to %
Numerical Analysis 1 EE, NCKU Tien-Hao Chang (Darby Chang)
Clock will move after 1 minute
Physics for Scientists & Engineers, 3rd Edition
Select a time to count down from the clock above
Distributed Computing 9. Sorting - a lower bound on bit complexity Shmuel Zaks ©
Copyright Tim Morris/St Stephen's School
1 Dr. Scott Schaefer Least Squares Curves, Rational Representations, Splines and Continuity.
Impossibility of Consensus in Asynchronous Systems (FLP) Ali Ghodsi – UC Berkeley / KTH alig(at)cs.berkeley.edu.
1 Decidability continued…. 2 Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the.
Dead Reckoning Objectives – –Understand what is meant by the term dead reckoning. –Realize the two major components of a dead reckoning protocol. –Be capable.
IEEE Virtual Reality 2011 Introduction to Networked Graphics Anthony Steed Part 3: Latency Scalability.
Introduction to Networked Graphics Part 3 of 5: Latency.
Time Manipulation.  The game states rendered at the clients are different because latency is dependent on the location of the client from the server.
Dead Reckoning. Outline Basic Dead Reckoning Model (DRM) –Generating state updates –Position extrapolation Refinements –Time compensation –Smoothing.
Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency.
Presentation transcript:

Introduction to Networked Graphics Latency Compensation

2 Need for Latency Compensation/Mitigation Techniques Latency Compensation and Cheating Latency and how to Compensate

3 What is Latency Compensation? Latency compensation is the method of hiding network latency using various techniques, minimizing its effect so that the system appears responsive and accurate. Some games can use simple techniques - delay and responsiveness is not critical. Conservative/Pessimistic Some games require more complex techniques that can lead to errors/inconsistent states, but are responsive to user actions and more effective at hiding latencies between systems. Optimistic/Aggressive Algorithms

4 Impact  Inconsistent state between:  clients, and  client and server  In accuracies between views  Can cause inequities between players Fairness Scoring  Can disrupt play

CONSERVATIVE (Pessimistic) TECHNIQUES

6 Lockstep Synchronization  Only display updates of moves or actions when all clients have submitted their messages.  Can incur high delays – ie low reponsiveness on the clients  How can you guarantee that each client has responded?  Does a no response mean no action or a network loss  Have to incorporate an “alive” message from clients if they have sent no action message!  Can be implemented by client/server or P2P model.

7 Conservative Mitigation  Lock-step are simple examples of conservative simulations  Usually, there is no side-effect of the event you were waiting for  E.G. in Quake, a lot of the time the other player’s position is not important  Why wait for events? Why not just proceed  Answer is that you diverge IF you got shot  However, for many simulations you can decouple event sequences

8 Naïve (But Usable) Algorithms  Most naïve way to ensure consistency is to allow only one application to evolve state at once  One application sends its state, the others wait to receive, then one proceeds

9 Total Consistency (Alternating Execute) T = t Acknowledge every update Propagation delay is 100ms Client A Client B

10 Total Consistency (Alternating Execute) Client A Client B T = t + 50ms

11 Total Consistency (Alternating Execute) Delta T Client A Client B T = t + 50 ms ms Delta T (latency) is 100ms

12 Total Consistency (Acknowledge Action) T = t + 50ms + 100ms + 50ms Client A Client B

13 Total Consistency (Alternating Execute) T = t + 50ms + 100ms + 50ms + 100ms T = t + 300ms After 300ms Client A may move again!!! Client A Client B Delta T

14 Lock-Step (1) – Peer to Peer (P2P)  If all clients can deterministically act on the input data  Then a more useful form lock-step for NVEs & NGs is that everyone exchange input, proceed once you have all the information from other clients  But for many simulations, each step is only determined by user input, so can just communicate input

15 DOOM (1) – iD Software Doom Client A Read Input Rendering Receive Input Simulate Doom Client B Read Input Rendering Receive Input Simulate Doom Client C Read Input Rendering Receive Input Simulate

16 Lock-Step (2) – Client Server (C/S)  If the simulation is complex or non-deterministic, use a server to compute the state  Clients are locked to the update rate of the server  Note that own input is delayed (low responsiveness)

17 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 Quake (1 Pre-QuakeWorld) – iD Software

18 Time  Real-time synchronization needs a notion of time  IF every event could be time stamped you could accurately reconstruct the recent past  In reality clocks on machines can not be synchronized  Can get close with Network Time Protocol  Still not sufficient, applications tend to measure inter-client latency using round-trip times 

19 Virtual Time  Sometimes it is sufficient to be able to order events  Lamport’s Virtual Time is really an event counter  An event can indicate which events caused it, and which it depends on  Thus, e.g. say Event Explode caused Event Fire  If Event Explode says “Event Fire caused me” then anyone who has Event Explode waits for Event Fire  This can be implemented for simple situations with just incremental counting ( Event N+1 is held until Event N is played)

20 Causal Ordering of Events  Each client has its own clock and virtual time associated with the game  Clients know that certain actions cannot occur before others.  E.g., explode action cannot happen before fire/shot  Playout events based upon when a message is received and its dependency.  Depencies can get complex and long  Requires Time Warping to recover from errors.

OPTIMISTIC ALGORITHMS

22 Optimistic Algorithms  Conservative simulations tend to be slowed paced  Optimistic algorithms play out events as soon as possible  Of course, this means that they can get things wrong:  They may receive an event that happened in the past  To fix this they rollback by sending UNDO events  For many simulations UNDO is easy (just move something)

23 Aggressive Mitigation Techniques There are various methods that can be applied to compensate for latency or mute/minimize its effect on the game play: Optimistic Algorithms Prediction  Player/Client – dead reckoning  Player/Opponent Time Manipulation  Time Delay  Time Warp  Data Compression Visual Tricks

24 Client A Client B Lock Door Open Door Client C Add Zombies Remove Zombies Close Door t0t0 t1t1 t2t2 t3t3 t4t4 Getting Things Wrong…..

25 Prediction  Client Prediction – immediate feedback on local client  Opponent Prediction – extrapolation based upon data received from opponent.  Many different implementations with smoothing algorithms to reduce jerkiness and bizarre situations with walking thru walls, etc.

CLIENT PREDICT AHEAD

27 Predict Ahead  A form of optimism: assume that you can predict what a server (or another peer) is going to do with your simulation  Very commonly applied in games & simulations for your own player/vehicle movement  You assume that your control input (e.g. move forward) is going to be accepted by the server  If it isn’t, then you are moved back  Note this isn’t forwards in time but a prediction of the current canonical state (which isn’t yet known!)

28 Player Prediction - Steps The client takes input from the user (player) The client predicts the server response only for the local player's actions The player’s actions are not subjected to the round trip delay (to the server and back), thus removing any network latency The game appears very responsive -> like a non- networked game

29 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 Moves and Server Echos Moves

30 Drawbacks: If there is a discrepancy between the game server response and the client side prediction, the client needs to make the adjustment in the game state (client thinks he shot someone, but the other player could have moved at the same time) These adjustments could be abrupt and could cause jitter and deteriorate the consistency/flow of the game. A client could use Interpolation, between the rendered local world and the server update showing the position of units at a later time instead of immediately rendering the latest update the client interpolates the world at intermediate states, allowing the local world state to progress smoothly to the server world state. NOTE: There is trade-off between game responsiveness and game consistency

31 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 Server Adjusts Position – Client Reacts

32 Three approaches to client behavior when correction is called for: - Stop and wait - Move around and continue - Walk right thru and continue Client Behavior for Corrections

33 Prediction Algorithm - Summary Sample user input Pack up data and send to server Determine visible objects and game state Render scene based on local actions Receive updates from server and unpack Correct for any discrepancies (new state space reflecting other player actions and system changes) Repeat

34 Impact of Player Prediction:  Responsiveness and consistency tradeoff – more responsive less consistent/accurate

Opponent Prediction - EXTRAPOLATION ALGORITHMS

36 O pponent Prediction In this technique the location and movement of an opponent's unit is predicted by the client It starts on the basis of the opponent’s unit's last known position: Client computes the current predicted position based on the unit's speed, acceleration and direction of movement. This information is provided by the opponent - updates. The predicted positions of the opponent's unit are used until the opponent sends an update for the new position. because the current predicted position falls outside of an acceptable position range threshold - ERROR.

37 Updates The update is sent when the unit owner determines that the other players are not able to accurately predict the position within the predetermined threshold Predetermined threshold refers to the acceptable range around the actual position of the opponent, where the predicted opponent's unit can be placed and considered to be a correct position. Often depends on size of object…… and objective of play.

38 Opponent Prediction Cont'd

39 Opponent Prediction Explained The picture shows the view by the owner of the unit. The solid line in the middle shows the actual path as the player controlling the unit would see it. The two thinner, dashed lines that run parallel to the middle line represent the threshold for the opponent predictions. The thicker dashed lines represent the unit owner’s record/trace of the opponent’s prediction. If the unit owner’s predicted location of the airplane goes outside this threshold, the unit owner sends a message to all opponents with an update on the new position and direction.

40 Opponent Prediction - Error The initial position, velocity, acceleration, and direction is sent at time t 0, and subsequent updates are sent at t 1, t 2, and t 3. The bottom picture depicts the view that the opponents would see. The opponents use the last known position and direction to predict the unit location until an update is received, whereupon the new position and direction are used and the game view is corrected for any errors.

41 Prediction Model - Extrapolation  1 st order model  2 nd order model

42 1 st Order Model Using Velocity Only with Position

43 2 nd Order Model Adding Acceleration

44 Extrapolation Summary  Note that if this extrapolation is true you never need to send another event!  It will be wrong (diverge) if acceleration changes  BUT you can wait until it diverges a little bit (exceeds threshold) before sending events  The sender can calculate the results as if others were interpolating (a ghost), and send an update when the ghost and real position diverge beyond an acceptable ERROR threshold.

45 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

46 Convergence Algorithm  When they do diverge, you don’t want the receiver to just jump: smoothly interpolate back again  This is hard:  Can linearly interpolate between old and new position over time – path interpolation strategy. Could cause problems such as direction of object may not be the same as direction of velocity.  Can have object change direction to follow new path, steering it in right direction – path planning strategy. Could cause a vehicle to make a sudden turn. Would not work for all objects.

47 d) Blending between the old ghost and new ghost over several frames e) Ghost model path with blending Path Interpolation Strategy

48 Convergence Algorithm  So you could steer the vehicle to correct its own position  This has frequency instabilities  Deals badly with obstacles as the interpolated path isn’t the same as the real path

49 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 Path Planning Strategy

50 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 Path Planning Strategy - Problems

51 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 Path Planning Strategy – out of Sync

52 c) On the next update message the ghost model is out of phase with the player model. T

53 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 Path Planning Strategy – No Convergence

54 Trade-offs of Opponent Prediction It requires that each client run an algorithm to extrapolate the location of each opponent unit for each frame rendered Smaller values for the update threshold can provide more fidelity in opponent's prediction at the cost of requiring more frequent updates: requires higher bandwidth and processing overhead On the other hand, larger values of the update threshold provide decreased fidelity and requires fewer updates: lower update rate less bandwidth and lower processing overhead This tradeoff depends on the game, the network, the client processor/hardware and the players’ preference. Fairness – players further away get updates to locations later than others and so are at a disadvantage with seeing a wrong “game view”. Solution: send clients further away more location updates. NOTE: Errors in prediction can result in game disruptions.

55 Summary: Extrapolation Algorithms  Because we “see” the historic events of remote clients, can we predict further ahead (i.e. in to their future!)  This is most commonly done for position and velocity, in which case it is known as dead-reckoning  You know the position and velocity at a previous time, so where should it be now?  Two requirements:  Extrapolation algorithm: how to predict?  Convergence algorithm: what if you got it wrong?