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
92
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
More Decks by Secret Lab
See All by Secret Lab
Yarn Spinner - Write the Docs Portland 2016 Lightning Talk
thesecretlab
0
130
How Do I Game Design?
thesecretlab
0
340
Swift Functional Programming
thesecretlab
0
3k
Open Data + Video Games = Win
thesecretlab
0
370
Watch This Face
thesecretlab
1
3.1k
The Mün and back - a Kerbal tale
thesecretlab
0
690
How Do I Game Design? (OSCON 2015)
thesecretlab
0
460
Cross-device, Cross-platform: Mobile Design Tutorial
thesecretlab
0
420
Building mobile apps for IoT Devices: a case study of our work with the Holiday by MooresCloud
thesecretlab
0
390
Other Decks in Programming
See All in Programming
Foundry Localでエージェント開発
seosoft
0
150
RSSとCodexを使ってX投稿自動化してみた
ochtum
0
110
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
130
一参加者から『中の人』へ 〜全通PHPerがブースに立って学んだ、カンファレンスを100倍楽しむコツ〜
wp_daisuke
0
120
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
2
2.5k
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
2
1.5k
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.5k
数年滞っていたダークモード対応をおよそ2週間で完了させる
chigichan24
0
690
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
160
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
0
250
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
150
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
460
Featured
See All Featured
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
690
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
From π to Pie charts
rasagy
0
360
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
430
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
270
Test your architecture with Archunit
thirion
2
2.4k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
How STYLIGHT went responsive
nonsquared
100
6.3k
Music & Morning Musume
bryan
47
7.4k
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