Complex Behaviour from Simple Rules: 3 Simulations
A small display of some of the surprisingly intricate patterns and behaviours that can arise from relatively simple rules. More information about each of the simulations below.
These simulations were made in Unity, and coded with C# and HLSL.
You can find the project files at the links below.
Reaction-Diffusion:
Cellular Automata:
Slime mould:
If you’d like to support my work, you can do so on Patreon:
---- 1. Reaction-Diffusion ----
This is a simulation of two chemicals (A and B). Both diffuse over time (A faster than B).
The simulation space is initially filled with A, and just a small region has some of chemical B. Over time, more A is gradually added (controlled by a parameter called feedRate), while B is gradually removed (controlled by the parameter removeRate). Finally, there’s a reaction that takes place: when one particle of chemical A is in the presence of two particles of chemical B, it will be converted into B.
One could simulate the individual particles of both chemicals, but more common (and the approach I went with as well) is to just store a value for the concentrations of both chemicals at each pixel. The probability of an A particle coming into contact with two B particles can be determined by the equation: probablityOfReaction = concentrationA * concentrationB * concentrationB. Here is the tutorial I followed when creating my implementation:
The colours in the simulation are mainly based on the concentrations of the two chemicals, but to spice things up I also added some colouring based on how fast the concentrations are changing at each point.
---- 2. Multiple Neighbourhood Cellular Automata ----
This is a technique developed by someone who goes by Slackermanz online (you can find many awesome examples under that name on Twitter).
In this simulation, the state of each pixel (called a cell) is initially randomized between 0 and 1. On every frame, the state of each cell is updated based on the states of all the cells inside various “neighbourhoods“ around it. These neighboughhoods are ring-shaped, with each ring defined by a min and max radius, along with two min/max values called ’alive’ and ’dead’. Once all the states inside a ring have been added up, the sum is compared to the ring’s alive and dead ranges, and depending on which range the sum falls into, the cell’s state increases or decreases by some small amount (if the sum is inside neither range, the state remains the same).
This already gives interesting results, but there are some more nuances that can be added. For example, instead of the rings directly affecting the cell’s state, they can contribute to several ’potential’ states, and whichever of these is most different from the cell’s current state becomes the new state.
My implementation is based on Slackermanz code, which you can find here:
Slackermanz also has a YouTube channel here:
---- 3. Slime Mould Simulation ----
In this simulation we have a lot lot of particles, each of which leaves a trail behind itself as it moves. These trails diffuse and evaporate over time. Each particle also has three circular sensors arranged in an arc in front it. These are used to detect the intensity of the trail, and the particle turns towards whichever detects the highest intensity. Some randomness is added to the turning as well.
The idea for this comes from this paper:
I also have a video exploring it in some more depth:
Music:
Beneath the Stars by Joshua Spacht
Nowhere I Can Go by The Stolen Orchestra
The Art of Loneliness by Anbr
Selfless by Eleven Tales
Life by Anbr
Chapters:
00:00 Reaction-Diffusion Simulation
02:50 Multi-Neighbourhood Cellular Automata
07:23 Slime Mould Simulation
2 views
25
4
2 months ago 01:02:21 1
The Illusion of ’Free Will’, The Psychology Behind Donald Trump, and The Science of Stress
2 months ago 00:13:36 42
Dragonflies: Anatomy of the World’s Top Predator - 3D Animation
3 months ago 00:01:50 9
Shared leadership in octopus-fish hunting groups
3 months ago 00:11:28 1
True Facts: Bees That Play With Balls And Do Math!
3 months ago 00:17:08 4
Ian Cheng Interview: A Portal to Infinity
4 months ago 00:06:34 1
The teenage brain - 6 Minute English
5 months ago 00:05:04 1
Sealion mounted camera shows predation, mother teaching pup!
5 months ago 00:00:57 1
60 Seconds With The Olive Baboon It’s Amazing And Intriguing Lifestyle #baboons #safarilife #africa
5 months ago 01:15:10 3
Amors e Cansò - Capella de Ministrers, Carles Magraner
5 months ago 00:52:52 1
ТЁМНЫЙ СЕКТОР: Пришельцы и Невидимые цивилизации. НЛО, Тёмная материя и Эфир (Все части) - ВЕРСАДОКО
6 months ago 00:06:39 1
Autonomous Driving through Extremely Dynamic-Complex Traffic-Dynamics in India
6 months ago 00:20:30 1
ТЁМНЫЙ СЕКТОР: Существует ли Эфир? Часть 3/3 - ВЕРСАДОКО
7 months ago 00:26:26 1
Why do we lie? - CrowdScience podcast, BBC World Service
7 months ago 00:44:13 1
Monkeying Around: The Macaques Of Huangshan | Go Wild
7 months ago 00:04:13 2
Unravelling the mysteries of clouds
7 months ago 00:23:19 22
How to Code Behaviour Trees in Unity C#
7 months ago 00:15:30 1
Carl Jung and The Collective Unconscious
8 months ago 00:27:06 1
Rosemary Kennedy - Lobotomised for Being Different | Documentary
8 months ago 00:00:57 1
MATT GOODWIN: The Hidden Alliance Threatening To Overthrow Western Civilisation
8 months ago 00:01:38 1
MAN HALTS CHARGING ELEPHANT
9 months ago 00:10:52 2
Complex Behaviour from Simple Rules: 3 Simulations
9 months ago 00:00:16 1
The hidden message behind Japanese bird’s flapping wings