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
0
56
FSCKING LAG
A lightning talk on multiplayer networking that we gave at /dev/world/2015.
Secret Lab
September 01, 2015
Tweet
Share
More Decks by Secret Lab
See All by Secret Lab
Yarn Spinner - Write the Docs Portland 2016 Lightning Talk
thesecretlab
0
110
How Do I Game Design?
thesecretlab
0
290
Swift Functional Programming
thesecretlab
0
2.5k
Open Data + Video Games = Win
thesecretlab
0
320
Watch This Face
thesecretlab
1
2.6k
The Mün and back - a Kerbal tale
thesecretlab
0
570
How Do I Game Design? (OSCON 2015)
thesecretlab
0
400
Cross-device, Cross-platform: Mobile Design Tutorial
thesecretlab
0
370
Building mobile apps for IoT Devices: a case study of our work with the Holiday by MooresCloud
thesecretlab
0
330
Other Decks in Programming
See All in Programming
Claude Code と OpenAI o3 で メタデータ情報を作る
laket
0
110
Gemini CLIの"強み"を知る! Gemini CLIとClaude Codeを比較してみた!
kotahisafuru
3
970
オホーツクでコミュニティを立ち上げた理由―地方出身プログラマの挑戦 / TechRAMEN 2025 Conference
lemonade_37
2
460
なぜ今、Terraformの本を書いたのか? - 著者陣に聞く!『Terraformではじめる実践IaC』登壇資料
fufuhu
4
560
新しいモバイルアプリ勉強会(仮)について
uetyo
1
250
バイブコーディング × 設計思考
nogu66
0
100
あのころの iPod を どうにか再生させたい
orumin
2
2.4k
Webinar: AI-Powered Development: Transformiere deinen Workflow mit Coding Tools und MCP Servern
danielsogl
0
110
マイコンでもRustのtestがしたい その2/KernelVM Tokyo 18
tnishinaga
2
1.9k
decksh - a little language for decks
ajstarks
4
21k
あなたとJIT, 今すぐアセンブ ル
sisshiki1969
1
580
iOS開発スターターキットの作り方
akidon0000
0
240
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.4k
Raft: Consensus for Rubyists
vanstee
140
7.1k
Balancing Empowerment & Direction
lara
1
540
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
283
13k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Automating Front-end Workflow
addyosmani
1370
200k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
The Straight Up "How To Draw Better" Workshop
denniskardys
235
140k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
880
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
47
9.6k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
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