networked graphics building networked virtual environments and networked games chapter 11: latency...

44
Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

Upload: joel-fisher

Post on 18-Jan-2018

233 views

Category:

Documents


0 download

DESCRIPTION

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

TRANSCRIPT

Page 1: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

Networked GraphicsBuilding Networked Virtual Environments and Networked GamesChapter 11: Latency and Consistency

Page 2: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

LATENCY IMPACT

Page 3: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

ClientA ClientB

CarA A=1, V=0

CarB

A=1, V=0

CarA A=1, V=1

CarA A=1, V=2

CarA A=1, V=3

CarB

A=1, V=1

CarB

A=1, V=2

CarB

A=1, V=3

CarA CarB CarA CarB

Page 4: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

Can’t apply open state

Door is Open & Locked

ClientA ClientB

Lock Door OpenDoor

Door is Closed & Unlocked

Door is Closed & Locked

Door is Closed & Unlocked

Door is Open & Unlocked

Page 5: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

ClientA ClientBServer

Shooter (PlayerA)

Target (PlayerB)

Page 6: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

ClientA ClientBServer

Shooter (PlayerA)

Target (PlayerB)

Page 7: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

DUMB CLIENT AND LOCKSTEP SYNCHRONISATION

Page 8: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

Quake ClientA

ReadInput

Rendering

Quake Server

ReceiveInput

Simulate

Quake ClientB

ReadInput

Rendering

MouseKeyboard

DrawLists, Game State

MouseKeyboard

DrawLists, Game State

Page 9: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

CONSERVATIVE SIMULATIONS

Page 10: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

Doom ClientA

ReadInput

Rendering

ReceiveInput

SimulateDoom ClientB

ReadInput

Rendering

Receive

Input

Simulate

Doom ClientC

ReadInput

Rendering

ReceiveInput

Simulate

Page 11: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

ClientA

MessageI

Client=B Time=11.1

MessageI+1

Client=C Time=13.5

MessageI+2

Client=B Time=13.6

MessageI+3

Client=C Time=18.0

MessageI+4

Client=D Time=18.2

ClientB

ClientC

ClientD

Message Queue

Page 12: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

TIME

Page 13: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

EventExplode is delay at ClientC until after EventFire

ClientA

ClientB

ClientC

EventFire

EventExplode

Page 14: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

ClientA

ClientB

ClientC

EventFire (0,1,0)

EventExplode (1,1,0)

EventFire (2,1,1)

EventExplode (2,1,0)

Page 15: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

OPTIMISTIC ALGORITHMS

Page 16: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

ClientA ClientB

Lock Door

OpenDoor

ClientC

AddZombies

RemoveZombies

CloseDoor

t0

t1

t2

t3

t4

Page 17: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

CLIENT PREDICT AHEAD

Page 18: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

ClientA Server

P0 P1

MoveP0 to P1

Move?P1 to P2

Move?P2 to P3

Move?P3 to P4

Move?P0 to P1

MoveP1 to P2

MoveP2 to P3

P2P1

P3P2

P4P3

P0 P1

P2P1

P3P2

Page 19: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

ClientA Server

P0 P1

MoveP0 to P1

Move?P1 to P2

Move?P2 to P3

Move?P0 to P1

FailMoveP1 to Q1

FailMoveP1 to Q1

P2P1

P3P2

Q1

P0 P1

Q1P1

P3P2Q1

Page 20: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency
Page 21: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

EXTRAPOLATION ALGORITHMS

Page 22: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

1st Order Model

Page 23: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

2nd Order Model

Page 24: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

a) Player model sending three

updates

b) Ghost model path without

blending

to

t1

t2

c) Old ghost model and new ghost

model at t1

Page 25: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

d) Blending between the old ghost and new ghost

over several frames

e) Ghost model path with blending

Page 26: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

a) Old ghost position at t0, new ghost position at t0 and

new ghost position at t0+t

t0

New ghost t0+t

New ghost t0

Old ghost t0

b) Dotted line shows the planned path toreach the target position and direction

Page 27: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

a) Player model showing the timings of dead-reckoning updates at the peaks of a periodic motion

Update at t0

Update at t1

Page 28: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

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 pathGhost model location at

t0

Player model update at t0

Extrapolation of player model

Page 29: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

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

Page 30: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

to

t1

Player model update at t1

a) Player model showing the object avoiding the

wall

Path of ghost model after update at t0

b) After the update at t1 the ghost model cannot

converge

Page 31: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

2nd Order Model with Error Threshold

Page 32: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

INTERPOLATION, PLAYOUT DELAYS AND LOCAL LAG

Page 33: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

Sender Receiver

P1

P2

P3

P4

t1

t2

t3

t4

Page 34: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

P0 P1 P2 P3

t0 t1 t2 t3

Interpolate P0→P1

Playout delay

Page 35: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

Sender Receiver

P1

P2

P3

P4

t1

t2

t3

t4

t5

t6

Page 36: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

t0 t1 t2 t3

Interpolate P0→P1

Maximum latency

P0 P1 P2 P3

Playout delay

Sender

ClientA

ClientB

Page 37: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

t0 t1 t2 t3

Interval (Tα)

EA1

Playout delay (T)

ClientA

ClientB

ClientC

EC1 EC2

EB1 EB2

t4

Page 38: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

PERCEPTION FILTERS

Page 39: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

ClientAClientB

Page 40: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

x position1.0

Tnetwork

Adde

d de

lay

Page 41: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

Time

1.0

x po

sition

1.0 2.0

3.0 4.0

Page 42: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

Time

1.0

x po

sition

1.0 2.0 3.0 4.0

a) Both clients’ view of the ball x position using temporal corrections

x position of ball as seen from ClientA

x position of ball as seen from ClientB

Page 43: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

Time

1.0

x po

sition

1.0 2.0 3.0 4.0

b) Both clients’ view of the ball x position without using temporal corrections

x position of ball as seen from ClientB

x position of ball as seen from ClientA

Page 44: Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency

REVEALING LATENCY