Complex Behaviour from Simple Rules: 3 Simulations

preview_player
Показать описание
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.

---- 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.

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.

---- 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.

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
Рекомендации по теме
Комментарии
Автор

I'm just glad you exist. This is nice.

simivb
Автор

Hey everyone, I know this one's a bit light on explanation -- I've just been having a lot of fun messing around with various simulations and wanted to share some of the results. Might do a more in-depth video on these techniques at one point if there is interest (for now though, the description has more detail and some links if you're curious). Hope you enjoy the video!

SebastianLague
Автор

This is incredible how these simple rules make so organic-looking shapes, if someone would say that this is a new video from microscope I would fall for that

capsey_
Автор

Suddenly these particle systems start questioning their existance and whether they're alone in the unityverse.

alexanderlinderson
Автор

Holy moly and the music gives exactly the right atmosphere back. You truly feel like you are gazing at something special.

anonymouscommentator
Автор

Me: Barely gets a finite state machine to decide between eating and fleeing from enemies
Sebastian Lague: Creates the building blocks of life all on his GPU

lonebeaver
Автор

It's incredible how lifelike those behaviours are. While this of course has much simpler starting conditions and rules then our world, it makes it much easier to imagine our universe just randomly formed from noise interacting with itself.

lorenz.f
Автор

Almost getting the feeling that one of these simulation would suddenly become life

Crozz
Автор

At 4:50 I see nice little happy particles traveling alone and than finding their friends and dancing together

cheimy
Автор

Its so goddamn mesmerizing. Honestly im glad you are here for us. You taught me to not always strive for a super awesome scalable system that never gets done but just write the goddamn code and then see if the performance is good enough. That made me a better Programmer. Thank you

PaprikaYT
Автор

I knew you were good from the time I subscribed to your channel. But you've reached a level where the code at your fingertips can even now turn into art. Not to mention, it must be admitted, that some of these behaviors automatically make you think about life at different times or places or even at different scales. You are truly impressive, breathtaking.

tecumstudio
Автор

following this channel since 2017 and I'm telling you guys, this guy is a freaking GENIUS. I hope Sebastian become a leading entrepreneur in our software industry one day. - Proud Patreon.

nmbileg
Автор

I don’t care that my mobile is in 3% battery. I can’t stop watching it. It’s satisfying .

jseneque
Автор

That second simulation looks like I'm watching micro-organisms through a microscope, and that "Thanks for watching" slide is by far the coolest end to a video I've ever seen

BrodieEaton
Автор

8:30 absolutely amazing. You have a gift in programming and understanding of the fundamentals of biology. Thank you so much for this.

MichaelJONeill
Автор

This is genuinely one of the most fascinating, astonishing and relaxing videos i have seen in a long time. Thank you for listening to your viewers suggesting this kind of video!

xxTshestoxx
Автор

It's amazing how you incorporate music that perfectly encapsulates what I feel when I watch any of the simulations you make

gareths
Автор

I’m calling it, in 4 years you’re gonna make a “I Simulated All Of Reality” video

okyeahbutwhythoe
Автор

What a great way to start my day. Sitting here with a cup of coffee, watching art unfold in front of me and listening to some well-chosen music.

adamprice
Автор

I'm a simple man. I see a new Sebastian Lague video, I watch. But seriously this is so cool. It's like watching microbes under a microscope.

TebiByyte