2x faster trivial set() calls (no hooks, observers or change detection)
5x faster trivial modified() calls (no hooks, observers or change detection)
3x faster prefab instantiation due to new component overriding design
Lots of reflection improvements for arrays, vectors and enums with custom underlying types
Lots of explorer improvements (better autocomplete, drag-to-change values in inspector, pane resizing, script saving and more!)
New script features that introduce more flexible ways to refer to entities:
// Create anonymous entity that is referred to later (previously impossible)
const alice: new {
Position: {10, 20}
}
bob {
// Alice variable can now be used without $ prefix
(Likes, alice)
}
for i in 0..10 {
"spaceship_{i}" { }
"shuttle_{i}" {
// Interpolated strings can now also be used in component/pair expressions
(DockedTo, "spaceship_{i}")
}
}
Release notes
This version includes the following bugfixes:
[cpp] Don't move lvalue during component assignment (thanks @ColoredCarrot!)
[cpp] Fix issue where flecs::Script component couldn't be used when defining FLECS_CPP_NO_AUTO_REGISTRATION
[core] Fix issue where component hooks were not correctly called on world.shrink()
[core] Fix fatal assert with OrderedChildren test in release mode
[core] Fix issue where .get<Rel>(Wildcard) did not work for sparse components
[core] Fix issue where children weren't correctly populated for instance of prefab with OrderedChildren
[observers] Fix issue where ecs_field_is_set didn't work for single term observers
[queries] Fix issue where queries sometimes returned entities with NotQueryable tag
[meta] Fix issues with deserializing inline arrays and vectors
[meta] Fix issue in cursor API where it assumed int32_t for underlying enum type
[meta] Fix issues with serializing enums with custom underlying type
[rest] Fix issue where REST API would not restore correct log function after endpoint
[script] Fix crashes when using script annotations for invalid targets
[script] Fix "can't serialize" errors when serializing script AST
[script] Fix issue where value of script variable was incorrectly cached
[script] Fix incorrect type check for component expressions used in initializer
This version includes the following improvements:
[cpp] Implement type traits in library to support older versions of gcc (thanks @AnonimiAngels!)
[cpp] Implement world::id_if_registered method
[cpp] Implement world::type_info()
[cpp] Remove redundant FLECS_META check for to_constant()
[cpp] Make world::to_json() methods const
[cpp] Allow using APIs that accept enum constants in builds with FLECS_CPP_NO_ENUM_REFLECTION
[core] Implement ecs_table_has_traversable() function
[core] Implement on_replace hook
[core] Don't emit OnSet events for operations when there are no hooks/observers
[core] Improve performance of set/ensure/emplace
[core] Remove redundant cr field from command struct
[core] Improve error messages
[core] Add checks that prevent making invalid modifications to core entities
[core] Change table_record_t.hdr.cache type to ecs_component_record_t
[core] Improve performance of component overriding
[core] Remove redundant New command
[core] Add new size argument to ecs_emplace_id and ecs_ensure_id
[core] Implement new Singleton trait
[core] Add more ecs_ref_t tests
[core] Turn setting both FLECS_DEBUG/NDEBUG error into warning
[core] Assert when passing alive ids to .entities member of ecs_bulk_desc_t
[meta] Split up push serializer operation into struct, array, vector
[meta] Split up opaque type serializer operation into value, struct, array, vector
[meta] Add underlying_kind field to serializer operation for serializing enums
[meta] Add constants field to serializer operation for serializing enums/bitmasks
[meta] Change meaning of ecs_member_t::count so that it's interpreted as inline array when >= 0
[meta] Split off constants member from EcsEnum/EcsBitmask into separate EcsConstants component
[meta] Split up meta addon code into smaller files
[json] Don't serialize schema to JSON for none fields
[script] Add script tests for CRLF line endings
[script] Don't reset script code for managed scripts after error
[docs] Remove outdated section on pipelines from system manual
[docs] Add Gloam vault to README
[docs] Fix source documentation for is_alive()/is_valid()
[docs] Fix query section in design with flecs manual
[docs] Fix broken link in quickstart (thanks @ZaddikDev!)
[docs] Add custom_serializer example
[docs] Fix issues in queries and prefab manual (thanks @Chetco!)
[docs] Fix outdated examples in change detection section of query manual
[docs] Update incorrect is_enabled to enabled in manuals (thanks @ericjeker!)
[docs] Add hooks section to entities and components manual
Breaking changes:
ecs_emplace_id and ecs_ensure_id now accept an additional size argument: https://github.com/SanderMertens/flecs/discussions/466#discussioncomment-13772378
The singleton API has been changed to use a component trait: https://github.com/SanderMertens/flecs/discussions/466#discussioncomment-13772399
Script evaluation APIs now have a result argument for capturing errors: https://github.com/SanderMertens/flecs/discussions/466#discussioncomment-13836575
Inheritance statements in flecs script now require a scope: https://github.com/SanderMertens/flecs/discussions/466#discussioncomment-13880921
The serializer data structures have been updated to allow for vector deserialization, enums with underlying types and more: https://github.com/SanderMertens/flecs/discussions/466#discussioncomment-13998587 and https://github.com/SanderMertens/flecs/discussions/466#discussioncomment-14194407
New Contributors
@AnonimiAngels made their first contribution in https://github.com/SanderMertens/flecs/pull/1714
@niceEli made their first contribution in https://github.com/SanderMertens/flecs/pull/1731
@ZaddikDev made their first contribution in https://github.com/SanderMertens/flecs/pull/1734
@ColoredCarrot made their first contribution in https://github.com/SanderMertens/flecs/pull/1715
@Chetco made their first contribution in https://github.com/SanderMertens/flecs/pull/1754
@ericjeker made their first contribution in https://github.com/SanderMertens/flecs/pull/1768
Full Changelog: https://github.com/SanderMertens/flecs/compare/v4.1.0...v4.1.1