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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Secret Lab
September 01, 2015
Programming
0
76
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
120
How Do I Game Design?
thesecretlab
0
310
Swift Functional Programming
thesecretlab
0
2.7k
Open Data + Video Games = Win
thesecretlab
0
350
Watch This Face
thesecretlab
1
2.7k
The Mün and back - a Kerbal tale
thesecretlab
0
640
How Do I Game Design? (OSCON 2015)
thesecretlab
0
430
Cross-device, Cross-platform: Mobile Design Tutorial
thesecretlab
0
390
Building mobile apps for IoT Devices: a case study of our work with the Holiday by MooresCloud
thesecretlab
0
360
Other Decks in Programming
See All in Programming
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
200
Head of Engineeringが現場で回した生産性向上施策 2025→2026
gessy0129
0
210
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
700
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
300
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
310
Rails Girls Tokyo 18th GMO Pepabo Sponsor Talk
yutokyokutyo
0
200
手戻りゼロ? Spec Driven Developmentとは@KAG AI week
tmhirai
1
170
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
650
Geminiの機能を調べ尽くしてみた
naruyoshimi
0
200
Python’s True Superpower
hynek
0
200
浮動小数の比較について
kishikawakatsumi
0
380
NOT A HOTEL - 建築や人と融合し、自由を創り出すソフトウェア
not_a_hokuts
2
580
Featured
See All Featured
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
68
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
960
A Soul's Torment
seathinner
5
2.4k
Claude Code のすすめ
schroneko
67
220k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
360
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
280
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
65
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Building the Perfect Custom Keyboard
takai
2
710
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
460
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
290
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
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