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
50
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
230
Swift Functional Programming
thesecretlab
0
2.4k
Open Data + Video Games = Win
thesecretlab
0
300
Watch This Face
thesecretlab
1
2.5k
The Mün and back - a Kerbal tale
thesecretlab
0
450
How Do I Game Design? (OSCON 2015)
thesecretlab
0
370
Cross-device, Cross-platform: Mobile Design Tutorial
thesecretlab
0
340
Building mobile apps for IoT Devices: a case study of our work with the Holiday by MooresCloud
thesecretlab
0
290
Other Decks in Programming
See All in Programming
Beyond ORM
77web
11
1.6k
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
1k
技術的負債と向き合うカイゼン活動を1年続けて分かった "持続可能" なプロダクト開発
yuichiro_serita
0
300
AppRouterを用いた大規模サービス開発におけるディレクトリ構成の変遷と問題点
eiganken
1
450
“あなた” の開発を支援する AI エージェント Bedrock Engineer / introducing-bedrock-engineer
gawa
4
220
Внедряем бюджетирование, или Как сделать хорошо?
lamodatech
0
940
QA環境で誰でも自由自在に現在時刻を操って検証できるようにした話
kalibora
1
140
オニオンアーキテクチャを使って、 Unityと.NETでコードを共有する
soi013
0
370
令和7年版 あなたが使ってよいフロントエンド機能とは
mugi_uno
10
5.2k
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
190
サーバーゆる勉強会 DBMS の仕組み編
kj455
1
300
知られざるDMMデータエンジニアの生態 〜かつてツチノコと呼ばれし者〜
takaha4k
1
450
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Practical Orchestrator
shlominoach
186
10k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.5k
Building an army of robots
kneath
302
45k
Building Adaptive Systems
keathley
38
2.4k
Music & Morning Musume
bryan
46
6.3k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
173
51k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
jQuery: Nuts, Bolts and Bling
dougneiner
62
7.6k
Unsuck your backbone
ammeep
669
57k
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