Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
F

flecs

> DevOps
Open source

A fast entity component system (ECS) for C & C++

8.5K stars0 likes0 views
WebsiteGitHub

About

A fast entity component system (ECS) for C & C++

Flecs is a fast and lightweight Entity Component System that lets you build games and simulations with millions of entities (join the Discord!). Here are some of the framework's highlights:

  • Fast and portable zero dependency C99 API
  • Modern type-safe C++17 API that doesn't use STL containers
  • First open source ECS with full support for Entity Relationships!
  • Fast native support for hierarchies and prefabs
  • Code base that builds in less than 5 seconds
  • Runs in the browser without modifications with emscripten
  • Cache friendly archetype/SoA storage that can process millions of entities every frame
  • Automatic component registration that works out of the box across shared libraries/DLLs
  • Write free functions with queries or run code automatically in systems
  • Run games on multiple CPU cores with a fast lockless scheduler
  • Verified on all major compilers and platforms with CI running more than 13000 tests
  • Integrated reflection framework with JSON serializer and support for runtime components
  • Unit annotations for components
  • Powerful query language with support for joins and inheritance
  • Statistics addon for profiling ECS performance
  • A web-based UI for monitoring & controlling your apps: To support the project, give it a star !

What is an Entity Component System?

ECS is a way of organizing code and data that lets you build games that are larger, more complex and are easier to extend. Something is called an ECS when it:

  • Has entities that uniquely identify objects in a game
  • Has components which are datatypes that can be added to entities
  • Has systems which are functions that run for all entities matching a component query

For more information, check the ECS FAQ!

Show me the code!

C99 example:

…

Same example in C++:

cpp
struct Position {
  float x, y;
};

struct Velocity {
  float x, y;
};

int main(int argc, char *argv[]) {
  flecs::world ecs;

  ecs.system<Position, const Velocity>()
    .each([](Position& p, const Velocity& v) {
      p.x += v.x;
      p.y += v.y;
    });

  auto e = ecs.entity()
    .insert([](Position& p, Velocity& v) {
      p = {10, 20};
      v = {1, 2};
    });

  while (ecs.progress()) { }
}

Projects using Flecs

If you have a project you'd like to share, let me know on Discord!

Tempest Rising

Territory Control 2

Polyzonia

Resistance is Brutal

Appulse

Rescue Ops: Wildfire

Age of Respair

FEAST

Gloam Vault

Antimatcher

Writ of Battle

Extermination Shock

The Forge

ECS survivors

8402

Tome Tumble Tournament

Sol Survivor

After Sun

Flecs Hub

Flecs Hub is a collection of repositories that show how Flecs can be used to build game systems like input handling, hierarchical transforms and rendering.

Module Description
flecs.components.cglm Component registration for cglm (math) types
flecs.components.input Components that describe keyboard and mouse input
flecs.components.transform Components that describe position, rotation and scale
flecs.components.physics Components that describe physics and movement
flecs.components.geometry Components that describe geometry
flecs.components.graphics Components used for computer graphics
flecs.components.gui Components used to describe GUI components
flecs.systems.transform Hierarchical transforms for scene graphs
flecs.systems.physics Systems for moving objects and collision detection
flecs.systems.sokol Sokol-based renderer
flecs.game Generic game systems, like a camera controller

Language bindings

The following language bindings have been developed with Flecs! Note that these are projects built and maintained by helpful community members, and may not always be up to date with the latest commit from master!

  • C#:
    • BeanCheeseBurrito/Flecs.NET
  • Rust:
    • Flecs-Rust
    • flecs-polyglot
  • Zig:
    • zig-gamedev/zflecs
  • Lua:
    • sro5h/flecs-luajit
    • flecs-hub/flecs-lua
  • Clojure
    • vybe-flecs

Issues· 60 open

View all issuesOpen on GitHub
  • #2296

    Script: a struct can't use a vector or array type declared earlier in the same script

    Updated Sep 28, 2026
  • #2295

    Re-entering scope of anonymous entity through variable in managed script asserts when script is updated

    bugUpdated Sep 28, 2026
  • #2287

    Multiple up() terms read components from different parents

    bugUpdated Sep 11, 2026
  • #2286

    MSVC C2099 for log2 initializer in script math registry

    bugUpdated Sep 11, 2026
  • #2284

    Adding a component to an instantiated prefab aborts with ECS_ALREADY_IN_USE, which blocks live prefab editing.

    bugUpdated Sep 10, 2026
  • #2271

    Add support for MS-DOS build

    enhancementUpdated Sep 9, 2026
  • #2277

    up|self traversal failing to combine results correctly in query for relationship

    bugUpdated Sep 7, 2026
  • #2275

    Add context support to query `order_by` callbacks

    enhancementUpdated Sep 2, 2026
  • #2258

    Allow `ecs_entity_range_set` in stage

    enhancementUpdated Aug 20, 2026
  • #2257

    Add IWYU pragma comments to internal headers

    enhancementUpdated Aug 19, 2026

> Tags

Cc99cpp11cpp14cpp17

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 30, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理