A 2D environment simulator, that let's you define the behavior and the shape of your entities, while taking care of dispatching events generation after generation.
For an overview of what you can do, and how you can do it with this library, the
best way to start is to read the
introductive blog post, or to have
a look at the several examples that come with this project.
Each of these aims to show a subset of the features set of semeion
, while
giving an example of how to make the best use of it.
While, if you want to have a look at a more complete project that uses
semeion
as its entity engine, check out
formicarium.
Note: if you want to clone this repository without having to download the .gif assets you can do so with:
git clone --single-branch https://github.com/gliderkite/semeion.git
By default, semeion
uses an environment engine that schedules all the entity
callbacks on the same single thread, therefore no synchronization is required
(no user's implemented Entity
needs to be sent or shared between threads).
Nevertheless, there may be scenarios in which you are running a simulation that includes a significant number of entities and each of these entity tasks, required to proceed to the next generation, is considerably resource consuming. For these situations, it is possible to gain significant advantage by spawning multiple threads and running the simulation in parallel (profiling your code is always advised before taking final decisions).
At the moment, you can enable this (non additive) feature only at compile time,
by specifying the optional feature parallel
in your Cargo.toml
:
semeion = { version = "0.9", features = ["parallel"] }
The only requirement is that all your entities need to be Send and Sync.