Download Latest Version Flecs v4.1.5 source code.tar.gz (27.7 MB)
Email in envelope

Get an email when there's a new version of Flecs

Home / v4.1.5
Name Modified Size InfoDownloads / Week
Parent folder
Flecs v4.1.5 source code.tar.gz 2026-03-15 27.7 MB
Flecs v4.1.5 source code.zip 2026-03-15 28.7 MB
README.md 2026-03-15 24.5 kB
Totals: 3 Items   56.5 MB 0

Highlights

  • New non-fragmenting hierarchy storage which significantly boosts asset hierarchy performance.
  • Reduced binary footprint of C++ component registration
  • Lots of hardening bugfixes for issues detected by the AFL fuzzer (1500 new tests since the last release!).
  • New math and Perlin noise functions for Flecs Script.
  • Added support for vector type operations in Flecs script:

    :::cpp const a = Position: {10, 20} const b = Position: {1, 2} const c: a + b // {a.x + b.x, a.y + b.y}

  • C++ API improvements:

New function to iterate all entities in the world:

:::cpp
world.each([](flecs::entity e) {
  // ...
});

System components can now be deduced from the each() argument list:

:::cpp
world.system("Move")
  .each([](Position& p, const Velocity& v) {
    // ...
  });

Improved APIs for creating hierarchies:

:::cpp
flecs::entity p = world.entity(world, "p");

// Create child for ChildOf (fragmenting) hierarchy
flecs::entity child_a = world.entity(world, p, "a");

// Create child for Parent (non-fragmenting) hierarchy
flecs::entity child_b = world.entity(world, flecs::Parent{p}, "b");

Release notes

This version includes the following bugfixes:

  • [core] Fix issue where ref could return wrong value during recursive entity cleanup.
  • [core] Fix issue with deferred calls to modified() for DontFragment components.
  • [core] Fix issue where it wasn't possible to inherit from entity with Relationship trait.
  • [core] Fix issue with cloning entity symbols.
  • [core] Fix issue with removing sparse pair with recycled target.
  • [core] Fix issue with overriding existing exclusive relationships.
  • [core] Fix issue with combining relationship constraints with component disabling.
  • [core] Return 0 for negative indices in ecs_get_target().
  • [core] Fix ecs_table_get_target() bounds check to reject negative and >=count indices.
  • [core] Fix issue with deleting sparse component while deferring is suspended.
  • [core] Fix issue with using has()/get() from hooks.
  • [core] Fix issue where deferred setting after removing on a prefab instance could fail.
  • [core] Fix issues with sparse components and overriding.
  • [core] Fix race condition in component registration code.
  • [core] Fix assert when toggling component before adding it to any entity.
  • [core] Fix issue with removing component in one stage, and setting it in another stage.
  • [core] Fix issue with determining alignment of 64bit primitive types on 32bit platforms.
  • [core] Add Prefab to children of entity after adding Prefab.
  • [core] Fix issue with entity path parsing.
  • [core] Fix issue where creating entity from path could create cycle.
  • [queries] Fix issue where queries incorrectly detected if entity variables are used before table variables.
  • [queries] Fix assert when querying for optional module.
  • [queries] Fix issue with running the same cached query on multiple threads.
  • [queries] Fix issue with DontFragment and not terms if no entities have the DontFragment component.
  • [queries] Fix issue where on_group_delete was called without matching on_group_create.
  • [queries] Fix issue with cascade and deleting empty tables.
  • [queries] Fix issue where on_group_create wasn't called for default group.
  • [observers] Fix incorrect assert in alert builder.
  • [observers] Fix issue where observer was not always called for deferred set of DontFragment component.
  • [observers] Fix issue where observers were not always called for deferred DontFragment operations.
  • [observers] Fix issue where source wasn't correctly populated for optional observer term.
  • [observers] Fix issue where OrderedChildren OnRemove observer conflicts with cleanup logic.
  • [observers] Fix cr != NULL assert in observable code.
  • [cpp] Fix try_get_mut() methods calling get_mut(), get_mut_second() with wrong return type.
  • [cpp] Fix error when ECS_STRUCT sees struct with only private members.
  • [cpp] Fix issue with enum reflection on VS 19.44.
  • [meta] Fix incorrect unit prefix for Femto unit.
  • [meta] Fix ecs_vec_fini() type mismatch in JSON deserializer.
  • [meta] Fix issue in JSON serializer where wrong pair string was appended.
  • [meta] Fix issue where JSON serializer would insert double comma for array member with unit.
  • [meta] Fix issue with deserializing opaque vector with struct element type in script.
  • [meta] Fix issue where deserializing recycled anonymous entity into world could cause duplicates.
  • [meta] Fix issue with serializing named prefab instance children before instance.
  • [meta] Fix crash when serializing query with only ChildOf term to JSON.
  • [meta] Fix issue with out-of-bounds copy in meta member parsing.
  • [meta] Don't crash on invalid recursive type definitions.
  • [meta] Don't crash on invalid string assignments in meta cursor.
  • [meta] Don't crash on invalid reflected array/vector element types.
  • [script] Fix issue in script parser with Windows line endings.
  • [script] Fix script parser corruption when creating new expression with missing entity statement.
  • [script] Fix issue where adding multiple tags inside of new expression would fail.
  • [script] Fix issue with resolving enum type in binary expressions.
  • [script] Fix script ambiguity between functions and pair syntax.
  • [script] Fix issues with tokenizing numbers that use scientific notation.
  • [script] Fix issue where opaque entity types could not be set from scripts.
  • [script] Make sure that components with on_replace hooks can be assigned from scripts.
  • [script] Fix crash when writing past the array bounds in initializers.
  • [script] Fix memory leaks on script parsing errors.
  • [script] Fix memory leaks when parsing invalid char/string literals.
  • [script] Fix issues where script error would not throw error message on the command line.
  • [script] Fix potential invalid free when copying script templates.
  • [script] Don't crash on deeply nested script scopes.
  • [script] Don't crash on missing entity for variable component evaluation.
  • [script] Fix double-free in script template using cleanup.
  • [script] Fix issue with dereferencing code pointer after parsing invalid comment.
  • [script] Improve robustness of whitespace/comment parsing.
  • [script] Improve robustness of script number parsing.
  • [script] Improve robustness of script comment parsing.
  • [script] Improve robustness of script visitor depth handling.
  • [script] Improve robustness of script recursion depth handling.
  • [script] Harden tokenizer bounds checks for malformed script tokens.
  • [script] Handle trailing escape in script identifiers.
  • [rest] Fix issue where emscripten build fails without REST addon.
  • [rest] Remove duplicate line in rest addon (thanks @ludolpif!).
  • [rest] Fix issue where build info wasn't accessible for REST API.
  • [rest] Fix crash when using stats module in low footprint mode.
  • [http] Bugfixes for HTTP server and strbuf.
  • [os_api] Fix issue with printing stack trace on Windows.
  • [os_api] Fix potential crashes where string variables were passed to format string arguments of assert macros.
  • [os_api] Fix crash in assert if entity name with mismatching template delimiters is also an invalid format string.

This version includes the following improvements:

  • [core] New non-fragmenting hierarchy storage.
  • [core] Detect cycles in prefab instantiation code.
  • [core] Don't allocate diff builder in flecs_defer_end() if there are no batched commands.
  • [core] Don't add unnecessary symbols to builtin tags and entities.
  • [core] Prevent unused allocator chunks by not recycling table columns.
  • [core] Use OS allocator for allocating table component/column map.
  • [core] Refactor duplicated hook logic to new type_info API.
  • [core] Enforce that hooks cannot be called if it has a corresponding INVALID flag set.
  • [core] Remove doc components from core entities.
  • [core] Remove Private tag.
  • [core] Allow ecs_get_target() to be used with value pairs.
  • [cpp] Call init_builtin_components() at the end of world reset (thanks @60k41p!).
  • [cpp] Implement world.each([](flecs::entity e) {}) method for iterating all entities.
  • [cpp] Infer system type from function argument list passed to each().
  • [cpp] Reduce the binary overhead of component registration (1).
  • [cpp] Reduce the binary overhead of component registration (2).
  • [cpp] Update more parts of the API to C++17.
  • [cpp] Add component tuple getters (thanks @SimonPiCarter!).
  • [cpp] Add const qualifier to more C++ methods.
  • [cpp] Add convenience functions for creating hierarchies.
  • [queries] Add ecs_query_get_groups() function.
  • [queries] Make query_base constructor const (thanks @Reddy-dev!).
  • [queries] Allow components to be referred to by typename in query DSL.
  • [observers] Allow for creation of observers without creating entities.
  • [systems] Add validation check on whether system .callback or .run is set.
  • [systems] Add dedicated phase member to ecs_system_desc_t.
  • [systems] Implement set_group() for systems.
  • [meta] Implement cycle detector for reflection framework.
  • [meta] Prevent modifying reflection data after component has been used.
  • [meta] Update meta utils macros so types can be used with forward declarations.
  • [meta] Don't create member entities for ECS_STRUCT definitions.
  • [meta] Don't require creating entities for struct members.
  • [meta] Don't create member entities when using C++ component::member API.
  • [meta] Skip recursive runtime type struct member hooks.
  • [script] Add perlin noise and other math functions to Flecs script.
  • [script] Implement binary vector operations.
  • [script] Add dot(), normalize(), length(), length_sq() to script math.
  • [script] Reject singleton kind on non-singleton script entities.
  • [rest] Implement type_info endpoint.
  • [journal] Fix issue where journaling output would write ecs_new_id() instead of ecs_new().
  • [journal] Add support for tracing value pairs.
  • [journal] Add operation counter to journaling traces, API for getting counter.
  • [stats] Add prefab child indices to memory stats, cleanup table memory stats.
  • [stats] Don't automatically import the units addon when importing stats.
  • [docs] Add missing comments to Flecs headers.
  • [docs] Fix incorrect comments in term builder header.
  • [docs] Fix API doc comments for type_index()/column_index().
  • [docs] EntitiesComponents.md fixes (thanks @ludolpif!).
  • [docs] Fix component inheritance example in query manual.
  • [docs] Update examples in Hierarchy manual to use new API.
  • [docs] Update outdated example in relationship manual.
  • [docs] New Hierarchy manual.
  • [ci] Prevent CI from triggering twice when creating a PR.
  • [ci] Remove clang 11/12 from CI.

Breaking changes:

  • [core] delete_all() and remove_all() no longer affect prefab entiites
  • [meta] Registering reflection data for structs no longer by default creates entities for members
  • [meta] Modifying reflection data for runtime types is no longer allowed after the type has been instantiated

New Contributors

Full Changelog: https://github.com/SanderMertens/flecs/compare/v4.1.4...v4.1.5

Source: README.md, updated 2026-03-15