11 releases
0.2.7 | Nov 21, 2022 |
---|---|
0.2.6 | Jan 31, 2022 |
0.2.5 | Dec 12, 2021 |
0.1.2 | Jul 24, 2021 |
#234 in Memory management
170KB
4K
SLoC
Shard
Shard is an Archetype-based Entity Component System implemented in Rust.
Features
- Systems are (currently) implicit.
- Supports #![no_std] environments. (Requires alloc however)
- Up to 14 components per entity.
- Up to 65K archetypes.
- Up to 16.7 million entities.
- Dependency free.
- (Mostly) unit tested.
Usage
See the examples directory for details, but in short:
- Implement Component trait for types which you wish to use as components.
- Create a Registry.
- Use the Registry to construct entities.
- Add or remove components from entities.
- Iterate over entities matching certain subsets of components.
TODO:
- Query support
Filter iterators=> done as of 0.2.3.- Procedural derive macro for Components. => done as of 0.2.6.
- Allow replacing components.
- Allow adding/removing multiple components at once.
- Faster archetype lookups (using a graph).
- Component dependencies/exclusions.
Dependencies
~225KB