This is a particle life simulation program.
A simple program to simulate primitive Artificial Life using simple rules of attraction or repulsion among atom-like particles, producing complex self-organizing life-like patterns.
– from the original repository
It was originally created by ChevyRay and reworked by valflrt. Here is a preview of what the app does:
smarticles_preview.mov
- add more particle classes
- make it possible to move around and zoom
- change particle interaction function (force with respect to distance)
- add particle inspector that allows following a selected particle
- add seed history to go back to previous seeds
- add multithreading: the simulation and display threads run in parallel
- Add spacial partitioning to considerably improve performance: you can now simulate thousands of particles with a decent tick rate which rarely exceeds 50ms (only in special cases where particles are gathered in groups and very close to each other)
To run this app, you can either download the latest binary or build it yourself from source by following the instructions below.
To build the app, you will need to have Rust installed, which you can get by following the installation instructions on the Rust website.
Then, download or clone this repository wherever you'd like and start the app using:
cargo run -r
Press the randomize
button to spawn particles from a new randomized seed. Then, press the play
button to run the simulation.
Here are the app's general controls:
Try randomizing it a few times and see what kind of results you get.
There are 8 particle types. You can change the behavior of each with respect to any other with the sliders:
Those enable you to change the power of the force applied by a particle from a class on a particle from a different class. A positive number means a repulsive interaction, and negative an attractive one.
You can adjust the parameters even while the simulation is running:
smarticles_live_params.mov
The seed
field enables you to save your favorite seeds and share them.
Pressing randomize
will generate random seeds.
When adjusting parameters by hand, the seed turns into a string starting with @
, which encodes the simulations parameters.
You can inspect particles using the particle inspector.
It allows following a specific particle.
A seed history is available to allow browsing previous seeds (losing an interesting seed because you clicked randomize a bit too fast is painful believe me).