In this presentation, we'll explore the unique concerns of a system that supports dozens of concurrent players in real time. We'll use a mobile game written in JavaScript to test different implementation options and you'll leave ready to go home and design your own multiplayer experience.
35. @hunterloftis
Instead, create an illusion:
1. Input gives feedback immediately.
2. Players believe they are sharing an environment.
36. @hunterloftis
Instead, create an illusion:
1. Input gives feedback immediately.
2. Players believe they are sharing an environment.
3. Everyone eventually ends up in the same state.
64. @hunterloftis
Interpolation
• Stores the last two authoritative states in history.
• Animates from history[0] to history[1].
• Extrapolates if new data doesn't arrive on time.
81. @hunterloftis
A moment in time
Server
input 45input 46input 47
state (43)state (42)
state (41)
input 44
state (40)
82. @hunterloftis
Player B
Sees himself start moving up
immediately, then sees Player A
start moving up.
Player A
Sees herself start moving up
immediately, then sees Player B
start moving up.
Both players press UP at the same time.
83. @hunterloftis
Player B
Sees himself stop moving
immediately, then sees Player A
stop moving at the same height.
Player A
Sees herself stop moving
immediately, then sees Player B
stop moving at the same height.
Both players release UP at the same time.