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
Flocking Simulation with Phoenix Channels
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Christian Bäuerlein
April 19, 2018
Programming
420
1
Share
Flocking Simulation with Phoenix Channels
Code can be found here:
https://github.com/fabrik42/flocking_elixir
Christian Bäuerlein
April 19, 2018
More Decks by Christian Bäuerlein
See All by Christian Bäuerlein
Single File Ruby Programs @ RubyUnconf 2023
fabrik42
0
180
Single File Ruby Programs 2.0
fabrik42
1
220
Single File Ruby Programs
fabrik42
0
310
Agile Software Development for Software Developers
fabrik42
0
63
Phoenix Live View
fabrik42
0
640
Rails API-only considerations
fabrik42
0
390
Org-Mode
fabrik42
0
570
Cleaner, scalable views with object oriented components
fabrik42
0
380
Headless Browser Experiments
fabrik42
0
430
Other Decks in Programming
See All in Programming
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
4
1.2k
LLM Plugin for Node-REDの利用方法と開発について
404background
0
150
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
2
810
今さら聞けないCancellationToken
htkym
0
210
net-httpのHTTP/2対応について
naruse
0
390
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
2.4k
Claspは野良GASの夢をみるか
takter00
0
150
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
130
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
280
TSKaigi 2026 TypeScriptバックエンドのオブザーバビリティ戦略 — Datadog × NestJSの実践
taiseiyamamotoan
1
210
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
290
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
1.9k
Featured
See All Featured
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
560
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
350
The Cost Of JavaScript in 2023
addyosmani
55
10k
How to build a perfect <img>
jonoalderson
1
5.5k
The Cult of Friendly URLs
andyhume
79
6.9k
It's Worth the Effort
3n
188
29k
Site-Speed That Sticks
csswizardry
13
1.2k
Paper Plane (Part 1)
katiecoart
PRO
0
8.1k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
290
Practical Orchestrator
shlominoach
191
11k
Git: the NoSQL Database
bkeepers
PRO
432
67k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
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/