25 releases (5 breaking)
|0.5.0||May 10, 2023|
|0.4.0-rc.2||Mar 13, 2023|
|0.3.0||Dec 29, 2022|
|0.2.0-rc.3||Sep 7, 2022|
|0.0.0||Dec 13, 2021|
#363 in Game dev
110 downloads per month
Used in evoke
Edict is a fast and powerful ECS crate that expands traditional ECS feature set. Written in Rust by your fellow 🦀
General purpose archetype based ECS with fast iteration.
Relations can be added to pair of entities, binding them together. When either of the two entities is despawned, relation is dropped.
Relationtype may further configure behavior of the bonds.
Change tracking. Each component instance is equipped with epoch counter that tracks last potential mutation of the component. Special query type uses epoch counter to skip entities where component wasn't changed since specified epoch. Last epoch can be obtained with
Built-in type-map for singleton values called "resources". Resources can be inserted into/fetched from
World. Resources live separately from entities and their components.
Runtime checks for query validity and mutable aliasing avoidance. This requires atomic operations at the beginning iteration on next archetype.
!Sendcomponents cannot be fetched mutably from outside "main" thread.
!Synccomponents cannot be fetched immutably from outside "main" thread.
Worldhas to be
Component type may define a set of types that can be borrowed from it. Borrowed type may be not sized, allowing slices, dyn traits and any other
!Sizedtypes. There's macro to define dyn trait borrows. Special kind of queries look into possible borrows to fetch.
WorldBuildercan be used to manually register component types and override default behavior.
Componenttrait to allow implicit component type registration by insertion methods. Implicit registration uses behavior defined by
Componentimplementation as-is. Separate insertions methods with
Componenttrait bound lifted can be used where trait is not implemented or implementation is not visible for generic type. Those methods require pre-registration of the component type. If type was not registered - method panics. Both explicit registration with
WorldBuilderand implicit registration via insertion method with
Componenttype bound is enough.
edict can be used in
no_std environment but requires
"std" feature enabled error types implement
"std" feature is enabled by default and must be turned off for
Dependent crates that also support
no_std should use
default-features = false for
and optionally enable
"std" if needed.
Licensed under either of
- Apache License, Version 2.0, (license/APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (license/MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.