A high-performance, feature-rich Entity Component System (ECS) library for Rust game development with minimal boilerplate.
Legion is a high-performance Entity Component System (ECS) library for Rust, designed to manage game entities, components, and systems efficiently. It solves the problem of organizing complex game state and logic with minimal boilerplate, enabling scalable and parallelizable game architectures.
Rust game developers and engine creators who need a robust, performant ECS for managing game entities, components, and systems in data-oriented designs.
Developers choose Legion for its blend of high performance, expressive querying, and parallel system execution, all with minimal boilerplate, making it a top choice for Rust-based game projects.
High performance Rust ECS library
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Optimized for fast iteration with Rayon-based parallel execution, allowing systems to run concurrently while maintaining order, as shown in the automated scheduling features.
Offers flexible queries with filters for component inclusion, exclusion, and change detection, reducing boilerplate in entity access, as demonstrated in the query examples with boolean expressions.
Provides intuitive methods like push and extend for entity creation, and a system macro for defining work units, making ECS setup straightforward with less repetitive code.
Configurable for WebAssembly targets by disabling default parallelism, enabling cross-platform development with specific feature flags like wasm-bindgen, as detailed in the WASM section.
For WebAssembly builds, parallelism must be disabled, which limits performance benefits in single-threaded environments, a noted compromise in the README.
Enabling the 'extended-tuple-impls' feature increases compile times to support larger component tuples, adding complexity for projects needing more than 8 components per query.
The expressive query and system APIs, while powerful, require solid understanding of Rust and ECS concepts, which might overwhelm beginners or those new to data-oriented design.