tap anywhere
Two ideas run this whole thing: how the fireflies move, and how they learn to blink together. Both are well studied, and both have simple cores. Here is what is going on.
Each firefly steers itself instead of following a set path. The base of its movement is a wander: it holds a heading that drifts a little at every step, with the occasional sharp turn, so the flight looks like searching rather than gliding. Its speed rises and falls on its own, and now and then it slows almost to a stop and hovers in place.
Layered on top is a light sense of company. A firefly pushes away from whichever neighbours get too close, turns a touch toward the average direction of the ones near it, and drifts gently toward their center. Keeping apart is the strongest of the three pulls, so they stay loose and never collapse into a tight ball. They also tend to keep low, near the plants, rather than climb into open sky.
This way of building motion out of a few simple urges is called steering behaviours, introduced by Craig Reynolds with his Boids model. The same small set of forces, mixed in different proportions, can give you a flock of birds, a school of fish, or one insect feeling its way through the night.
Some species of firefly blink in unison. On a good night a whole riverbank of them can pulse as one, with no leader and nothing telling them when to fire. The surprising part is that this needs no central clock. It falls out of each firefly reacting only to the ones it can see.
Every firefly here carries an internal clock, a value that climbs steadily, triggers a flash when it reaches the top, then resets. Whenever it sees a neighbour flash, it bumps its own clock a little further along. A firefly that was already near the top gets pushed over and fires as well, so flashes ripple through the crowd and gradually fall into step. This is the pulse-coupled oscillator model of Mirollo and Strogatz, who showed that such oscillators almost always end up synchronised.
There is a slower second layer. On top of reacting to single flashes, each firefly eases the length of its own cycle toward the average of those around it, so the group agrees not only on when to flash but on how fast to repeat. The idea that a population of oscillators can settle on a shared frequency this way goes back to Yoshiki Kuramoto.
Two touches keep it from feeling mechanical. The pull between fireflies is local and weakens with distance, so order spreads outward in waves instead of switching on everywhere at once. And right after it fires, a firefly briefly stops listening, the way a nerve cell needs a short rest before it can fire again.
Perfect agreement would look like a machine, so the fireflies are allowed to slip. Once in a while one drops a beat and stays dark, or holds its light a little too long and falls behind, tugging on the timing of its neighbours before the group pulls it back. So the swarm keeps drifting into sync and out of it again, never quite locking solid. If you want the wider story, Steven Strogatz's talk on the science of sync is a good place to start.
The grass and ferns are not pictures. Each plant is grown in place from a tiny rulebook: start a stem, split it into thinner stems and leaves, then run the same step again on each new piece. A rule that keeps calling itself is enough to produce fronds, weeds, and broad leaves that all look related yet none the same.
These are L-systems, named after the biologist Aristid Lindenmayer, who used them to describe how plants and simple organisms grow. Each plant is regrown from the same seed on every frame, so its shape never changes and only the wind moves it. The sway adds up along the length of each stem, which is why the tips lean the most while the base barely stirs.
The picture is drawn small and then blown up without smoothing, which is where the crisp blocky pixels come from. Light is added rather than painted over: each lantern brightens whatever sits behind it, so a flash blooms and spills softly onto the leaves nearby instead of covering them. Every flash also has a quick rise, a brief hold, and a slow fade, closer to a real lantern warming and cooling than a plain switch.
for Paola thank you