Cookies   I display ads to cover the expenses. See the privacy policy for more information. You can keep or reject the ads.

Video thumbnail
Conway's Game of Life is a really cool example of emergent lifelike behavior.
But I'm not actually gonna be talking about that too much, since that's already a popular topic.
Instead, I want to show you a particle based game of life.
Just like Conway's Game of Life. Particle life, also formed self-organizing structures,
still-life, oscillators, gliders. And so on.
And it usually looks even more lifelike!
So what's actually going on under the hood?
Both lives are based on very simple rules.
In Conway's, it's based on neighbor count updating a cell.
And in particle life, neighboring cells apply forces on each other.
So you have some number of particle types. Let's say: red, green, and blue, for this example.
Each class of particles has a random attraction or repulsion to all other classes.
So, blue and red might attract each other, and green might be repelled by both.
But, we're gonna be breaking the law.
And of course, I'm referring to Newton's third law: That every action has an equal and opposite reaction.
That means that red can be attracted to blue but, blue can be repelled by red. So you end up with a pursuit.
And of course, that means we're also breaking another law: The conservation of energy.
When particles chase each other like this, they can just build up speed forever and that leads to nothing interesting.
So to fix this, we add friction to the system.
But it's not as hacky as it sounds! Besides fixing the infinite energy problem,
it also causes annealing. Meaning that over time, particles tend to fall into the most stable arrangements.
And it's kind of more lifelike if you think about it.
We have a source of energy, like the sun, and it's taken away by entropy, or friction.
Last thing is the attraction radius.
There's a minimum and maximum distance where force can be applied, and that's randomly chosen for each class as well.
Particles also have an extra repelling force to prevent intersection.
And that's about it! By tuning those random distributions. You can get different kinds of life,
just like the different cellular automata rules.
By the way, this was inspired by Jeffery Ventrella's clusters, which I'll link to in the description.
Unfortunately, there wasn't any source code.
So I kind of just made everything up the way I wanted it rather than try to copy the original.
The most impressive thing to me though is that it seems organic on multiple scales.
You could say it kind of looks like stars and galaxies forming clusters, or animals or fish chasing each other around.
Or cells and membranes moving around a microscope slide, or individual atoms forming more complex molecules.
Life it seems is really a giant fractal. It all goes back to that emergent behavior arising from simple rules.
And that's what the universe is made of: Simple rules.
So I hope this was an interesting topic, from both a programming point of view, and a philosophical one.
The source code and executable are in the description as usual.
Thanks for watching, and I hope you give it a try!