Evenio
evenio is an archetype-based Entity Component System framework for building event-driven programs.
It aims to have a small but maximally expressive set of features that are easy and efficient to use.
Features
- In addition to the usual Entities, Components, and Systems,
eveniointroduces events as a first-class citizen. Rather than restricting systems to run once every frame/update in a fixed order, systems are generalized as event handlers. The control flow of the entire program is then defined by the flow of events between handlers. - Structural changes to the world (such as entity despawning, component additions/removals, etc.) are mediated by events, allowing handlers to hook into their occurrence.
- Targeted events enable handlers to efficiently filter events based on queries.
- Component types, event types, and handlers are identified with generational indices, allowing them to be added and removed dynamically.
- Execute queries in parallel with Rayon.
- World data has no
SendorSyncrequirements. no_stdsupport.
For a full step-by-step introduction, please read the tutorial book 📚.
Example
Here's how we might make a simple game loop in evenio:
use *;
// Define position and velocity components.
// Events can carry data, but for this example we only need a unit struct.
;
// The `Receiver<Tick>` parameter tells our handler to listen for the `Tick` event.
Feature Flags
std(enabled by default): Enables support for the standard library. Without this,eveniodepends only oncoreandalloc.rayon: Adds parallel iterator support forFetcher. Uses the Rayon library.