simplecs
simplecs
simplecs is a lightweight, zero-dependency Entity-Component System (ECS) for Rust.
It emphasizes simplicity, type-safety, and ergonomic querying.
✨ Features
- ✅ Simple API — no macro-heavy boilerplate
- 🧠 Type-based querying with
With<T>/Without<T> - 🧩 Dynamic component registration via
ComponentStorageBuilder - 🔄 Uses
TypeId+Anyinternally for type-erased buckets - 🦀 Pure safe Rust — great for learning ECS
🚀 Example
use *;
W
;
;
component_list!;
📐 Query API
simplecs uses type-safe static dispatch to query entities:
With<T>– selects entities with componentsTWithout<T>– selects entities that lackT- Combinations like
(With<A>, Without<B>)work too
Define component groups with a macro:
component_list!;
Then use in queries:
let ids = storage.;
🧱 Architecture
- Each component type has a separate
Storage<E, T> - All storages are type-erased into
dyn ComponentBucket<E> - ECS queries are resolved using sets and intersections
- Entities can be any
Copy + Eq + Hashtype (e.g.u32)
🛠 License
Licensed under either of:
- MIT license https://opensource.org/licenses/MIT
- Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0
🦀 Created by Buzzac
For questions, ideas, or contributions, feel free to open an issue or PR.
Want to regenerate this README from your docs?
License: MIT OR Apache-2.0