Watch a flock of up to 400 small shapes follow three simple rules, change how strongly each rule counts, add chasers, and pull the flock around with a press.
Shapes 150
Flock order 0.00
Kinds of flock
Chasers
Press on the garden to
Press and hold on the garden with a mouse, finger or pen to pull the flock towards that spot (or push it away, if you chose Push away). Release to let go. With the keyboard, Tab to the garden, move the cursor with the arrow keys (Shift moves further) and press Space to start or stop pulling at the cursor. On the garden: P plays or pauses, N steps ahead while paused, R scatters the flock, 1 to 4 pick a kind of flock, C changes the chasers, V switches between pull and push and T turns trails on or off. If your device asks for reduced motion, the garden starts paused and trails are off.
As-is, no warranty. These apps are free under their listed license and run entirely in your browser. Use at your own risk — don't blame me if your PC catches fire, your dog runs away, or the math turns out wrong. Verify anything that actually matters. None of this is professional financial, medical, legal, or engineering advice.
A calm flock of 150 small arrow shapes is already moving when the page opens. Each shape is coloured by the way it is heading, so a stream of shapes going one way shares a colour. There is nothing to win. Change the settings and watch what the flock does.
Above the garden, Flock order is a number from 0 to 1 with a word beside it: scattered, loosely together, mostly together or moving together. It measures how well the shapes agree on a direction.
Try these. With only alignment up, the headings agree but the shapes drift through each other. With only cohesion up, they gather into tight, swirling clumps. With only separation up, a crowd spreads out evenly.
Press Tab until the garden is selected. A dashed ring marks the cursor. The arrow keys move it (Shift moves further) and Space starts pulling (or pushing) at the cursor, and Space again stops. While the garden has the keyboard, P plays or pauses, N steps ahead while paused, R scatters, 1 to 4 pick a kind of flock, C changes the number of chasers, V switches between pull and push and T turns trails on or off. The sliders and buttons work with the usual Tab and arrow keys, and each change is announced in the status line.
Your device may ask for reduced motion. If it does, the garden starts paused with trails off, and moves only when you press Play or Step. The simulation also pauses when the tab is hidden or the garden is scrolled out of sight. Only the garden itself stops the page scrolling under your finger. A second finger on it is ignored. If the system cancels a touch, the pull stops. If a device cannot keep up, the page lowers the number of shapes by a quarter and says so in the status line; the slider can raise it again.
The world is a rectangle 160 units wide and 100 high that wraps round: a shape that leaves one edge comes back on the opposite one, and every distance is measured the short way round. Each shape sees neighbours within 14 units. Once per step, for each shape:
The three pushes are multiplied by their slider values and added, together with any chaser and pull. The total is limited to a force of 100, applied to the velocity over 1/60 of a second, and the speed is then held between 12 and 30. Every shape’s new velocity comes from the old state of all the others, and then they all move at once, so the order they are stored in makes no difference.
Finding neighbours quickly. Checking every pair would take 160,000 comparisons for 400 shapes. The world is cut into 11 by 7 cells, each at least 14 units across, so a shape only needs to look in its own cell and the eight around it, wrapping at the edges. The tests build swarms of 400, put some right on the corners and edges, and check that for every shape the grid finds exactly the same neighbours as a scan of every pair using a brute-force distance over the nine copies of the world.
Checking the rules. The tests contain a second implementation of the three rules, the chasers and the pull, written as the plainest possible double loop. It is run next to the real engine for one to three steps, and every position and velocity must agree to eight decimal places. They also run 5,000 steps with every slider at 3, three chasers and a pull that switches on and off, and check each shape’s speed stays between 12 and 30, stays inside the world, and is never not-a-number. Each rule is tested alone: with all three off, every shape flies in a straight line at constant speed; with alignment alone, the order measure rises from under 0.3 to over 0.85; with cohesion alone, shapes end closer to their nearest neighbour and have more than one and a half times as many neighbours in sight; with separation alone, a squeezed crowd ends up spread more than a quarter wider.
| Setting | Value |
|---|---|
| Shapes | 20 to 400, 150 at the start |
| Sight / too close | 14 units / 5 units |
| Speed | 12 to 30 units a second |
| Steps | 60 a second, fixed |
| Chasers | 0 to 3, speed 18, they scare shapes within 24 units |
| Press radius | 50 units |
Nothing is uploaded, stored or downloaded. Copy in the toolbar copies a one-line description of your settings and the flock order.
Free to play, no ads, nothing uploaded. These games are original and are not affiliated with any other game or brand.