Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Flocking Simulation with Phoenix Channels
Search
Christian Bäuerlein
April 19, 2018
Programming
1
390
Flocking Simulation with Phoenix Channels
Code can be found here:
https://github.com/fabrik42/flocking_elixir
Christian Bäuerlein
April 19, 2018
Tweet
Share
More Decks by Christian Bäuerlein
See All by Christian Bäuerlein
Single File Ruby Programs @ RubyUnconf 2023
fabrik42
0
160
Single File Ruby Programs 2.0
fabrik42
1
210
Single File Ruby Programs
fabrik42
0
290
Agile Software Development for Software Developers
fabrik42
0
53
Phoenix Live View
fabrik42
0
610
Rails API-only considerations
fabrik42
0
370
Org-Mode
fabrik42
0
540
Cleaner, scalable views with object oriented components
fabrik42
0
370
Headless Browser Experiments
fabrik42
0
400
Other Decks in Programming
See All in Programming
俺流レスポンシブコーディング 2025
tak_dcxi
14
8.6k
認証・認可の基本を学ぼう後編
kouyuume
0
180
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
700
sbt 2
xuwei_k
0
270
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
9
1.1k
React Native New Architecture 移行実践報告
taminif
1
150
生成AIを利用するだけでなく、投資できる組織へ
pospome
1
300
まだ間に合う!Claude Code元年をふりかえる
nogu66
5
770
CSC509 Lecture 14
javiergs
PRO
0
220
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
130
ViewファーストなRailsアプリ開発のたのしさ
sugiwe
0
440
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
140
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Automating Front-end Workflow
addyosmani
1371
200k
KATA
mclloyd
PRO
32
15k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.3k
GitHub's CSS Performance
jonrohan
1032
470k
Navigating Team Friction
lara
191
16k
Why Our Code Smells
bkeepers
PRO
340
57k
How to train your dragon (web standard)
notwaldorf
97
6.4k
4 Signs Your Business is Dying
shpigford
186
22k
Practical Orchestrator
shlominoach
190
11k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
70k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Transcript
Flocking Simulation with Phoenix Channels
Flocking Theory
None
Use case: Cinematic effects
Boid: One member of a flock
* Location
* Location * Perception Radius
* Location * Perception Radius * Velocity * Heading
You Need Three Behaviours
1. Cohesion
1. Cohesion
1. Cohesion
2. Alignment
2. Alignment
2. Alignment
3. Separation
3. Separation
3. Separation ! !
3. Separation ! !
* Cohesion * Alignment * Separation = Next move
Architecture
Phoenix BoidsChannel Receives Updates Changes Settings GenServer WorldStateUpdater Calling itself
30 times per second Simulation Calculates new positions per boid based on world state <canvas> Renderer Renders updated world state Socket Connection Receives Updates Changes Settings
Demo Time!
Read on! http://harry.me/blog/2011/02/17/neat-algorithms-flocking/ http://www.red3d.com/cwr/boids/