r/Simulated • • Sep 01 '26

Proprietary Software [OC] 137,500 starlings, each one steering only by its neighbours.

This runs live on an Apple silicon GPU.

Every bird reacts only to the ones near it. Nothing choreographs the shape and nothing is keyframed, so what you are watching falls out of 137,500 of them following local rules at once.

It is a GPU flock on an atomic spatial hash, which keeps neighbour lookups linear instead of quadratic at that count. Each bird steers on a bounded turn rate and banks into its turns, and the banking is what makes the flock flicker as they roll.

Based this on starling literature rather than plain boids, mostly Cavagna's work on scale-free correlations in real flocks and Couzin on spatial sorting. Cool thins is that the same system with one flag flipped runs a bait ball instead: change the attractor from polarised streaming to milling and the sheet becomes a rotating sphere.

Built in Swift and Metal as part of TideGlass, a small Mac app I make where worlds like this run on a second monitor while you work. Happy to answer anything about the sim.

394 Upvotes

23 comments sorted by

82

u/TedMauler Sep 01 '26

> That one starling isn't flying
> Looks inside
> Mouse cursor on screen

16

u/PiXeL161616 Sep 01 '26

Hehe, sorry about the cursor ruining the moment :)

8

u/TedMauler Sep 01 '26

Hey it's a beautiful sim, great job!

12

u/q120 Blender Sep 01 '26

Quite a murmuration you've simuated there

10

u/grahamw01 Sep 01 '26

This is really cool. I'd love to make it some kind of mechanical wall art but I guess that would be hyper expensive.

5

u/PiXeL161616 Sep 01 '26

Could be cool to do something with some sort of dot matrix display. Will probably need something better than a rasberrypi to drive it though. But cool idea. I build this for Tideglass, that the idea is to have it running on the side monitor next to you, so a bit similar to the "art" idea, mostly to help me focus while I work.

3

u/TheChariot77 Sep 02 '26

Running a low-pixel version of this simulation on a custom flip disc display would be pretty rad.

https://flipdisc.io

6

u/Old-Independence4699 Sep 01 '26

they are messengers of chaos.

4

u/OmniSystemsPub Sep 01 '26

Very cool indeed. Makes me wonder what a real-world flock size typically is?

3

u/PiXeL161616 Sep 01 '26

The papers I built this from tracked much smaller ones. Cavagna's group reconstructed every bird in 3D for flocks of 176 and 400. Tracking individuals is the hard part, so the measured ones stay small. I went to 137,500 because the GPU doesn't care, not because that's a typical flock.

3

u/OmniSystemsPub Sep 01 '26

Do similar patterns occur with 400 or so birds?

3

u/PiXeL161616 Sep 01 '26

You probably need a bit more than that for a cool one, this has to be like 10000 https://www.reddit.com/r/Damnthatsinteresting/comments/1mpde96/a_murmuration_of_starlings_huge/

3

u/PiXeL161616 Sep 02 '26

Yeah. That 2014 paper tracked a flock of 400 and clocked a turn sweeping right through it in a bit over half a second, so the collective behaviour is absolutely there at that size. What you lose at 400 is the density, not the reorganising.

4

u/Yama951 Sep 02 '26

Reminds me of the alien language in Arrival when they form a circle near the beginning

3

u/PiXeL161616 Sep 02 '26

Great idea, I'll see how far I can get to build the simulation and add it into the app

5

u/Elieftibiowai Sep 02 '26

I looked at for some time thinking it's real before I saw the sub

2

u/polygon_tacos Sep 01 '26

Craig Reynolds approves

2

u/Jens_Fischer Sep 02 '26

So we found Carcosa?

2

u/Capital-Check-9283 Sep 02 '26

itachi is amongst us

1

u/Brie9981 Sep 01 '26 edited Sep 02 '26

I could see this leading to tales of dragons