Boss: Netcode
Quick check
What is jitter?
- How much the delay changes from packet to packet
- The delay itself
- Packets that never arrive
Show the answer
How much the delay changes from packet to packet
MDN calls jitter "packet delay variation". Latency is the delay, and loss is packets that never arrive.
Pick the channel
Over WebTransport, how should a game send player positions?
- As unreliable datagrams
- On a reliable, ordered stream
- By email
Show the answer
As unreliable datagrams
Each position supersedes the last, so a lost one should not hold up the next.
Quick check
Source's default interpolation period is 100 ms. Why that long?
- So that even if one snapshot is lost, two are left to draw between
- To save battery
- Because the server ticks every 100 ms
Show the answer
So that even if one snapshot is lost, two are left to draw between
Snapshots arrive every 50 ms. A 100 ms buffer survives one lost snapshot.
Quick check
Client prediction lets the app overrule the server.
- True
- False
Show the answer
False
The app guesses ahead, but the server's answer always wins.
Replay it
1server: x = 20, last #72in flight: #8 (+2), #9 (+2)
Where should the app draw the player?
- x = 24
- x = 20
- x = 22
Show the answer
x = 24
Start at the server's 20 and replay #8 and #9: 22, then 24.
Quick check
What does rollback netcode do when the other player's real input differs from its guess?
- Rewinds to that frame and runs again up to now
- Pauses the match
- Ignores the real input
Show the answer
Rewinds to that frame and runs again up to now
GGPO re-runs the game "from the point of divergence", within a single frame.
Quick check
In lockstep, what do machines send each other?
- Players' commands
- Every unit's position
- Screenshots
Show the answer
Players' commands
Every machine runs the same simulation, so commands are enough.
Do the sum
1K = 202@mossy expected: 0.243result: @mossy wins
How many points does @mossy gain?
- 15
- 5
- 20
Show the answer
15
20 times (1 minus 0.24) is 15.2, which rounds to 15.