Boss: Netcode

Play this quiz

Quick check

What is jitter?

  1. How much the delay changes from packet to packet
  2. The delay itself
  3. 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?

  1. As unreliable datagrams
  2. On a reliable, ordered stream
  3. 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?

  1. So that even if one snapshot is lost, two are left to draw between
  2. To save battery
  3. 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.

Show the answer

False

The app guesses ahead, but the server's answer always wins.

Replay it

reply
server: x = 20, last #7in flight: #8 (+2), #9 (+2)

Where should the app draw the player?

  1. x = 24
  2. x = 20
  3. 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?

  1. Rewinds to that frame and runs again up to now
  2. Pauses the match
  3. 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?

  1. Players' commands
  2. Every unit's position
  3. Screenshots
Show the answer

Players' commands

Every machine runs the same simulation, so commands are enough.

Do the sum

race
K = 20@mossy expected: 0.24result: @mossy wins

How many points does @mossy gain?

  1. 15
  2. 5
  3. 20
Show the answer

15

20 times (1 minus 0.24) is 15.2, which rounds to 15.