Skip to content

Flecs v4.0.5

Latest
Compare
Choose a tag to compare
@SanderMertens SanderMertens released this 18 Mar 05:09
· 76 commits to master since this release
3b0ca37

Happy GDC! πŸ‘Ύ

Highlights

  • Many changes that reduce memory utilization and binary footprint!
  • Flecs now has more than 10.000 tests ran on every commit βœ…
  • 30-50% performance improvement for get/get_mut/has/owns on clang & gcc when using LTO πŸš€
  • New APIs to work directly with internal data structures for building fast custom ECS operations

Release notes

This version includes the following bugfixes:

  • [cpp] Fix issue with assigning flecs::Component to implicitly registered tags and prefabs
  • [cpp] Fix query copy ctor/assign for default constructed queries (thanks @Thinkofname!)
  • [cpp] Fix ambiguous methods for enum types (thanks @Reddy-dev!)
  • [cpp] Use correct world in term_builder_i::singleton() (thanks @BeanCheeseBurrito!)
  • [cpp] Fix issue with using .field_at when using .with<T>() where T is sparse
  • [cpp] Fix assert in ecs_cpp_trim_module when component name overlaps with module
  • [cpp] Fix issue where entity::remove could not be used to remove enum components
  • [cpp] Fix race condition in enum reflection code
  • [core] Fix issue with batched set commands and inherited components
  • [core] Fix compilation error with stray FLECS_API annotations in source files
  • [core] Fix issue with instantiating prefab with union relationship while deferring is suspended
  • [core] Fix shift overflow for events with large (>64) numbers of components
  • [core] Fix issue with command queue that contains both recycled id and old id
  • [core] Fix use after free when FLECS_USE_OS_ALLOC is defined
  • [core] Fix invalid read for table with many flag/pair ids
  • [core] Fix memory leak in the entity index (thanks @jpeletier!)
  • [core] Fix ubsan error where offset was applied to NULL
  • [queries] Fix issue with queries matching (ChildOf, 0) when iterating component ids
  • [queries] Fix issue with cached queries and up traversal
  • [queries] Fix crash when using iter::get_var on chained iterators
  • [observers] Fix issue in observer event forwarding code where source was incorrectly set
  • [observers] Fix issue when using LOG_LEVEL_3 in release mode
  • [observers] Fix issue with observers that have a fixed entity source
  • [observers] Fix issue with two observers with run actions where one could prevent the other from running (thanks @Thinkofname!)
  • [observers] Fix issue where observers could get registered multiple times for same event
  • [observers] Fix issue with observers that have terms with a variable source
  • [pipelines] Fix issue where sync point wasn't inserted for InOutNone terms
  • [meta] Fix issue where member with _ name was not created in struct (thanks @GsLogiMaker!)
  • [json] Fix issue in JSON deserializer when skipping missing component
  • [meson] Add missing addons/app.c to meson.build (thanks @justinian!)

This version includes the following improvements:

  • [cpp] Add flecs::ref::component() method
  • [cpp] Fix warning in enum.hpp (thanks @jpeletier!)
  • [cpp] Allow specifying underlying type for constants with template parameter (thanks @Reddy-dev!)
  • [cpp] Support using enum reflection without requiring FLECS_META addon
  • [cpp] Add FLECS_CPP_NO_ENUM_REFLECTION flag
  • [cpp] Add path separator argument to flecs::entity constructor
  • [cpp] Reduce memory footprint of component registration
  • [cpp] Add support for type checked .term_at<T> and .term_at<T>(i) (thanks @deathbeam!)
  • [cpp] Add support for untyped references (thanks @jpeletier!)
  • [cpp] Use low ids for untyped components (thanks @Reddy-dev!)
  • [core] Improve performance of ecs_ref_get / flecs::entity::get_ref
  • [core] Improve performance of ecs_delete_empty_tables
  • [core] Make functions to suspend/resume readonly mode public again for language bindings
  • [core] Add fields to support debug (natvis) visualization
  • [core] Remove redundant component record flags
  • [core] Add new Inheritable trait to indicate in advance a component will be inherited from
  • [core] Store entities without components in root table
  • [core] Don't retain large allocations in block allocator
  • [core] Remove entry_allocator field from maps
  • [core] Pack ecs_map_t fields to reduce footprint
  • [core] Reduce footprint of ecs_id_record_t, ecs_table_t
  • [core] Simplify command batching logic by removing redundant guarantee
  • [core] Implement ecs_shrink/world::shrink method that frees unused memory
  • [core] Add always_inline annotation to performance critical functions
  • [core] Expose internal APIs to work with ecs_component_record_t and ecs_table_record_t
  • [queries] Reduce number of block allocators for cached queries
  • [queries] Change default cache policy to cached when query has cascade term
  • [queries] Add compiler flag to change default query caching policy to uncached
  • [meta] Implement equals/compare type hooks (thanks @jpeletier!)
  • [meta] Add opaque serializer callbacks for members and elements (thanks @jpeletier!)
  • [script] Split off parser and query DSL code from FLECS_SCRIPT addon
  • [script] Add support for parsing binary and hex base numbers
  • [allocators] Remove redundant block_tail member from block allocator
  • [os api] Add support for cosmo compiler (thanks @bnjmnjrk!)
  • [docs] Add links to new jellycake youtube tutorials
  • [docs] Remove outdated emplace documentation from C++ API
  • [docs] Add SDL3 example project to documentation page
  • [docs] Update link to Zig binding in README
  • [docs] Bazel docs update that reflects improvements in renovate (thanks @reutermj!)
  • [docs] Remove incorrect statement about Final trait from component traits manual
  • [docs] Improve API documentation for binding support functions
  • [docs] Fix formatting of code segment in quickstart (thanks @theaveasso!)
  • [ci] Fix typo in Allocator.c
  • [ci] Add missing enum tests to cpp/project.json (thanks @BeanCheeseBurrito!)
  • [ci] Add missing reference tests to cpp/project.json (thanks @jpeletier!)
  • [ci] Remove clang-13 from CI builds
  • [ci] Add emscripten build to CI (thanks @zelosleone!)

Breaking changes:

  • flecs.meta.constant has moved to flecs.core (#466 (comment))
  • Entities without components are now stored in a table (#466 (comment))
  • Specifying a component with query_builder::with now uses InOutDefault (previously InOutNone, #466 (comment))
  • flecs::entity::remove has changed to enable removing enum components (#466 (comment))

New Contributors

Full Changelog: v4.0.4...v4.0.5