Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
FSCKING LAG
Search
Secret Lab
September 01, 2015
Programming
91
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
FSCKING LAG
A lightning talk on multiplayer networking that we gave at /dev/world/2015.
Secret Lab
September 01, 2015
More Decks by Secret Lab
See All by Secret Lab
Yarn Spinner - Write the Docs Portland 2016 Lightning Talk
thesecretlab
0
130
How Do I Game Design?
thesecretlab
0
340
Swift Functional Programming
thesecretlab
0
3k
Open Data + Video Games = Win
thesecretlab
0
370
Watch This Face
thesecretlab
1
3k
The Mün and back - a Kerbal tale
thesecretlab
0
690
How Do I Game Design? (OSCON 2015)
thesecretlab
0
460
Cross-device, Cross-platform: Mobile Design Tutorial
thesecretlab
0
420
Building mobile apps for IoT Devices: a case study of our work with the Holiday by MooresCloud
thesecretlab
0
390
Other Decks in Programming
See All in Programming
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
3
460
T3DD26: From RAGs to Riches
martinhelmich
0
130
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
800
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
450
源内ハンズオン概要編
hideg
0
240
Cloudflare is Agents
chimame
0
190
高専キャリア LT 発表内容
crysta1221
6
5.4k
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
120
信頼性の目標を誰も求めてない
shubox
0
470
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.2k
Loosening the Reins: Go Generics Get More Flexible
kuro_kurorrr
0
360
Go 1.27からのGODEBUG / Go 1.27 リリースパーティ #go127party
mazrean
0
280
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
220
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
230
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
550
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
260
Docker and Python
trallard
47
4.2k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
500
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
290
エンジニアに許された特別な時間の終わり
watany
108
250k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
260
Transcript
None
FSCKING LAG
Video Games!
Multi-player video games!
Server
Server Client Client Client
Server Client Client Client
Server Client
Server Client “I just killed player 1”
Server Client “I just killed player 1” “ok”
Server Client “I just killed player 1” “ok” BAD
Server Client “I pressed these buttons” “This is where things
are”
Server Client “I pressed these buttons” “This is where things
are” BETTER
PROBLEM
1 2 Lag = 1 second Lag = 0.1 seconds
1 2 Shoots! Runs! FROM PLAYER 1’S PERSPECTIVE:
Server Player 1 Player 2
Server Player 1 Player 2 “I’m shooting!” (1 second ago)
Server Player 1 Player 2 “I’m shooting!” (1 second ago)
“I’m running around the corner!” (0.1 second ago)
Server Player 1 has shot, and Player 2 is around
the corner. Player 1’s shot missed.
Server Player 1 Player 2 “Player 2 is now around
the corner. Player 1 shot, but missed.”
Counter-Strike
Server Player 1 shot, and at the time, they were
aiming at Player 2. Their should would have hit.
Server Player 1 Player 2 “Player 1 shot Player 2.”
Server Player 1 Player 2 “Player 1 shot Player 2.”
“Oh, and Player 2 still ran around the corner. lol.”
Server Player 1 Player 2 “Player 1 shot Player 2.”
“Oh, and Player 2 still ran around the corner. lol.” wtf
Age of Empires
1500 Archers on a 28.8: Network Programming in Age of
Empires and Beyond Mark Terrano, Paul Bettner
PROBLEM: 1500 archers Each one has a position Each one
is moving
Each position is about 4 bytes each
4 bytes ✕ 1500 = 6000 bytes
6000 bytes ✕ 30 frames/sec = 175 kB/s
SOLUTION:
DON’T SYNC STATE
SYNC PLAYER INTENT
Client Client Client
Client Client Client “I told my archers to move.”
Client Client Client “I told my archers to move.” “I
told a villager to gather wood.”
Client Client Client Wait for everyone to finish this frame….
Client Client Client Archers are moving, and the villager is
gathering wood.
NOT PERFECT
RUNS AT THE SLOWEST PLAYER
DESYNCS
@thesecretlab rocketboxgame.tumblr.com