flecs

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

MIT License

Stars
5.5K

Bot releases are hidden (Show)

flecs - Flecs v3.0.4

Published by SanderMertens about 2 years ago

This version includes the following bugfixes:

  • Fixed issue where system created with each was not automatically instanced
  • Fixed copy/paste error in term::read function that set the wrong inout kind
  • Fixed issue that prevented deferring an emplace with types that had no default ctor
  • Fixed issue that prevented on_add hook to be called for emplace
  • Fixed issue where move_ctor wasn't called when merging deferred emplace
  • Fixed issue where fps or thread count was overwritten when calling ecs_app_run
  • Fixed issue where name prefix wasn't reset after bootstrap
  • Fixed issue where union relationship wasn't properly initialized for prefab child
  • Fixed various issues with using mingw
  • Fixed wrong escaping of pipe symbol in documentation
  • Fixed issues with enum reflection on clang and Windows
  • Fixed issue with instantiating prefab children that are associated with root type
  • Fixed issue where name lookup would fail after resetting name to NULL

This version includes the following improvements:

  • Added constructor to flecs::query for creating named queries
  • Rewrote outdated parts of "designing with flecs"
  • Improved performance of ecs_count_id
  • Improved performance of queries/observers that do relationship traversal
  • Added query section to relationship manual
  • Stats addon types now use customizable float type (ecs_float_t)
  • Improved error message when using union relationship in C++ query signature
  • Added overload for set_override where 1st element of pair is a tag
  • Improved conversion logic of meta cursor API
  • Improved documentation of ecs_new_id / ecs_new_low_id
  • Updated outdated JSON examples
  • Added entity::get_mut_second
  • Improved performance of ecs_set

Known issues:
https://github.com/SanderMertens/flecs/issues/765
https://github.com/SanderMertens/flecs/issues/714
https://github.com/SanderMertens/flecs/issues/620
https://github.com/SanderMertens/flecs/issues/478
https://github.com/SanderMertens/flecs/issues/314

flecs - Flecs v3.0.3

Published by SanderMertens about 2 years ago

This version includes the following bugfixes:

  • Fixed bug where constructor was not called for explicitly registered component in multi world C++ application
  • Fixed bug with change detection and queries with OR terms

This version includes the following improvements:

  • Fixed broken links and typos in documentation
  • Added links to demos and blogs to README
  • Remove redundant includes
  • Remove redundant assignment in sparse set code
  • New group_by example

This version includes the following new features:

Breaking changes:

Known issues:
https://github.com/SanderMertens/flecs/issues/765
https://github.com/SanderMertens/flecs/issues/716
https://github.com/SanderMertens/flecs/issues/714
https://github.com/SanderMertens/flecs/issues/620
https://github.com/SanderMertens/flecs/issues/478
https://github.com/SanderMertens/flecs/issues/314

flecs - Flecs v3.0.2

Published by SanderMertens about 2 years ago

This version includes the following bugfixes:

  • Fixed symbol export issues when using reflection convenience macro's like ECS_STRUCT
  • Fixed bug that prevented inheriting from entities with a symbol identifier
  • Fixed issue that could cause crash when creating tables with OVERRIDE or TOGGLE

This version includes the following improvements:

  • Improved error messages when using stage outside of readonly context
  • Several improvements that enable interop between C modules and C++
  • Added more prefab examples
  • DontInherit property is now respected when instantiating prefab children
  • Transfer ownership of world to app framework in C++ so it can be used in webasm builds

This version includes the following new features:

Known issues:
https://github.com/SanderMertens/flecs/issues/765
https://github.com/SanderMertens/flecs/issues/716
https://github.com/SanderMertens/flecs/issues/714
https://github.com/SanderMertens/flecs/issues/620
https://github.com/SanderMertens/flecs/issues/478
https://github.com/SanderMertens/flecs/issues/314

flecs - Flecs v3.0.1

Published by SanderMertens about 2 years ago

This version includes the following bugfixes:

  • Fixed issue where calling set with a new pair in a multithreaded app could assert
  • Fixed issue where linking Flecs as static library would cause unresolved symbol errors
  • Fixed issues in cmake files for examples

This version includes the following improvements:

  • Union relationships are now serialized as regular relationships by the JSON serializer
  • Added README on how to run examples

Known issues:
https://github.com/SanderMertens/flecs/issues/765
https://github.com/SanderMertens/flecs/issues/716
https://github.com/SanderMertens/flecs/issues/714
https://github.com/SanderMertens/flecs/issues/620
https://github.com/SanderMertens/flecs/issues/478
https://github.com/SanderMertens/flecs/issues/314

flecs - Flecs v.3.0.0

Published by SanderMertens about 2 years ago

Flecs 3 is out! 🎉

This is a major release with many new features, improvements, bugfixes and breaking changes. Enjoy!

Release Notes

See the release announcement:
https://ajmmertens.medium.com/flecs-3-0-is-out-5ca1ac92e8a4

Upgrading to v3

If you are upgrading from v2.4.8, see this discussion for a list of breaking changes:
https://github.com/SanderMertens/flecs/discussions/466

If you are upgrading from a later version, look for the date of your last commit, and use that as starting point in the discussion.

Known issues

https://github.com/SanderMertens/flecs/issues/776
https://github.com/SanderMertens/flecs/issues/765
https://github.com/SanderMertens/flecs/issues/716
https://github.com/SanderMertens/flecs/issues/714
https://github.com/SanderMertens/flecs/issues/620
https://github.com/SanderMertens/flecs/issues/478
https://github.com/SanderMertens/flecs/issues/314

flecs - Flecs v3.0.2-beta

Published by SanderMertens over 2 years ago

This release will be almost functionally equivalent to the initial Flecs v3 release, but is tagged before v3 renaming (see https://github.com/SanderMertens/flecs/discussions/728).

Use this release if you want to use v3 features, but want to hold off on fixing breaking changes as a result of renaming.

If you are upgrading from an older (v2) release, see this discussion for a list of breaking changes when upgrading: https://github.com/SanderMertens/flecs/discussions/466

flecs - Flecs v.2.4.8

Published by SanderMertens almost 3 years ago

This version includes the following bugfixes:

  • Fix index in query table cache when table is unmatched
  • Fixed group_by signature

This version includes the following improvements:

  • Add const variants to flecs::ref

Known issues:
https://github.com/SanderMertens/flecs/issues/569
https://github.com/SanderMertens/flecs/issues/701

flecs - Flecs 2.4.7

Published by SanderMertens about 3 years ago

This version includes the following bugfixes:

  • fixed issue where OnSet system would trigger for the wrong wildcard pair
  • fixed issue where observer would trigger for the wrong wildcard pair
  • fixed issue where observer would trigger for the wrong entity

Known issues:

  • UnSet systems with wildcards only trigger for one matching component (addressed in v3)

Note that this is a v2 release that is behind master! Only use this if you cannot migrate to v3 or need API stability

flecs - Flecs v3.0.1-alpha

Published by SanderMertens about 3 years ago

This is the first v3.0 alpha release. This release gets rid of deprecated features, simplifies the API and code structure, and has a number of internal improvements. For a list of changes, see:
https://github.com/SanderMertens/flecs/discussions

This is the first of a number of v3.0 alpha releases that may have breaking API changes. If you need a stable API, use the last stable 2.4 release:
https://github.com/SanderMertens/flecs/releases/tag/v2.4.6

Known issues:

  • cmake file for examples needs to be updated
flecs - Flecs 2.4.6

Published by SanderMertens about 3 years ago

This version includes the following bugfixes:

  • Fixed potential memory corruption when using switch columns
flecs - Flecs 2.4.5

Published by SanderMertens about 3 years ago

This version includes the following improvements:

  • Added comment to amalgamated file to remove flecs_STATIC when using as DLL

This version includes the following bugfixes:

  • Fix issue with moving filters in C++ API
  • Fix issue with creating snapshots from stage
  • Fixed std::is_empty() typo in C++ iterator code
flecs - Flecs 2.4.4

Published by SanderMertens about 3 years ago

This version includes the following improvements:

  • Added overview diagram to quickstart

This version includes the following bugfixes:

  • Fix issue with using term() after arg() in filter builder
  • Fix memory leak when registering entity twice for the same alias with ecs_use
flecs - Flecs 2.4.3

Published by SanderMertens about 3 years ago

This version includes the following improvements:

  • Include tracing level 1 by default in release builds
  • Added function (ecs_tracing_color_enable) to disable colors in tracing

This version includes the following bugfixes:

  • Fixed issue with queries and large numbers of terms
  • Fixed issue with registering namespaced components with explicit ids (entity::component<T>)
  • Fixed issue with emplace on entities with non-trivial component destructors
  • Fixed issue that prevented enabling tracing in release mode
flecs - Flecs 2.4.2

Published by SanderMertens about 3 years ago

This version includes the following improvements:

  • Enabled filter builder to create filters with any number of terms

This version includes the following bugfixes:

  • Fixed issue with creating filters with more than 8 terms
  • Fixed issue with creating filter & term iterators from a stage
  • Fixed issue with using ecs_get_object (and ecs_get_parent) from stage
flecs - Flecs 2.4.1

Published by SanderMertens about 3 years ago

This version includes the following bugfixes:

  • Fixed issue with resolving shared component entity when entity has more than one base
  • Fixed issue with getting switch case when in staged mode
flecs - Flecs 2.4

Published by SanderMertens about 3 years ago

Finally! 🎉

The highlights of the release are:

  • The first feature-complete implementation of entity relationships in any ECS framework
  • Removal of dependency on STL data structures, improving compile times & reducing API footprint
  • New sokol-style creation functions in C API for entities, components, queries, systems and more
  • New fluent-style builder classes in C++ for creation of queries, systems and more
  • A new and improved query DSL (domain specific language) with full support for custom relationships
  • Improved features for responding to events with triggers & observers
  • A novel search data structure for archetypes & relations which speeds up things across the board:
    • Filters evaluate much faster, even though they can be much more complex than before
    • Improved speed of matching tables to queries
    • Operations like ecs_get, ecs_has and get_object are now constant time
    • Improved performance of scope iterators
    • Improved performance of fetching components from base entities & instantiating from base entities
    • Improved performance of ecs_lookup family of functions

Breaking changes:
This release introduces a number of minor breaking changes when compared with the last 2.3.2 release. A non-exhaustive lists of breaking changes is provided here and may be extended later:

  • The EcsName component is changed to an EcsIdentifier relation which is instantiated with EcsName and EcsSymbol tags
  • Component destructors are now called on the source component after moving between archetypes
  • The ecs_get_object function no longer accepts a component to find an object for a relation, but an index to find the nth object for a relation
  • The group_by callback signature have been modified to allow for a context
  • The system/query APIs have been updated to a fluent-style builder pattern
  • The C++ API no longer uses STL data structures, which in practice means that code that relied on functions returning an std::string may have to be updated.
  • Most legacy syntax constructs of the query DSL have been removed
  • Removal of CHILDOF and INSTANCEOF roles (use the builtin ChildOf and IsA relations instead)
  • include and exclude filter fields are no longer supported (use new filter API)
  • entity::each(Func&&) now expects a function that accepts a flecs::id instead of a flecs::entity

This was a large release! A few random facts:

  • Flecs met its first sponsorship goal! ❤️
  • 380 commits since the last release
  • Over 2200 commits since the beginning of the project
  • The Discord server grew to almost 600 users 🎉
  • Close to 400 new stars were added to the project ⭐
  • A little more than a year has passed since the first v2.0 release
  • Almost a 100 closed PRs and issues in this release alone:
    • PRs contributed by @randy408, @aganm, @mason-bially, @ikrima, @SpaceIm, @Hexlord, @shanehyde, @Zalron, @nasso and @Wesxdz
    • Issues opened by @SpaceIm, @JonSnowbd, @randy408, @artgreen, @mjjq, @Hexlord, @codylico, @BHolman-LBI, @jtferson, @shanehyde, @cshenton, @Josid88, @jon-turney, @Jarodwr, @HenryFalconerIO, @tedajax, @Zalron, @domdom, @KenthJohan and @zaklaus
    • Thanks everyone! 🙏

I'm skipping the full list of features/improvements/bugs for now as it's a lot, may add it later.

For the next 2 - 3 months the master branch will be used to migrate to the v3 APIs. If you need API stability, stay on the last v2 release until the official v3 release. There will be intermediate releases that allow for a more gradual upgrade path to the new v3 APIs.

flecs - Flecs 2.3.2

Published by SanderMertens over 3 years ago

This release introduces a breaking change to fix C++ component registration. The symbol member of the EcsName (or flecs::Name) component now requires an allocation. If you explicitly assign members to the EcsName component (using get_mut, not using set) you will have to update your code.

Another change that was introduced to fix component registration is that the symbol member of the EcsName component for a module now always contains the fully qualified path to the entity. Previously this value contained the C or C++ typename, but this caused issues with module interop between C and C++. If your code relied on looking up modules by their C typename and not the fully qualified name, code will have to be updated.

This release contains the following improvements:

  • replace iostream with initializer_list (C++ API, thanks @ikrima!)
  • ensure entity::m_id is initialized to 0 (C++ API, thanks @ikrima!)
  • use ecs_os_malloc instead of new (C++ API, thanks @ikrima!)
  • remove superfluous copies of lambda functions (C++ API, thanks @ikrima!)
  • add CHANGELOG (thanks @ikrima!)

This release contains the following bugfixes:

  • fix matching for queries with shared componnents when base entity is deleted
  • fix various issues with component registration in C++
  • fix issue with setting target FPS on Apple M1 (thanks @prime31!)
  • fix issues with CMake file (thanks @SpaceIm!)
  • fix crash when creating & deleting queries
  • guarantee that id returned by new_component_id is unused
flecs - Flecs 2.3.1

Published by SanderMertens over 3 years ago

This version contains the following improvements:

  • Improved lerp example
  • Added OS API example C++ (thanks @mcmlevi!)
  • Upgraded cmake buildfiles (thanks @rawbby!)
  • Clarified text in README describing API/ABI stability

This version contains the following bugfixes:

  • Fix crash when using overlapping UnSet systems
  • Fix issue with passing incorrect row to UnSet systems
  • Added .hpp files to cmake install
  • Fixed issue with using get_mut with traits
flecs - Flecs v2.3

Published by SanderMertens almost 4 years ago

Highlights:

  • Big performance improvements & reduced memory usage for applications with lots of tables, such as when using hierarchies
  • Component enabling/disabling allows for quick component mutations without moving entities between archetypes
  • New statistics addon for retrieving metrics from running world (replaces stats module)

Thanks to @randy408, @sh-dave, @kevinresol, @jasonliang-dev and @Alexandre-P-J for submitting PRs! 🎉

Thanks to @ikrima and @jtferson for writing two awesome testimonials on using Flecs with Unreal Engine 4 🙏 :

Thanks to the new Flecs sponsors ❤️ :

  • @Zifkan
  • @TFlippy
  • @Hexlord

Breaking changes:

  • calling ecs_get for a tag will no longer return NULL, but will assert
  • statistics module is removed in favor of easier to use statistics addon
  • unused table_offset member is removed from iterator

Deprecated features:

  • ecs_entity() macro is now deprecated, use ecs_typeid()

This version includes the following features:

  • Direct access addon, which provides fast access to underlying storage
  • Added singleton API to C++ world class
  • Added orphaning for subqueries, which allows an application to check if a parent query still exists
  • Added ecs_get_typeid function to get the component id for traits
  • The type used for time keeping is now customizable
  • New statistics addon for retrieving metrics from running world
  • Added get_parent function that accepts entity/tag
  • Added component enabling/disabling
  • Added support for sorting on shared components

This version includes the following improvements:

  • Improved ecs_delete performance (reduced entity index accesses from 2 to 1)
  • C & C++ code compiles warning-free with more warning flags, for more compiler versions & more platforms
  • Improved error messages when application passes invalid entity id
  • Made include paths relative so source code is easier to integrate with bazel
  • Fixed typos in documentation
  • Improve error message when trying to add 0 as base entity (using ECS_INSTANCEOF)
  • Add check for conflicting source modifier in OR expressions
  • Extended documentation, added new examples and fixed typos
  • Removed dead/redundant code
  • Improved performance of ecs_get
  • Add sanitizer & custom builds to CI, remove Travis CI builds
  • Don't add Name component when provided name for entity is NULL
  • Allow flecs::system instances to be (re)created from entity id
  • Added godbolt "try online" badge to README
  • Improve allocation strategy of vector datastructure
  • Improved performance for checking if entity id is a number
  • Added missing query functions to C++ API for sorting
  • Improved performance of table creation by two orders of magnitude
  • Reduced memory footprint of table graph by a factor 60
  • Added example to demonstrate world merging with direct access API
  • Added more inline documentation for datastructures
  • Added assert when trying to instantiate child as instance
  • Improve errors when invalid operation is invoked on iterator
  • Throw assert when invoking ecs_modified on entity that does not have the component
  • Allow for type lookups in systems, as long as the type already exists
  • Add return types to ecs_defer_begin and ecs_defer_end to obtain defer status of world
  • Remove redundant table_offset member from ecs_iter_t
  • Improved portability of POSIX OS API example

This version includes the following bugfixes:

  • Fixed issues with subqueries and query rematching
  • Corrected wrong return type of ecs_column_size (was ecs_entity_t, is now size_t)
  • Add missing \0 when appending to application buffer with strbuf datastructure
  • Fixed crash when instantiating an empty prefab
  • Fixed issue with shared tags and queries using each() in the C++ API
  • Fixed issue with instantiating empty child table
  • Fixed issue with ecs_bulk_new and traits
  • Fixed issue when using ecs_entity_str with small buffers
  • Fixed bug when adding trait to entity with switch
  • Fixed name conflicts in amalgamated source
  • Fixed path lookup in ecs_import
  • Fixed EXPORT macro's in OS API examples
  • Fixed issue with restoring worlds that have recycled ids
  • Added missing EXPORT macro's to API functions
  • Fixed assert after deleting entities from restored world
  • Removed obsolete assert from ecs_modified
  • Added missing statement to finalize system in C++
  • Fixed issues with removing case values
  • Fixed issues in C++ API with implicit component registration
  • Fixed assert when removing from switch list
  • Fixed bug where obtaining type from entity would generate a new entity id
  • Fixed incorrect description of ecs_delete in manual
  • Fixed issues with custom builds
flecs - Flecs v2.2

Published by SanderMertens about 4 years ago

Highlights:

  • Big performance improvement for operations called from systems
  • Entity liveliness tracking (entities are now annotated with a generation)
  • New APIs for deferring operations, singletons and simpler system callbacks (C++)

Deprecated features:

  • The action method in C++ should no longer be used for systems. Use iter instead.
  • EcsSingleton and flecs::Singleton are deprecated. Use new singleton API instead
  • The is_shared function in the flecs::iter class is deprecated. Use is_owned instead.

Breaking changes

  • Query columns that are not owned are now [in] by default. This may cause the API to throw an assert (in C++) or ecs_is_readonly to return a different value (in C). To fix issues caused by this change, add const to the column type, or annotate the column with [inout] or [out].
  • Doing an operation on a deleted entity id may now throw an assert.

Thanks to @ikrima, @randy408 and @nbrk for submitting PRs! 🎉

This version includes the following features:

  • Add ecs_clear API which removes all components without deleting the entity
  • Keep track of entity lifecycle with generation counting
  • New type role that enables automatic overriding of components for base/prefab entities
  • Create an alias for entity/component names to shorten string-based queries
  • New API for deferring actions
  • New staging implementation that uses deferred actions for better performance
  • Added ecs_is_alive which tests if an entity has been deleted
  • Added ecs_exists which tests if an entity id is currently in use (ignoring generation)
  • Add new singleton API
  • Add macro's for defining global component variables in C

This version includes the following improvements:

  • Recursively delete child entities when deleting a parent
  • Add function to enable tracing to C++
  • Add time_scale function to C++
  • Disallow overwriting component lifecycle actions
  • Improved checks for invoking operations on non-initialized classes
  • Improvements to C++ flecs::vector wrapper
  • Introduces iter() which is an easier to use alternative to action()
  • Added simplified FOR syntax for trait queries
  • Add is_owned to iterator class in C++
  • Treat empty structs in C++ as tags
  • Allow dereferencing shared column with [0] in C++
  • Add enabled() function to entity class
  • Queries now prefetch column types so there is no accidental table creation when iterating
  • Make [in] default for columns that are not owned
  • Add function to get column by name
  • Detect registering component with a different name in C++

This version includes the following bugfixes:

  • Fix issues when application includes stdbool
  • Don't crash if system is redefined with NULL signature
  • Fix issues with registering builtin components in C++
  • Fix issues with re-registering entities with the same name
  • Fix bug where child would sometimes be created for the wrong parent
  • Add missing ANY modifier to C examples
  • Fixed issue with registering components across translation units
  • Add assert when ecs_merge is called when world is progressing
  • Fixed issue where moving world could cause double destruction in C++
  • entity::set no longer takes const rvalue which prevented moves
  • Fixed bug where moving an entity would sometimes call destruct on the wrong component
  • Don't automatically add ctor if other lifecycle actions are NULL
  • ecs_os_api_strdup incorrectly used ecs_os_api_malloc instead of overrided malloc
  • Only resolve entity as numeric id if the entire string is a number
  • Fix including alloca header in FreeBSD
  • Fixed incorrect parsing of trait expression with SHARED modifier in signature
  • Fixed bug with obtaining shared trait columns
  • Fixed bug with querying for component trait
  • Ensure that owned component is never passed to shared column and vice versa
  • Fixed bug with rematching queries that have optional fields
  • If a prefab was an instance from a base prefab, the children of the base would not be created as prefabs
  • Deleting a table in the table graph did not update edges of connected tables
  • Queries were sometimes registered twice with the same table
  • Fixed crash when attempting to delete empty child table
  • Remove query from table administration when unmatching
  • Parent entity was not deleted from child tables administration when deleted
  • Removed assert when attempting to remove a key from an empty map
  • Fix bug where is_monitored bit would not be transferred when moving / swapping an entity
  • Fixed component names memory leak in C++ API