SanderMertens/flecs
FreeA fast entity component system (ECS) for C & C++
About SanderMertens/flecs
Flecs is a fast and lightweight Entity Component System (ECS) for C & C++ designed for building games and simulations with millions of entities. It provides a portable, zero-dependency C99 API and a modern type-safe C++17 API that avoids STL containers. Notable features include full support for Entity Relationships (first among open-source ECS), fast native hierarchies and prefabs, cache-friendly archetype/SoA storage, automatic component registration across shared libraries, and a lockless scheduler for multi-core performance. Flecs integrates a reflection framework with JSON serialization, runtime component support, unit annotations for components, a powerful query language with joins and inheritance, and a statistics addon for profiling. It also offers a web-based UI for monitoring and controlling applications. The codebase builds in under 5 seconds and runs in the browser via Emscripten. Flecs is verified on all major compilers and platforms, with over 13,000 tests in CI.
Key Features
Pros & Cons
- Zero dependency, portable across platforms and compilers
- Very fast build times (less than 5 seconds)
- Runs in browser via Emscripten without modifications
- Extensive testing with over 13,000 CI tests
- Strong support for ECS relationships and hierarchies
- Reflection and serialization included out of the box
- Multi-core lockless scheduler for performance