{"id":15130533,"url":"https://github.com/sandermertens/flecs","last_synced_at":"2026-03-16T02:27:54.178Z","repository":{"id":37299365,"uuid":"146155284","full_name":"SanderMertens/flecs","owner":"SanderMertens","description":"A fast entity component system (ECS) for C \u0026 C++","archived":false,"fork":false,"pushed_at":"2025-05-12T03:22:24.000Z","size":143327,"stargazers_count":7021,"open_issues_count":32,"forks_count":515,"subscribers_count":80,"default_branch":"master","last_synced_at":"2025-05-12T15:24:08.799Z","etag":null,"topics":["c99","cpp11","cpp14","cpp17","data-oriented","data-oriented-design","ecs","entity-component-system","entity-framework","flecs","game-development","game-engine","game-engine-framework","gamedev","modern-cpp","no-dependencies","portable","production-ready"],"latest_commit_sha":null,"homepage":"https://www.flecs.dev","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SanderMertens.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["SanderMertens"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-08-26T05:53:05.000Z","updated_at":"2025-05-12T12:40:48.000Z","dependencies_parsed_at":"2024-03-17T04:26:21.695Z","dependency_job_id":"cb86c579-3cc0-4ebb-9f5c-b379cdf0bc39","html_url":"https://github.com/SanderMertens/flecs","commit_stats":null,"previous_names":[],"tags_count":62,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanderMertens%2Fflecs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanderMertens%2Fflecs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanderMertens%2Fflecs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SanderMertens%2Fflecs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SanderMertens","download_url":"https://codeload.github.com/SanderMertens/flecs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253764240,"owners_count":21960544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c99","cpp11","cpp14","cpp17","data-oriented","data-oriented-design","ecs","entity-component-system","entity-framework","flecs","game-development","game-engine","game-engine-framework","gamedev","modern-cpp","no-dependencies","portable","production-ready"],"created_at":"2024-09-26T03:01:36.585Z","updated_at":"2026-03-16T02:27:54.173Z","avatar_url":"https://github.com/SanderMertens.png","language":"C","readme":"![flecs](docs/img/logo.png)\n\n[![Version](https://img.shields.io/github/v/release/sandermertens/flecs?include_prereleases\u0026style=for-the-badge)](https://github.com/SanderMertens/flecs/releases)\n[![MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge)](https://github.com/SanderMertens/flecs/blob/master/LICENSE)\n[![Documentation](https://img.shields.io/badge/docs-flecs-blue?style=for-the-badge\u0026color=blue)](https://www.flecs.dev/flecs/md_docs_2Docs.html)\n[![actions](https://img.shields.io/github/actions/workflow/status/SanderMertens/flecs/ci.yml?branch=master\u0026style=for-the-badge)](https://github.com/SanderMertens/flecs/actions?query=workflow%3ACI)\n[![Discord Chat](https://img.shields.io/discord/633826290415435777.svg?style=for-the-badge\u0026color=%235a64f6)](https://discord.gg/BEzP5Rgrrp)\n\nFlecs is a fast and lightweight Entity Component System that lets you build games and simulations with millions of entities ([join the Discord!](https://discord.gg/BEzP5Rgrrp)). Here are some of the framework's highlights:\n\n- Fast and [portable](#language-bindings) zero dependency [C99 API](https://www.flecs.dev/flecs/group__c.html)\n- Modern type-safe [C++17 API](https://www.flecs.dev/flecs/group__cpp.html) that doesn't use STL containers\n- First open source ECS with full support for [Entity Relationships](https://www.flecs.dev/flecs/md_docs_2Relationships.html)!\n- Fast native support for [hierarchies](https://www.flecs.dev/flecs/md_docs_2HierarchiesManual.html) and [prefabs](https://www.flecs.dev/flecs/md_docs_2PrefabsManual.html)\n- Code base that builds in less than 5 seconds\n- Runs [in the browser](https://flecs.dev/city) without modifications with emscripten\n- Cache friendly [archetype/SoA storage](https://ajmmertens.medium.com/building-an-ecs-2-archetypes-and-vectorization-fe21690805f9) that can process millions of entities every frame\n- Automatic component registration that works out of the box across shared libraries/DLLs\n- Write free functions with [queries](https://github.com/SanderMertens/flecs/tree/master/examples/cpp/queries/basics) or run code automatically in [systems](https://github.com/SanderMertens/flecs/tree/master/examples/cpp/systems/pipeline)\n- Run games on multiple CPU cores with a fast lockless scheduler\n- Verified on all major compilers and platforms with [CI](https://github.com/SanderMertens/flecs/actions) running more than 13000 tests\n- Integrated [reflection framework](https://www.flecs.dev/flecs/group__c__addons__meta.html) with [JSON serializer](https://github.com/SanderMertens/flecs/tree/master/examples/cpp/reflection/basics_json) and support for [runtime components](https://github.com/SanderMertens/flecs/tree/master/examples/cpp/reflection/runtime_component)\n- [Unit annotations](https://github.com/SanderMertens/flecs/tree/master/examples/cpp/reflection/units) for components\n- Powerful [query language](https://github.com/SanderMertens/flecs/tree/master/examples/cpp/queries) with support for [joins](https://github.com/SanderMertens/flecs/tree/master/examples/cpp/queries/setting_variables) and [inheritance](https://github.com/SanderMertens/flecs/tree/master/examples/cpp/queries/component_inheritance)\n- [Statistics addon](https://www.flecs.dev/flecs/group__c__addons__stats.html) for profiling ECS performance\n- A web-based UI for monitoring \u0026 controlling your apps:\n\n[![Flecs Explorer](docs/img/explorer.png)](https://flecs.dev/explorer)\n\nTo support the project, give it a star 🌟 !\n\n## What is an Entity Component System?\nECS 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:\n- Has _entities_ that uniquely identify objects in a game\n- Has _components_ which are datatypes that can be added to entities\n- Has _systems_ which are functions that run for all entities matching a component _query_\n\nFor more information, check the [ECS FAQ](https://github.com/SanderMertens/ecs-faq)!\n\n## Show me the code!\nC99 example:\n```c\ntypedef struct {\n  float x, y;\n} Position, Velocity;\n\nvoid Move(ecs_iter_t *it) {\n  Position *p = ecs_field(it, Position, 0);\n  Velocity *v = ecs_field(it, Velocity, 1);\n\n  for (int i = 0; i \u003c it-\u003ecount; i++) {\n    p[i].x += v[i].x;\n    p[i].y += v[i].y;\n  }\n}\n\nint main(int argc, char *argv[]) {\n  ecs_world_t *ecs = ecs_init();\n\n  ECS_COMPONENT(ecs, Position);\n  ECS_COMPONENT(ecs, Velocity);\n\n  ECS_SYSTEM(ecs, Move, EcsOnUpdate, Position, Velocity);\n\n  ecs_entity_t e = ecs_insert(ecs,\n    ecs_value(Position, {10, 20}),\n    ecs_value(Velocity, {1, 2}));\n\n  while (ecs_progress(ecs, 0)) { }\n}\n```\n\nSame example in C++:\n\n```cpp\nstruct Position {\n  float x, y;\n};\n\nstruct Velocity {\n  float x, y;\n};\n\nint main(int argc, char *argv[]) {\n  flecs::world ecs;\n\n  ecs.system\u003cPosition, const Velocity\u003e()\n    .each([](Position\u0026 p, const Velocity\u0026 v) {\n      p.x += v.x;\n      p.y += v.y;\n    });\n\n  auto e = ecs.entity()\n    .insert([](Position\u0026 p, Velocity\u0026 v) {\n      p = {10, 20};\n      v = {1, 2};\n    });\n\n  while (ecs.progress()) { }\n}\n```\n\n## Projects using Flecs\nIf you have a project you'd like to share, let me know on [Discord](https://discord.gg/BEzP5Rgrrp)!\n\n### Tempest Rising\n[![Tempest Rising](docs/img/projects/tempest_rising.png)](https://store.steampowered.com/app/1486920/Tempest_Rising/)\n\n### Territory Control 2\n[![image](docs/img/projects/territory_control.png)](https://store.steampowered.com/app/690290/Territory_Control_2/)\n\n### Resistance is Brutal\n[![image](docs/img/projects/resistance_is_brutal.jpg)](https://store.steampowered.com/app/3378140/Resistance_Is_Brutal/)\n\n### Rescue Ops: Wildfire\n[![image](docs/img/projects/rescue_ops_wildfire.png)](https://store.steampowered.com/app/2915770/Rescue_Ops_Wildfire/)\n\n### Age of Respair\n[![image](docs/img/projects/age_of_respair.png)](https://store.steampowered.com/app/3164360/Age_of_Respair/)\n\n### FEAST\n[![image](docs/img/projects/feast.jpg)](https://store.steampowered.com/app/3823480/FEAST/)\n\n### Gloam Vault\n[![image](docs/img/projects/gloam_vault.png)](https://store.steampowered.com/app/3460840/Gloamvault/)\n\n### Antimatcher\n[![image](docs/img/projects/antimatcher.png)](https://store.steampowered.com/app/4336520/AntiMatcher/)\n\n### Writ of Battle\n[![image](docs/img/projects/writ_of_battle.jpg)](https://store.steampowered.com/app/4445990/Writ_of_Battle/)\n\n### Extermination Shock\n[![image](docs/img/projects/extermination_shock.png)](https://store.steampowered.com/app/2510820/Extermination_Shock/)\n\n### The Forge\n[![image](docs/img/projects/the_forge.jpg)](https://github.com/ConfettiFX/The-Forge)\n\n### ECS survivors\n[![image](docs/img/projects/ecs_survivors.png)](https://laurent-voisard.itch.io/ecs-survivors/)\n\n### Tome Tumble Tournament\n[![image](docs/img/projects/tome_tumble.png)](https://terzalo.itch.io/tome-tumble-tournament)\n\n### Sol Survivor\n[![image](docs/img/projects/sol_survivor.png)](https://nicok.itch.io/sol-survivor-demo)\n\n### After Sun\n[![image](docs/img/projects/after_sun.png)](https://github.com/foxnne/aftersun)\n\n## Flecs Hub\n[Flecs Hub](https://github.com/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.\n\nModule      | Description\n------------|------------------\n[flecs.components.cglm](https://github.com/flecs-hub/flecs-components-cglm) | Component registration for cglm (math) types\n[flecs.components.input](https://github.com/flecs-hub/flecs-components-input) | Components that describe keyboard and mouse input\n[flecs.components.transform](https://github.com/flecs-hub/flecs-components-transform) | Components that describe position, rotation and scale\n[flecs.components.physics](https://github.com/flecs-hub/flecs-components-physics) | Components that describe physics and movement\n[flecs.components.geometry](https://github.com/flecs-hub/flecs-components-geometry) | Components that describe geometry\n[flecs.components.graphics](https://github.com/flecs-hub/flecs-components-graphics) | Components used for computer graphics\n[flecs.components.gui](https://github.com/flecs-hub/flecs-components-gui) | Components used to describe GUI components\n[flecs.systems.transform](https://github.com/flecs-hub/flecs-systems-transform) | Hierarchical transforms for scene graphs\n[flecs.systems.physics](https://github.com/flecs-hub/flecs-systems-physics) | Systems for moving objects and collision detection\n[flecs.systems.sokol](https://github.com/flecs-hub/flecs-systems-sokol) | Sokol-based renderer\n[flecs.game](https://github.com/flecs-hub/flecs-game) | Generic game systems, like a camera controller\n\n## Language bindings\nThe 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!\n- C#:\n  - [BeanCheeseBurrito/Flecs.NET](https://github.com/BeanCheeseBurrito/Flecs.NET)\n- Rust:\n  - [Flecs-Rust](https://github.com/Indra-db/Flecs-Rust)\n  - [flecs-polyglot](https://github.com/flecs-hub/flecs-polyglot)\n- Zig:\n  - [zig-gamedev/zflecs](https://github.com/zig-gamedev/zflecs)\n- Lua:\n  - [sro5h/flecs-luajit](https://github.com/sro5h/flecs-luajit)\n  - [flecs-hub/flecs-lua](https://github.com/flecs-hub/flecs-lua)\n- Clojure\n  - [vybe-flecs](https://vybegame.dev/vybe-flecs)\n","funding_links":["https://github.com/sponsors/SanderMertens"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandermertens%2Fflecs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsandermertens%2Fflecs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsandermertens%2Fflecs/lists"}