SlideShare a Scribd company logo
1 of 75
Download to read offline
Lecture 3
                  Dead Reckoning
                         and
               Local Perception Filter
                             25 January 2010


Saturday, January 23, 2010                     1
states

                      Simulate             Collect Events
                                  events
                       Game
                                                            Game
                             or                             States

                         Game                 Render
                         States

                                               Wait




Saturday, January 23, 2010                                           2
What if a state changes continuously (i.e., is a
                     function of time) ?


                             Player A


                             Server


                             Player B



Saturday, January 23, 2010                                              3
Consider position updates of players. Players
                     send move command. Server replies with
                     positions periodically.


                             Player A


                             Server


                             Player B



Saturday, January 23, 2010                                           4
Two issues:

                             1. Message overhead
                             2. Delay jitter



Saturday, January 23, 2010                         5
Delay jitter causes player’s movement to appear
                  erratic.




                                                            Player A



                                                            Server
                                               time


Saturday, January 23, 2010                                             6
Recall: Short circuiting is used to predict own
                    states. We can similarly predict opponent’s
                    state.

                             Player A


                             Server


                             Player B



Saturday, January 23, 2010                                            7
Suppose the velocity remains constant, then we
                  can predict every position at all time.

                                          predicted position


                                                          Player A



                                                           Server
                                              time


Saturday, January 23, 2010                                           8
x[t]   position of entity at time t

                           v    velocity of the entity



        x[ti ] = x[ti−1 ] + v × (ti − ti−1 )


Saturday, January 23, 2010                                     9
We send over the initial position x[t], t, and
                  velocity. (Why do we need to send t?)

                                             predicted position


                                                              Player A



                                                               Server
                                                 time


Saturday, January 23, 2010                                               10
But velocity may change (e.g. a car accelerating).
                  To counter this, we send position, velocity, and
                  acceleration as update.



                                                               Player A



                                                               Server
                                                 time


Saturday, January 23, 2010                                                11
x[t]   position of entity at time t

                           v    velocity of the entity

                           a    acceleration of the entity

                                              1
           x[ti ] = x[ti−1 ] + v(ti − ti−1 ) + a(ti − ti−1 )2
                                              2



Saturday, January 23, 2010                                      12
We will still need substantial number of updates
                  if the direction changes frequently (e.g. in a FPS
                  game).


                               B
                                                               Player A



                                                               Server
                                                time


Saturday, January 23, 2010                                                13
idea: trade-off message
                             overhead and accuracy.
                             No need to update if error
                             is small.



Saturday, January 23, 2010                                14
Player A
                                error threshold

                                         Server


                             time
Saturday, January 23, 2010                          15
Player A



                                    Server


                             time
Saturday, January 23, 2010                     16
Player A



                                    Server


                             time
Saturday, January 23, 2010                     17
predicted position at A

                             A’s predicted position at the server



                                                                    Player A



                                                                    Server


                                                       time
Saturday, January 23, 2010                                                     18
A’s version of the entity’s position is now too far
             away from the correct position. Server updates A
             with the new velocity and position.



                                                         Player A



                                                         Server


                                            time
Saturday, January 23, 2010                                          19
A converges the entity to the correct
                                     position smoothly.




                                                                 Player A



                                                                 Server


                                                     time
Saturday, January 23, 2010                                                  20
how to set error
                               threshold?



Saturday, January 23, 2010                      21
adapt based on game
                                 requirement
                             (e.g. distance to other players)




Saturday, January 23, 2010                                      22
Space inconsistency: due to error threshold and
             convergence
             Time inconsistency: due to message delay and
             clock asynchrony


                                                      Player A



                                                      Server


                                          time
Saturday, January 23, 2010                                       23
What is the difference between
                   the actual and predicted
                   position ?

                   How long does the difference
                   last?

Saturday, January 23, 2010                          24
error




                                                   time


                                 inconsistency =

Saturday, January 23, 2010                                25
what are the different components of distance
             error?



                                                       Player A



                                                       Server


                                           time
Saturday, January 23, 2010                                        26
Any drawbacks?



Saturday, January 23, 2010                    27
higher CPU cost
                             (needs to simulate other players)

                                         unfair
                   (higher latency leads to larger error)



Saturday, January 23, 2010                                       28
Dead Reckoning



Saturday, January 23, 2010                    29
Generalized Dead Reckoning :
            Prediction Contract



Saturday, January 23, 2010              30
“return to base”
                             “drive along this road”



Saturday, January 23, 2010                             31
Server and clients must have a
                     common notion of “time”




Saturday, January 23, 2010                          32
Two choices:

                              Wall Clock
                              Game Clock



Saturday, January 23, 2010                  33
Wall Clock: clients and
                             server have to synchronize
                             their physical clocks using
                             NTP or SNTP.



Saturday, January 23, 2010                                 34
now is
                 10:18:32      now is
                             10:18:29.5

                              now is
                             10:18:30
                now is
              10:18:33.5




Saturday, January 23, 2010                35
now is
                 10:18:32                           now is
                                                  10:18:29.5

                                                   now is
                                                  10:18:30
                now is
              10:18:33.5


                             Time now should be
                                 10:18:30.5
                                RTT = 1s
                               OWD = 0.5s
Saturday, January 23, 2010                                     36
Players try to sync the game states with the
                    server at the same wallclock time, and predict
                    ahead with an amount of time equal to one-
                    way delay.


                             Player A


                             Server


                             Player B


Saturday, January 23, 2010                                           37
or: synchronize states to game clock, which
                     runs behind the server by an amount of time
                     equals to the one-way delay.


                             Player A


                             Server


                             Player B


Saturday, January 23, 2010                                         38
what A sees
                                                       what B sees




                                           A   S   B
                                           3   4   2        game clock

Saturday, January 23, 2010                                               39
Example: using game clock




Saturday, January 23, 2010                               40
A decides to move. Send event to S.




            A            S    B
            1            2    0


Saturday, January 23, 2010                                         41
S receives event, moves A, and
                             tells A and B that A is moving at t = 3




            A            S    B    A    S   B
            1            2     0    2   3    1


Saturday, January 23, 2010                                             42
A moves itself at t = 3.




            A            S   B   A   S   B    A   S    B
            1            2   0   2   3   1    3   4    2


Saturday, January 23, 2010                                  43
B moves A at t = 3.




            A            S   B   A    S    B   A    S      B   A   S   B
            1            2   0   2     3   1   3    4      2   4   5   3


Saturday, January 23, 2010                                                 44
Example: using wallclock




Saturday, January 23, 2010                              45
A decides to move. Send event to S.




            A            S    B
            0            0    0


Saturday, January 23, 2010                                         46
S receives event, moves A, and
                             tells A and B that A is moving at t = 1




            A            S    B    A    S   B
            0            0     0    1   1    1


Saturday, January 23, 2010                                             47
A moves itself to where it should be at t = 2.




            A            S   B   A   S   B   A   S   B
            0            0   0   1   1   1   2   2    2


Saturday, January 23, 2010                                            48
B finds out A moves at t = 1 and
                             moves A to where A should be at t = 3




            A            S     B   A    S   B   A   S   B    A   S   B
               0         0     0    1   1   1   2   2    2   3   3   3


Saturday, January 23, 2010                                               49
Tight synchronization allows
                   interaction but can lead to
                   visual disruptions.



Saturday, January 23, 2010                        50
Asynchronization allows
                   smooth movement but hinder
                   interaction.



Saturday, January 23, 2010                      51
Local Perception Filter



Saturday, January 23, 2010                    52
Hybrid Model:
                 Render objects within real-
                  time interaction range in
                 real time, other objects in
                        delayed time.

Saturday, January 23, 2010                     53
Two Kinds of Entities
                    Active:
                    	

 	

 players (unpredictable)
                    Passive:
                    	

 	

 ball, bullet (predictable)

Saturday, January 23, 2010                               54
happening
                               now

                             A



                                             happened
                                         B   time t ago




Saturday, January 23, 2010                                55
Question:
                 What if a player A throws a
                     ball at player B?


Saturday, January 23, 2010                     56
happening
                               now

                             A



                                             happened
                                         B   time t ago




Saturday, January 23, 2010                                57
Question:
                 What if a player B throws a
                     ball at player A?


Saturday, January 23, 2010                     58
happening
                               now

                             A



                                             happened
                                         B   time t ago




Saturday, January 23, 2010                                59
Distance of ball (thrown by A) from A versus time.
          distance                          now       time t ago




                         time t ago
                         now




                                                            time

Saturday, January 23, 2010                                         60
What A sees..
          distance




                         time t ago
                         now




                                                      time

Saturday, January 23, 2010                                   61
Distance of ball (thrown by B) from A versus time.
          distance




                         time t ago
                         now


                                                   time t ago
                                        now                 time

Saturday, January 23, 2010                                         62
Distance of ball (thrown by B) from A versus time.
          distance




                         time t ago
                         now




                                                            time

Saturday, January 23, 2010                                         63
A       happened t ago
                                     happened t - 1 ago
                                     happened t - 2 ago


                                 B




Saturday, January 23, 2010                                64
Question:
                 What if a player A throws a
                     ball at player B?


Saturday, January 23, 2010                     65
What A sees..
          distance




                                             time

Saturday, January 23, 2010                          66
What A sees..
          distance




                                             time

Saturday, January 23, 2010                          67
Question:
                 What if a player B throws a
                     ball at player A?


Saturday, January 23, 2010                     68
Distance of ball (thrown by B) from A versus time.
          distance




                                                            time

Saturday, January 23, 2010                                         69
Saturday, January 23, 2010   70
time




Saturday, January 23, 2010          71
3 slots ago


                                    2 slots ago


                                    1 slots ago


                                     now


                             time




Saturday, January 23, 2010                        72
Assignment 1




Saturday, January 23, 2010                  73
Saturday, January 23, 2010   74
Assignment 1




Saturday, January 23, 2010                  75

More Related Content

Viewers also liked

Social Media Affiliate Marketing
Social Media Affiliate MarketingSocial Media Affiliate Marketing
Social Media Affiliate MarketingJordan Kasteler
 
Harlan Beverly Lag The Barrier to innovation gdc austin 2009
Harlan Beverly Lag The Barrier to innovation gdc austin 2009Harlan Beverly Lag The Barrier to innovation gdc austin 2009
Harlan Beverly Lag The Barrier to innovation gdc austin 2009Harlan Beverly
 
Senarai rekod pinjaman guru
Senarai rekod pinjaman guruSenarai rekod pinjaman guru
Senarai rekod pinjaman guruAhmad Fadhli
 
3 d生動的牆畫
3 d生動的牆畫3 d生動的牆畫
3 d生動的牆畫建興 賴
 
Norma regulamentador 5
Norma regulamentador 5Norma regulamentador 5
Norma regulamentador 5scardosom
 
EXPERIENCIAS DE AULA
EXPERIENCIAS DE AULAEXPERIENCIAS DE AULA
EXPERIENCIAS DE AULANidiatati
 
Clases sociales
Clases socialesClases sociales
Clases socialesLuis Ojeda
 
Препорака 2 Филип Лазаревски.PDF
Препорака 2 Филип Лазаревски.PDFПрепорака 2 Филип Лазаревски.PDF
Препорака 2 Филип Лазаревски.PDFFilip Lazarevski
 
Membros designados pelo empregador CIPA
Membros designados pelo empregador CIPAMembros designados pelo empregador CIPA
Membros designados pelo empregador CIPAValter Oliveira
 
Aula 02 7 Ppad 2010 1
Aula 02 7 Ppad 2010 1Aula 02 7 Ppad 2010 1
Aula 02 7 Ppad 2010 1Ney Queiroz
 
2016-06 China Car Sales FAW June 2016
2016-06 China Car Sales FAW June 20162016-06 China Car Sales FAW June 2016
2016-06 China Car Sales FAW June 2016Uli Kaiser
 
Ebooks Elsevier: ebooks para ensino e pesquisa
Ebooks Elsevier: ebooks para ensino e pesquisaEbooks Elsevier: ebooks para ensino e pesquisa
Ebooks Elsevier: ebooks para ensino e pesquisasibi_ufrj
 
Inspeccion escolar 007
Inspeccion escolar 007Inspeccion escolar 007
Inspeccion escolar 007emmstone
 
Aula 01 7 Ppan 2010 1
Aula 01 7 Ppan 2010 1Aula 01 7 Ppan 2010 1
Aula 01 7 Ppan 2010 1Ney Queiroz
 
Introdução á recepção da obra de jorge andrade
Introdução á recepção da obra de jorge andradeIntrodução á recepção da obra de jorge andrade
Introdução á recepção da obra de jorge andradecurtponcem
 
OSN 2015 Okechukwu Memorial Lecture Andrew Gani-Ikilama
OSN 2015 Okechukwu Memorial Lecture  Andrew Gani-IkilamaOSN 2015 Okechukwu Memorial Lecture  Andrew Gani-Ikilama
OSN 2015 Okechukwu Memorial Lecture Andrew Gani-IkilamaAndrew Gani-Ikilama
 

Viewers also liked (19)

Social Media Affiliate Marketing
Social Media Affiliate MarketingSocial Media Affiliate Marketing
Social Media Affiliate Marketing
 
Harlan Beverly Lag The Barrier to innovation gdc austin 2009
Harlan Beverly Lag The Barrier to innovation gdc austin 2009Harlan Beverly Lag The Barrier to innovation gdc austin 2009
Harlan Beverly Lag The Barrier to innovation gdc austin 2009
 
Senarai rekod pinjaman guru
Senarai rekod pinjaman guruSenarai rekod pinjaman guru
Senarai rekod pinjaman guru
 
3 d生動的牆畫
3 d生動的牆畫3 d生動的牆畫
3 d生動的牆畫
 
Norma regulamentador 5
Norma regulamentador 5Norma regulamentador 5
Norma regulamentador 5
 
EXPERIENCIAS DE AULA
EXPERIENCIAS DE AULAEXPERIENCIAS DE AULA
EXPERIENCIAS DE AULA
 
Clases sociales
Clases socialesClases sociales
Clases sociales
 
Development of a volcanic ash forecasting model - Damien Martin
Development of a volcanic ash forecasting model - Damien MartinDevelopment of a volcanic ash forecasting model - Damien Martin
Development of a volcanic ash forecasting model - Damien Martin
 
Препорака 2 Филип Лазаревски.PDF
Препорака 2 Филип Лазаревски.PDFПрепорака 2 Филип Лазаревски.PDF
Препорака 2 Филип Лазаревски.PDF
 
Membros designados pelo empregador CIPA
Membros designados pelo empregador CIPAMembros designados pelo empregador CIPA
Membros designados pelo empregador CIPA
 
Aula 02 7 Ppad 2010 1
Aula 02 7 Ppad 2010 1Aula 02 7 Ppad 2010 1
Aula 02 7 Ppad 2010 1
 
2016-06 China Car Sales FAW June 2016
2016-06 China Car Sales FAW June 20162016-06 China Car Sales FAW June 2016
2016-06 China Car Sales FAW June 2016
 
Ebooks Elsevier: ebooks para ensino e pesquisa
Ebooks Elsevier: ebooks para ensino e pesquisaEbooks Elsevier: ebooks para ensino e pesquisa
Ebooks Elsevier: ebooks para ensino e pesquisa
 
Inspeccion escolar 007
Inspeccion escolar 007Inspeccion escolar 007
Inspeccion escolar 007
 
CARMELO TERESIANO: Communicationes 289
CARMELO TERESIANO: Communicationes 289CARMELO TERESIANO: Communicationes 289
CARMELO TERESIANO: Communicationes 289
 
O corpo da moda
O corpo da modaO corpo da moda
O corpo da moda
 
Aula 01 7 Ppan 2010 1
Aula 01 7 Ppan 2010 1Aula 01 7 Ppan 2010 1
Aula 01 7 Ppan 2010 1
 
Introdução á recepção da obra de jorge andrade
Introdução á recepção da obra de jorge andradeIntrodução á recepção da obra de jorge andrade
Introdução á recepção da obra de jorge andrade
 
OSN 2015 Okechukwu Memorial Lecture Andrew Gani-Ikilama
OSN 2015 Okechukwu Memorial Lecture  Andrew Gani-IkilamaOSN 2015 Okechukwu Memorial Lecture  Andrew Gani-Ikilama
OSN 2015 Okechukwu Memorial Lecture Andrew Gani-Ikilama
 

More from Wei Tsang Ooi

SIGMM Education Effort Presentation at Business Meeting
SIGMM Education Effort Presentation at Business MeetingSIGMM Education Effort Presentation at Business Meeting
SIGMM Education Effort Presentation at Business MeetingWei Tsang Ooi
 
The Computer Science behind YouTube
The Computer Science behind YouTubeThe Computer Science behind YouTube
The Computer Science behind YouTubeWei Tsang Ooi
 
CS4344 09/10 Lecture 10: Transport Protocol for Networked Games
CS4344 09/10 Lecture 10: Transport Protocol for Networked GamesCS4344 09/10 Lecture 10: Transport Protocol for Networked Games
CS4344 09/10 Lecture 10: Transport Protocol for Networked GamesWei Tsang Ooi
 
CS4344 09/10 Lecture 9: Characteristics of Networked Game Traffic
CS4344 09/10 Lecture 9: Characteristics of Networked Game TrafficCS4344 09/10 Lecture 9: Characteristics of Networked Game Traffic
CS4344 09/10 Lecture 9: Characteristics of Networked Game TrafficWei Tsang Ooi
 
CS4344 09/10 Lecture 8: Hybrid Architecture
CS4344 09/10 Lecture 8: Hybrid ArchitectureCS4344 09/10 Lecture 8: Hybrid Architecture
CS4344 09/10 Lecture 8: Hybrid ArchitectureWei Tsang Ooi
 
CS4344 09/10 Lecture 7: P2P Interest Management
CS4344 09/10 Lecture 7: P2P Interest ManagementCS4344 09/10 Lecture 7: P2P Interest Management
CS4344 09/10 Lecture 7: P2P Interest ManagementWei Tsang Ooi
 
CS4344 09/10 Lecture 6: P2P Synchronization
CS4344 09/10 Lecture 6: P2P SynchronizationCS4344 09/10 Lecture 6: P2P Synchronization
CS4344 09/10 Lecture 6: P2P SynchronizationWei Tsang Ooi
 
Cs4344 09/10 Lecture 5: Interest Management
Cs4344 09/10 Lecture 5: Interest ManagementCs4344 09/10 Lecture 5: Interest Management
Cs4344 09/10 Lecture 5: Interest ManagementWei Tsang Ooi
 
CS4344 09/10 Lecture 2: Consistency
CS4344 09/10 Lecture 2: ConsistencyCS4344 09/10 Lecture 2: Consistency
CS4344 09/10 Lecture 2: ConsistencyWei Tsang Ooi
 
CS4344 09/10 Lecture 1: Introduction
CS4344 09/10 Lecture 1: IntroductionCS4344 09/10 Lecture 1: Introduction
CS4344 09/10 Lecture 1: IntroductionWei Tsang Ooi
 
CS5229 09/10 Lecture 11: DNS
CS5229 09/10 Lecture 11: DNSCS5229 09/10 Lecture 11: DNS
CS5229 09/10 Lecture 11: DNSWei Tsang Ooi
 
CS5229 09/10 Lecture 10: Internet Routing
CS5229 09/10 Lecture 10: Internet RoutingCS5229 09/10 Lecture 10: Internet Routing
CS5229 09/10 Lecture 10: Internet RoutingWei Tsang Ooi
 
CS5229 09/10 Lecture 9: Internet Packet Dynamics
CS5229 09/10 Lecture 9: Internet Packet DynamicsCS5229 09/10 Lecture 9: Internet Packet Dynamics
CS5229 09/10 Lecture 9: Internet Packet DynamicsWei Tsang Ooi
 
CS5229 09/10 Lecture 6: Simulation
CS5229 09/10 Lecture 6: SimulationCS5229 09/10 Lecture 6: Simulation
CS5229 09/10 Lecture 6: SimulationWei Tsang Ooi
 
Lecture 4: TCP and TFRC
Lecture 4: TCP and TFRCLecture 4: TCP and TFRC
Lecture 4: TCP and TFRCWei Tsang Ooi
 
Lecture 2: Congestion Control and Avoidance
Lecture 2: Congestion Control and AvoidanceLecture 2: Congestion Control and Avoidance
Lecture 2: Congestion Control and AvoidanceWei Tsang Ooi
 
Lecture 0: Introduction to CS5229
Lecture 0: Introduction to CS5229Lecture 0: Introduction to CS5229
Lecture 0: Introduction to CS5229Wei Tsang Ooi
 
Lecture 1: Design Principles of the Internet
Lecture 1: Design Principles of the InternetLecture 1: Design Principles of the Internet
Lecture 1: Design Principles of the InternetWei Tsang Ooi
 

More from Wei Tsang Ooi (20)

SIGMM Education Effort Presentation at Business Meeting
SIGMM Education Effort Presentation at Business MeetingSIGMM Education Effort Presentation at Business Meeting
SIGMM Education Effort Presentation at Business Meeting
 
CS2106 Tutorial 2
CS2106 Tutorial 2CS2106 Tutorial 2
CS2106 Tutorial 2
 
The Computer Science behind YouTube
The Computer Science behind YouTubeThe Computer Science behind YouTube
The Computer Science behind YouTube
 
CS4344 09/10 Lecture 10: Transport Protocol for Networked Games
CS4344 09/10 Lecture 10: Transport Protocol for Networked GamesCS4344 09/10 Lecture 10: Transport Protocol for Networked Games
CS4344 09/10 Lecture 10: Transport Protocol for Networked Games
 
CS4344 09/10 Lecture 9: Characteristics of Networked Game Traffic
CS4344 09/10 Lecture 9: Characteristics of Networked Game TrafficCS4344 09/10 Lecture 9: Characteristics of Networked Game Traffic
CS4344 09/10 Lecture 9: Characteristics of Networked Game Traffic
 
CS4344 09/10 Lecture 8: Hybrid Architecture
CS4344 09/10 Lecture 8: Hybrid ArchitectureCS4344 09/10 Lecture 8: Hybrid Architecture
CS4344 09/10 Lecture 8: Hybrid Architecture
 
CS4344 09/10 Lecture 7: P2P Interest Management
CS4344 09/10 Lecture 7: P2P Interest ManagementCS4344 09/10 Lecture 7: P2P Interest Management
CS4344 09/10 Lecture 7: P2P Interest Management
 
CS4344 09/10 Lecture 6: P2P Synchronization
CS4344 09/10 Lecture 6: P2P SynchronizationCS4344 09/10 Lecture 6: P2P Synchronization
CS4344 09/10 Lecture 6: P2P Synchronization
 
Cs4344 09/10 Lecture 5: Interest Management
Cs4344 09/10 Lecture 5: Interest ManagementCs4344 09/10 Lecture 5: Interest Management
Cs4344 09/10 Lecture 5: Interest Management
 
CS4344 09/10 Lecture 2: Consistency
CS4344 09/10 Lecture 2: ConsistencyCS4344 09/10 Lecture 2: Consistency
CS4344 09/10 Lecture 2: Consistency
 
CS4344 09/10 Lecture 1: Introduction
CS4344 09/10 Lecture 1: IntroductionCS4344 09/10 Lecture 1: Introduction
CS4344 09/10 Lecture 1: Introduction
 
CS5229 09/10 Lecture 11: DNS
CS5229 09/10 Lecture 11: DNSCS5229 09/10 Lecture 11: DNS
CS5229 09/10 Lecture 11: DNS
 
CS5229 09/10 Lecture 10: Internet Routing
CS5229 09/10 Lecture 10: Internet RoutingCS5229 09/10 Lecture 10: Internet Routing
CS5229 09/10 Lecture 10: Internet Routing
 
CS5229 09/10 Lecture 9: Internet Packet Dynamics
CS5229 09/10 Lecture 9: Internet Packet DynamicsCS5229 09/10 Lecture 9: Internet Packet Dynamics
CS5229 09/10 Lecture 9: Internet Packet Dynamics
 
CS5229 09/10 Lecture 6: Simulation
CS5229 09/10 Lecture 6: SimulationCS5229 09/10 Lecture 6: Simulation
CS5229 09/10 Lecture 6: Simulation
 
Lecture 5: RED
Lecture 5: REDLecture 5: RED
Lecture 5: RED
 
Lecture 4: TCP and TFRC
Lecture 4: TCP and TFRCLecture 4: TCP and TFRC
Lecture 4: TCP and TFRC
 
Lecture 2: Congestion Control and Avoidance
Lecture 2: Congestion Control and AvoidanceLecture 2: Congestion Control and Avoidance
Lecture 2: Congestion Control and Avoidance
 
Lecture 0: Introduction to CS5229
Lecture 0: Introduction to CS5229Lecture 0: Introduction to CS5229
Lecture 0: Introduction to CS5229
 
Lecture 1: Design Principles of the Internet
Lecture 1: Design Principles of the InternetLecture 1: Design Principles of the Internet
Lecture 1: Design Principles of the Internet
 

Recently uploaded

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 

Recently uploaded (20)

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 

CS4344 09/10 Lecture 3: Dead Reckoning and Local Perception Filter

  • 1. Lecture 3 Dead Reckoning and Local Perception Filter 25 January 2010 Saturday, January 23, 2010 1
  • 2. states Simulate Collect Events events Game Game or States Game Render States Wait Saturday, January 23, 2010 2
  • 3. What if a state changes continuously (i.e., is a function of time) ? Player A Server Player B Saturday, January 23, 2010 3
  • 4. Consider position updates of players. Players send move command. Server replies with positions periodically. Player A Server Player B Saturday, January 23, 2010 4
  • 5. Two issues: 1. Message overhead 2. Delay jitter Saturday, January 23, 2010 5
  • 6. Delay jitter causes player’s movement to appear erratic. Player A Server time Saturday, January 23, 2010 6
  • 7. Recall: Short circuiting is used to predict own states. We can similarly predict opponent’s state. Player A Server Player B Saturday, January 23, 2010 7
  • 8. Suppose the velocity remains constant, then we can predict every position at all time. predicted position Player A Server time Saturday, January 23, 2010 8
  • 9. x[t] position of entity at time t v velocity of the entity x[ti ] = x[ti−1 ] + v × (ti − ti−1 ) Saturday, January 23, 2010 9
  • 10. We send over the initial position x[t], t, and velocity. (Why do we need to send t?) predicted position Player A Server time Saturday, January 23, 2010 10
  • 11. But velocity may change (e.g. a car accelerating). To counter this, we send position, velocity, and acceleration as update. Player A Server time Saturday, January 23, 2010 11
  • 12. x[t] position of entity at time t v velocity of the entity a acceleration of the entity 1 x[ti ] = x[ti−1 ] + v(ti − ti−1 ) + a(ti − ti−1 )2 2 Saturday, January 23, 2010 12
  • 13. We will still need substantial number of updates if the direction changes frequently (e.g. in a FPS game). B Player A Server time Saturday, January 23, 2010 13
  • 14. idea: trade-off message overhead and accuracy. No need to update if error is small. Saturday, January 23, 2010 14
  • 15. Player A error threshold Server time Saturday, January 23, 2010 15
  • 16. Player A Server time Saturday, January 23, 2010 16
  • 17. Player A Server time Saturday, January 23, 2010 17
  • 18. predicted position at A A’s predicted position at the server Player A Server time Saturday, January 23, 2010 18
  • 19. A’s version of the entity’s position is now too far away from the correct position. Server updates A with the new velocity and position. Player A Server time Saturday, January 23, 2010 19
  • 20. A converges the entity to the correct position smoothly. Player A Server time Saturday, January 23, 2010 20
  • 21. how to set error threshold? Saturday, January 23, 2010 21
  • 22. adapt based on game requirement (e.g. distance to other players) Saturday, January 23, 2010 22
  • 23. Space inconsistency: due to error threshold and convergence Time inconsistency: due to message delay and clock asynchrony Player A Server time Saturday, January 23, 2010 23
  • 24. What is the difference between the actual and predicted position ? How long does the difference last? Saturday, January 23, 2010 24
  • 25. error time inconsistency = Saturday, January 23, 2010 25
  • 26. what are the different components of distance error? Player A Server time Saturday, January 23, 2010 26
  • 28. higher CPU cost (needs to simulate other players) unfair (higher latency leads to larger error) Saturday, January 23, 2010 28
  • 30. Generalized Dead Reckoning : Prediction Contract Saturday, January 23, 2010 30
  • 31. “return to base” “drive along this road” Saturday, January 23, 2010 31
  • 32. Server and clients must have a common notion of “time” Saturday, January 23, 2010 32
  • 33. Two choices: Wall Clock Game Clock Saturday, January 23, 2010 33
  • 34. Wall Clock: clients and server have to synchronize their physical clocks using NTP or SNTP. Saturday, January 23, 2010 34
  • 35. now is 10:18:32 now is 10:18:29.5 now is 10:18:30 now is 10:18:33.5 Saturday, January 23, 2010 35
  • 36. now is 10:18:32 now is 10:18:29.5 now is 10:18:30 now is 10:18:33.5 Time now should be 10:18:30.5 RTT = 1s OWD = 0.5s Saturday, January 23, 2010 36
  • 37. Players try to sync the game states with the server at the same wallclock time, and predict ahead with an amount of time equal to one- way delay. Player A Server Player B Saturday, January 23, 2010 37
  • 38. or: synchronize states to game clock, which runs behind the server by an amount of time equals to the one-way delay. Player A Server Player B Saturday, January 23, 2010 38
  • 39. what A sees what B sees A S B 3 4 2 game clock Saturday, January 23, 2010 39
  • 40. Example: using game clock Saturday, January 23, 2010 40
  • 41. A decides to move. Send event to S. A S B 1 2 0 Saturday, January 23, 2010 41
  • 42. S receives event, moves A, and tells A and B that A is moving at t = 3 A S B A S B 1 2 0 2 3 1 Saturday, January 23, 2010 42
  • 43. A moves itself at t = 3. A S B A S B A S B 1 2 0 2 3 1 3 4 2 Saturday, January 23, 2010 43
  • 44. B moves A at t = 3. A S B A S B A S B A S B 1 2 0 2 3 1 3 4 2 4 5 3 Saturday, January 23, 2010 44
  • 45. Example: using wallclock Saturday, January 23, 2010 45
  • 46. A decides to move. Send event to S. A S B 0 0 0 Saturday, January 23, 2010 46
  • 47. S receives event, moves A, and tells A and B that A is moving at t = 1 A S B A S B 0 0 0 1 1 1 Saturday, January 23, 2010 47
  • 48. A moves itself to where it should be at t = 2. A S B A S B A S B 0 0 0 1 1 1 2 2 2 Saturday, January 23, 2010 48
  • 49. B finds out A moves at t = 1 and moves A to where A should be at t = 3 A S B A S B A S B A S B 0 0 0 1 1 1 2 2 2 3 3 3 Saturday, January 23, 2010 49
  • 50. Tight synchronization allows interaction but can lead to visual disruptions. Saturday, January 23, 2010 50
  • 51. Asynchronization allows smooth movement but hinder interaction. Saturday, January 23, 2010 51
  • 52. Local Perception Filter Saturday, January 23, 2010 52
  • 53. Hybrid Model: Render objects within real- time interaction range in real time, other objects in delayed time. Saturday, January 23, 2010 53
  • 54. Two Kinds of Entities Active: players (unpredictable) Passive: ball, bullet (predictable) Saturday, January 23, 2010 54
  • 55. happening now A happened B time t ago Saturday, January 23, 2010 55
  • 56. Question: What if a player A throws a ball at player B? Saturday, January 23, 2010 56
  • 57. happening now A happened B time t ago Saturday, January 23, 2010 57
  • 58. Question: What if a player B throws a ball at player A? Saturday, January 23, 2010 58
  • 59. happening now A happened B time t ago Saturday, January 23, 2010 59
  • 60. Distance of ball (thrown by A) from A versus time. distance now time t ago time t ago now time Saturday, January 23, 2010 60
  • 61. What A sees.. distance time t ago now time Saturday, January 23, 2010 61
  • 62. Distance of ball (thrown by B) from A versus time. distance time t ago now time t ago now time Saturday, January 23, 2010 62
  • 63. Distance of ball (thrown by B) from A versus time. distance time t ago now time Saturday, January 23, 2010 63
  • 64. A happened t ago happened t - 1 ago happened t - 2 ago B Saturday, January 23, 2010 64
  • 65. Question: What if a player A throws a ball at player B? Saturday, January 23, 2010 65
  • 66. What A sees.. distance time Saturday, January 23, 2010 66
  • 67. What A sees.. distance time Saturday, January 23, 2010 67
  • 68. Question: What if a player B throws a ball at player A? Saturday, January 23, 2010 68
  • 69. Distance of ball (thrown by B) from A versus time. distance time Saturday, January 23, 2010 69
  • 72. 3 slots ago 2 slots ago 1 slots ago now time Saturday, January 23, 2010 72