back
94 comments
One of my first coding projects at school was Conway's game of life, but I found the black and white a bit too boring so I pushed the assignment further by introducing RGB "genes", and give spawns a combination of their parents' colours (with random mutations).

It's very fun watching which "faction" might take over the board.

Demo: https://genetic-life.surge.sh/

Source (ported from the original C++ into Rust/WASM): https://github.com/franky47/genetic-life

This is the most interesting one I generated: https://hunar4321.github.io/particle-life/particle_life.html...

It eventually settles down to one large and unstable blob and another stable. Neither move so that's it. But before that it did what I had expected to see with objects meeting and merging

Tagging along: https://hunar4321.github.io/particle-life/particle_life.html...

This one is really fun for me. It has a lot of actions and good shapes.

This is fascinating. It's like a more complex game of life than John connoway's. It's crazy that little creatures seem to form at such small scales easily with these parameters. It's almost like the parameters of our real universe intentionally made it difficult to form life, rather than easy as some people seem to think.
They are less creatures than molecules. Now, mind you, as some complex sets of rules approach steady state I can pretend they are far-flung stellar empires with colors ascribed to each type of system of government (and have).

What is fooling you is the motion. This is sustained because the system has no conservation principles built in. You can make A-B pairs where B is attracted to A, A is repelled by B, and off they go, zoom. Were the meta-rules devised such that conservation of energy or momentum and such were baked in to whatever system you devised, you would see less exciting structures which would more resemble a late-stage pentamino explosion in the Game of Life.

With a sufficiently large processor, I would like to see this in three dimensions and more options for force, such as dropping off as the inverse of r or r-cubed or even r * log(r), or some "repulsive at a distance, attractive at very close quarters" particles. I have a feeling that such a system would grind to a halt even with clever optimizations.

> I would like to see this in three dimensions...

Oh, there's one of those too! I don't see ways to change the falloff though, just the magnitude...

https://hunar4321.github.io/particle-life/particle_life_3d.h...

There's no reason to believe life is particularly rare in the universe either, though.
That's a funny coincidence, I recently made something similar: https://webgl-particle-life.netlify.app/ (source: https://github.com/ath92/particle-life)

This version does everything in webgl shaders and keeps all state for the simulation in textures / uniforms. This allows it to simulate and draw more particles. Unfortunately it may not run on all devices because it uses some less supported webgl extensions.

Related:

Particle Life Emerges from Simplicity - https://news.ycombinator.com/item?id=34156592 - Dec 2022 (1 comment)

Particle Life Simulation - https://news.ycombinator.com/item?id=33680845 - Nov 2022 (1 comment)

Particle Life - https://news.ycombinator.com/item?id=21875720 - Dec 2019 (7 comments)

This is a much more complete implementation, but I took a crack at this a while ago using compute shaders in Godot 4, if that's interesting to folks!

https://github.com/jasonjmcghee/compute-shaders

I never considered it before, but by comparison this makes me realize that Conway's Game of Life is wave-based rather than particle-based. That is, in CGoL the rules apply to locations of the grid rather than objects traveling across the grid. I wonder if this system could also be constructed in a wave-based fashion?

Also, it seems like in this system the speed of light is infinite, since every particle acts on every other particle each frame, regardless of distance. In CGoL there is a speed of light, since cells can only influence their immediate neighbors each frame.

Looking at the 3d js version right now. This might be my most favorite thing since the original Conway's life or maybe the old Primordial Life screen saver from the 90's. Have you considered adding shader support? I'd love to see a slowed-down more "blobby" version running full-screen. Probably turn my mac into a space heater too, but right now that's a bonus ;)
If anyone is more interested in this kind of stuff, then I can recommend checking out "Smooth-life" and "Lenia", the latter of which has a couple different, more complex variants... "Flow Lenia" or "Particle Lenia" come to mind in relation to this particular (pun intended) topic.
That's impressive.

I had a similar concept in mind when I started experimenting in 3D with what I now call "Altphy" (alternative physics), but I've not been able to really make it work as intended (really, is far from working). Also probably the logic and idea behind it too much for real time processing. I'm sharing it only because maybe pieces of that code (or the idea itself) can progress into something one day.

source: https://github.com/aDeveloperCase/altphy

Even with such a basic system you immediately start to get self-organising little bubbles of life. If something had a way to replicate in these bubbles, you would have the first cell.
Another similar implementation, including music responsiveness: https://vuzic.app/
The project is quite cool. I found myself tweaking for some good amount of time.

But the thing is it does not demonstrate that complexity can come from simplicity. To make a 'life' there are 8 parameters to be modified across a range and 'fine tuned' to get some tangible stable complex structure, all to be done by already conscious beings ( Users anyone? ). So much for simplicity

Mixing up Conway's game with colorful 'genes' is pretty wild, like coding with a rainbow palette. And about those blobs – it's like they're putting on their own little drama show, then just decide to chill. Also, gotta love the action and cool shapes in that simulation. It's like a mini superhero movie, but with shapes instead of characters.
What are the philosophical implications of these life models? Is it implied that life as we know it may also have a simple set of rules like this that generated it? Or is it just a game? (as in Conway's GoL).

Found some info here, seems like these are open questions [1].

--

1: https://en.wikipedia.org/wiki/Artificial_life#Philosophy

I found a pretty fun set of rules: make a cycle of -0.4 between the colours (eg G->R, R->Y, Y->B, B->G in 3d or G->R, R->O, O->C, C->G in 2d) and set the other factors to 0.1.

The particles form semi-stable rotating rings until they get too close to another ring. It's quite fascinating to watch. Messing with the viscosity changes the stability and radius of the rings

Very cool -- shame I don't have a wall TV to just run it on. I was however, disappointed -- I saw it as a T-shirt brand "Particle Life" for physicists. The T-shirts would have slogans such as "After listening to you, I realize you're just an unfortunate jiggle in the quantum field, so I feel totally justified in ignoring everything you say"
I made a multithreaded Rust version of this (while learning Rust): https://github.com/bezdomniy/rust_particles

you can run it with: cargo run --release

No input yet, just randomly initialises params each run. But it runs with 4000 particles on my machine.

Super cool! Earlier this year I created a zero-player simulation using pygame and several AI coding assitants to see how capable they might be. In the end I had to clean up alot, but Im happy with how it turned out.

https://github.com/derekburgess/simcraft

It is amazing how easily self-sustaining structures emerge from such simple rules. Mesmerizing.
Is there any "sustaining" in the simulation? Is death a possibility? If not, then there is no "sustaining".
There was no death for the original life.

Rotting is caused by living organisms. Being eaten is caused by living organisms. Disease is caused by living organisms.

They could not die until death evolved. They could be physically destroyed but that’s not that likely.

offtopic: I got a new PC for xmas, and hadn't really stress tested it to make sure the fan management curve was correct. Running the linked site's demos made the fans work and they're really responsive. Cool stuff!
If this doesn’t convince you spontaneous life is possible I don’t know what will
This is not spontaneous, all the parameters have to be carefully tweaked to get some tangible stable complex structures. Also initial set of parameters are 20 which is not simple! Compared to that the complex structure is not much complex.
There is also https://exophysics.codeberg.page/ which turns particles into moving creatures.
Well done: 3d is an option! Always wondered what emergent properties result from simple rules worlds when the dimensionality goes from 2d to 3d.
This shows how life is emergent from simple rules.
how does it show it? what is meant by life? are rules necessary or just transitions? what enables rules at all?
None of these simulated systems show replication evolving out of random rules though.
I watched the Youtube video on this yesterday and have been itching to try a webgl shader implementation ever since.
I’m not really understanding what the “life” part of this is.
Indeed. If we described this as a "neat circular patterns simulator" would anything be lost?

Is there reproduction? Is there evolution? Is there death? It appears not. Those are essential to life.

It's an iteration on Conway's "Game of Life".
The code walkthrough was excellent and very elegant
I'd love to see this on a toroidal surface
a Mobius strip, even
Fascinating. This reminds me of nanopond
This is so great!!! Nice work!
Life, uh, finds its particles.
Really liked it