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
54
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
100
How Do I Game Design?
thesecretlab
0
280
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
360
Building mobile apps for IoT Devices: a case study of our work with the Holiday by MooresCloud
thesecretlab
0
320
Other Decks in Programming
See All in Programming
Porting a visionOS App to Android XR
akkeylab
0
640
PicoRuby on Rails
makicamel
2
140
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
280
AIと”コードの評価関数”を共有する / Share the "code evaluation function" with AI
euglena1215
1
170
Goで作る、開発・CI環境
sin392
0
240
ふつうの技術スタックでアート作品を作ってみる
akira888
1
1.1k
設計やレビューに悩んでいるPHPerに贈る、クリーンなオブジェクト設計の指針たち
panda_program
6
2.3k
PostgreSQLのRow Level SecurityをPHPのORMで扱う Eloquent vs Doctrine #phpcon #track2
77web
2
550
The Niche of CDK Grant オブジェクトって何者?/the-niche-of-cdk-what-isgrant-object
hassaku63
1
410
PHP 8.4の新機能「プロパティフック」から学ぶオブジェクト指向設計とリスコフの置換原則
kentaroutakeda
2
990
20250704_教育事業におけるアジャイルなデータ基盤構築
hanon52_
5
880
Quand Symfony, ApiPlatform, OpenAI et LangChain s'allient pour exploiter vos PDF : de la théorie à la production…
ahmedbhs123
0
210
Featured
See All Featured
A designer walks into a library…
pauljervisheath
207
24k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
GraphQLとの向き合い方2022年版
quramy
49
14k
Code Review Best Practice
trishagee
69
19k
Docker and Python
trallard
44
3.5k
Optimizing for Happiness
mojombo
379
70k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
Typedesign – Prime Four
hannesfritz
42
2.7k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Facilitating Awesome Meetings
lara
54
6.4k
Git: the NoSQL Database
bkeepers
PRO
430
65k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
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