Flecs v4.1.1
Highlights
- 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 whereflecs::Scriptcomponent couldn't be used when definingFLECS_CPP_NO_AUTO_REGISTRATION[core]Fix issue where component hooks were not correctly called onworld.shrink()[core]Fix fatal assert withOrderedChildrentest 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 withOrderedChildren[observers]Fix issue whereecs_field_is_setdidn't work for single term observers[queries]Fix issue where queries sometimes returned entities withNotQueryabletag[meta]Fix issues with deserializing inline arrays and vectors[meta]Fix issue in cursor API where it assumedint32_tfor 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]Implementworld::id_if_registeredmethod[cpp]Implementworld::type_info()[cpp]Remove redundantFLECS_METAcheck forto_constant()[cpp]Makeworld::to_json()methods const[cpp]Allow using APIs that accept enum constants in builds withFLECS_CPP_NO_ENUM_REFLECTION[core]Implementecs_table_has_traversable()function[core]Implementon_replacehook[core]Don't emitOnSetevents for operations when there are no hooks/observers[core]Improve performance ofset/ensure/emplace[core]Remove redundantcrfield from command struct[core]Improve error messages[core]Add checks that prevent making invalid modifications to core entities[core]Changetable_record_t.hdr.cachetype toecs_component_record_t[core]Improve performance of component overriding[core]Remove redundantNewcommand[core]Add new size argument toecs_emplace_idandecs_ensure_id[core]Implement newSingletontrait[core]Add moreecs_ref_ttests[core]Turn setting bothFLECS_DEBUG/NDEBUGerror into warning[core]Assert when passing alive ids to.entitiesmember ofecs_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]Addunderlying_kindfield to serializer operation for serializing enums[meta]Addconstantsfield to serializer operation for serializing enums/bitmasks[meta]Change meaning ofecs_member_t::countso that it's interpreted as inline array when >= 0[meta]Split offconstantsmember fromEcsEnum/EcsBitmaskinto separateEcsConstantscomponent[meta]Split up meta addon code into smaller files[json]Don't serialize schema to JSON fornonefields[script]Add script tests for CRLF line endings[script]Don't reset script code for managed scripts after error[script]Store errors on managed script[script]Implement new expressions[script]Implement exported variables[script]Allow for using variable names without$prefix as components, relationships and targets[script]Allow for using interpolated string expressions as components[script]Inheritance statements now require a scope[rest]Allow managed scripts to be saved from the REST API/explorer[rest]Always store build info on world so it is available for the explorer[cmake]Bumpcmake_minimum_required_version(thanks @niceEli!)[docs]Fix issues in script examples[docs]Remove outdated section on pipelines from system manual[docs]Add Gloam vault to README[docs]Fix source documentation foris_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 incorrectis_enabledtoenabledin manuals (thanks @ericjeker!)[docs]Add hooks section to entities and components manual
Breaking changes:
ecs_emplace_idandecs_ensure_idnow accept an additional size argument: #466 (comment)- The singleton API has been changed to use a component trait: #466 (comment)
- Script evaluation APIs now have a result argument for capturing errors: #466 (comment)
- Inheritance statements in flecs script now require a scope: #466 (comment)
- The serializer data structures have been updated to allow for vector deserialization, enums with underlying types and more: #466 (comment) and #466 (comment)
New Contributors
- @AnonimiAngels made their first contribution in #1714
- @niceEli made their first contribution in #1731
- @ZaddikDev made their first contribution in #1734
- @ColoredCarrot made their first contribution in #1715
- @Chetco made their first contribution in #1754
- @ericjeker made their first contribution in #1768
Full Changelog: v4.1.0...v4.1.1