predictive movement in multiplayer games

Post on 27-May-2015

1.505 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Predictive Movement in Multiplayer Games

Jobe Makarjobe@electrotank.com

@jobemakar

http://www.electrotank.com/lab/FATC/Files.zip

THANK YOU FATC COMMUNITY!!!

Predictive Movement in Multiplayer Games

• Real-time movement• Multiplayer concepts• Smoothing / latency Hiding• Clock synchronization• Predictive movement• How this affects game design

…and what we won’t cover

Tank Game

Wireless network: Electrotank_demo

No password

http://192.168.1.106/

Tank Game

• Prediction and smoothing in this game• Tank movement• Shots• Collisions

• Things not predicted or smoothed• Powerup collecting• Exploding tank

Multiplayer Games and Socket Servers

• Multiplayer game refresher• Persistent connection• Rooms• Extensions

Real-time movement

• Avatar in a virtual world• Character in FPS• Vehicle in a driving game• Bullet

Making it multiplayer

• Here I am• Way points• Heading• Role of client vs server

Blob Bros

• Real-time coop game• Uses ‘Here I am’ technique

Elysium

• Virtual world• Uses way points

Smoothing & latency hiding

• Examples of why it is needed• Smoothing types

Smoothing & latency hiding

• Here I am example – no diagram

Smoothing & latency hiding

• Bullet example

Smoothing & latency hiding

• Car example

Smoothing & latency hiding

• Its all about good user experience• Smoothing types

• Easing – frame-based• Convergence – time-based

Synchronizing clocks

• Ping = round trip time• Latency = Ping / 2• Syncrhonizing clocks means finding the latency

Synchronizing clocks

• Take 5-10 data points• Throw out values > 1.5 the median value• Average what remains

Synchronizing clocks

• Clock class• _clock.time

Predictive movement

• Prediction is the easy part• Using heading• Scheduled events

Predictive movement

• Heading• Starting position• Starting velocity• Acceleration information

v = v0 + ½*a*t^2x = x0 + vx*ty = y0 + vy*t

Predictive movement

• Scheduled events• Door opening• Explosion due to grenade• Gun shot if there is lead up animation

Smoothing and latency hiding revisited

• Convergence – more on this in a moment• Lead up animation• Some combination• Sometimes nothing needed: customizing avatar

Smoothing and latency hiding revisited

• Convergence• Uses heading for prediction• Choose an algorithm for smoothing

Smoothing and latency hiding revisited

Smoothing and latency hiding revisited

• Converger class• Uses Heading class• Uses linear accel / decel algorithm for smoothing• Show example usage

Converger class limitations

• Acceleration locking• Rotation smoothing• Smoothing is linear

Game design knowing technical limitations

• Making a good game choice• Car – accel/decel• Make character-character interactions indirect

Questions

Jobe Makarjobe@electrotank.com

@jobemakar

top related