Skip to content

Particle life simulation app. Improved and optimized version of ChevyRay/smarticles

License

Notifications You must be signed in to change notification settings

valflrt/smarticles-fork

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smarticles

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

Roadmap

  • 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)

Running the App

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

How to use the app

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:

screenshot of the app's basic 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:

screenshot of particle's parameters

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

Sharing Simulations

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.

screenshot of particle's parameters

Particle Inspector

You can inspect particles using the particle inspector.

screenshot of particle inspector menu

It allows following a specific particle.

Seed History

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

screenshot of seed history menu

About

Particle life simulation app. Improved and optimized version of ChevyRay/smarticles

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%