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
91
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
330
Swift Functional Programming
thesecretlab
0
2.8k
Open Data + Video Games = Win
thesecretlab
0
370
Watch This Face
thesecretlab
1
2.9k
The Mün and back - a Kerbal tale
thesecretlab
0
670
How Do I Game Design? (OSCON 2015)
thesecretlab
0
450
Cross-device, Cross-platform: Mobile Design Tutorial
thesecretlab
0
410
Building mobile apps for IoT Devices: a case study of our work with the Holiday by MooresCloud
thesecretlab
0
380
Other Decks in Programming
See All in Programming
地域 SRE コミュニティ最前線 - ホンマでっかSRE勉強会
tk3fftk
0
260
AIエージェントで 変わるAndroid開発環境
takahirom
2
690
トークンをケチるな、設計しろ:GitHub Copilotを賢く使うコンテキスト戦略
ochtum
0
320
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
270
自作OSでスライド発表する
uyuki234
1
3.9k
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
500
ランチタイムLT会3周年!ランチタイムLT会を3年間続けられたお話
y0hgi
1
150
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
8
4.8k
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
380
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
200
act2-costs.pdf
sumedhbala
0
120
なぜ関数型プログラミングで「型」と「証明」が語られるのか #fp_matsuri
kajitack
3
990
Featured
See All Featured
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
590
Thoughts on Productivity
jonyablonski
76
5.3k
Faster Mobile Websites
deanohume
310
32k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
How to make the Groovebox
asonas
2
2.3k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
Practical Orchestrator
shlominoach
191
11k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.2k
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.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