Bevy ECS
Bevy ECS is an Entity Component System custom-built for the Bevy game engine.
It aims to be simple, ergonomic, fast, massively parallel, opinionated, and featureful.
Entities are unique "things" that are assigned groups of Components, which are then processed using System. Entities, Components, Resources are stored in a World.
Concepts and the relationships between them.
Components are normal Rust structs. They are data stored in a World
and specific instances of Components correlate to Entities.
Entities, Components, and Resources are stored in a World
. Worlds, much like std::collections
's HashSet
and Vec
, expose operations to insert, read, write and remove the data they store.
Entities are unique identifiers that correlate to zero or more Components.
Systems are normal Rust functions. Thanks to the Rust type system, Bevy ECS can use function parameter types to determine what data needs to be sent to the system. It also uses this "data access" information to determine what Systems can run in parallel with each other.
Apps often require unique resources, such as asset collections, renders, audio servers, time etc. Bevy ECS makes this pattern a first class citizen. Resource
is a special kind of component that does not belong to any entity. Instead, it is identified uniquely by its type.
Schedules run a set of Systems according to some execution stratygy. Systems can be added to any number of System Sets, which are used to control their scheduling metadata. The built in "parallel executor" considers dependencies between systems and run as many of them in parallel as possible. This maximazes performance, while keeping the system execution safe. To control the system ordering, define explicit dependencies between systems and their sets.