Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
FSCKING LAG
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Secret Lab
September 01, 2015
Programming
100
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
Transcript
44 slides
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
More Decks by Secret Lab
See All by Secret Lab
Yarn Spinner - Write the Docs Portland 2016 Lightning Talk
thesecretlab
0
140
How Do I Game Design?
thesecretlab
0
350
Swift Functional Programming
thesecretlab
0
3.1k
Open Data + Video Games = Win
thesecretlab
0
390
Watch This Face
thesecretlab
1
3.3k
The Mün and back - a Kerbal tale
thesecretlab
0
710
How Do I Game Design? (OSCON 2015)
thesecretlab
0
470
Cross-device, Cross-platform: Mobile Design Tutorial
thesecretlab
0
430
Building mobile apps for IoT Devices: a case study of our work with the Holiday by MooresCloud
thesecretlab
0
400
Other Decks in Programming
See All in Programming
はじめてのPLATEAU
nokonoko1203
1
660
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
310
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
780
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
180
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
740
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
220
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
360
Vue.jsで作る空間解析アプリとCapacitorプラグインのData Bridge
hal_spidernight
1
180
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
200
複数ドメインを一つのアプリに統合するFlutterの設計と運用_FlutterKaigi2026登壇資料(須永高弘)
takahirosunaga
0
200
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
690
あなたはMCPの機能を、まだ知らない。
4geru
1
680
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
56
10k
First, design no harm
axbom
PRO
2
1.4k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
600
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
610
Building Adaptive Systems
keathley
44
3.3k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
380
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
670
BBQ
matthewcrist
90
10k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
640
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
70
69k
Typedesign – Prime Four
hannesfritz
42
3.2k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
1
310