Happy new year! π₯ π
Highlights
- Component ids no longer need to match between worlds, which means Flecs worlds are now truly independent!
- Enums with custom underlying types are now properly supported by the core and meta addon
- The script and query implementations have been fuzzed, which lead to lots of gnarly bugs being found π
- A big flecs script refactor improved performance 50x (!) over 4.0.3, and 6x over 3.2.12
- Many, many new flecs script features which means much more complex scenes can now be built:
Procedural scene constructed from primitive shapes with flecs script
Release notes
This version includes the following bugfixes:
[cpp]
Fix ubsan error infree_obj<T>
(thanks @jspohr!)[cpp]
Fix issue with registering hooks after component registration (thanks @jpeletier!)[cpp]
Fix issue where callingset_group
/set_var
on const query objects was not possible[cpp]
Fix crash when iterating components of entity with an empty type[cpp]
Fix issue with nested observers and implicit namespaced component registration[cpp]
Fix issue with reregistering component symbol after deletion[cpp]
Fix issue where shared fields could not be accessed withfield
/field_at
ineach
callback[cpp]
Fix issue withenum_data::index_by_value
[cpp]
Fix crash in C++ addon logging[cpp]
Fix issue in C++ API when iterating a large number of sparse components[core]
Fix issue where batched commands for implicitly registered component could crash[core]
Fix issue with registration of traits for builtin entities[core]
Fix issue with usingecs_entity_desc_t::set
while deferring is suspended[core]
Fix illegal memory access inecs_add_path_w_sep
[core]
Fix write to invalid memory inflecs_path_append
[core]
Fix issue with name lookups that have multiple consecutive separator characters[core]
Fix issue with attempting to lookup#id
's with value larger thanUINT32_MAX
[core]
Fix leaks when usingFLECS_USE_OS_ALLOC
[core]
Fix issues where code was accessing world flags on stage object[core]
Fix access to uninitializedecs_cmd_t::id
field[core]
Fix leak when deferring a batched set for a large non-trivial component[core]
Fix issue where second element of pair could not be a sparse component[core]
Fix command batching issue where component is added in two stages[observers]
Fix issue where observers could be triggered multiple times for the same event[observers]
Fix issue where event was incorrectly propagated for masked component[observers]
Fix issue where observer with multipleup()
terms could get duplicate events[observers]
Fix issue whereOnTableCreate
observer did not trigger in deferred mode[queries]
Fix crash when sorted query withMatchEmptyTables
only matches empty tables[queries]
Fix issue where up traversal with inheritance could return duplicate results[queries]
Fix issue whereIsA
was incorrectly traversed for non-inheritable components[queries]
Fix issue with usingquery.find(flecs::entity, ...)
andEcsQueryMatchEmptyTables
[queries]
Fix issue where queries would return inconsistent component id for*From
operator fields[queries]
Fix assert that happens while reporting a query error[queries]
Fix assert when query has unbalanced{}
scopes[queries]
Fix issue where query incorrectly treatedthis
entity reference as variable[queries]
Fix issue with queries that have mixed cached fields and shared fields[queries]
Fix issue with queries created in stage, change detection and shared fields[meta]
Fix memory leaks in cursor string conversions[json]
Fix issue where override components would show up as inheritable in serialized JSON[script]
Fix issue where script AST would incorrectly cache ids of entities created by template[script]
Fix issue with parsing opaque primitive components[script]
Fix issue with using pair components in templates[rest]
Fix issue with reporting errors that contain formatting characters[misc]
Fix file handle leak when file fails to load (thanks @peter15914!)
This version includes the following improvements:
[cpp]
Prevent recycled entity ids when reparenting C++ module[cpp]
Addto_json()
method toflecs::query_base
[cpp]
Allow forX_TO_JSON_INIT
macros to be used in C++[cpp]
Fix warning for incorrect type instatic_cast
for inout & operator kinds[cpp]
Implement world local component ids[cpp]
Enums with custom underlying types are now supported[core]
Reduce overhead of monitors by not creating observers for optional terms[core]
Add assert to prevent entity ids from overflowing the 32 bit range (thanks @Ukendio!)[core]
Implement type info flags for detecting invalid component lifecycle (thanks @jpeletier!)[core]
Reduce page size of non-entity sparse sets (Reduce memory footprint)[core]
Use map instead of sparse set for type_info (Reduce memory footprint)[core]
Remove unnecessary observer sparse set (Reduce memory footprint)[core]
Reduce size of low id record array (reduces RAM)[core]
Changeflecs.core.Disabled
to(OnInstantiate, Override)
(fromInherit
)[core]
Allow for infinitely nested observer calls[core]
Add cycle detection in observer code to prevent stack overflows[core]
Add error message when invalid path is passed toecs_add_path_w_sep
[core]
Remove propagation of empty state for tables[core]
Changeecs_delete_empty_tables
API by changing its parameters to adesc
struct[queries]
Addecs_query_get
to getecs_query_t*
object from entity[queries]
Add more validator tests for!(ChildOf, _)
queries[systems]
Add system disabling test[script]
Flecs script expression refactor[script]
Add support for function arguments to flecs script[script]
Add math functions to flecs script in a newFLECS_SCRIPT_MATH
addon[script]
Add ability to specify variables when running a script[script]
Add support for multiple template instances per entity[script]
Improve detection of invalid statements inwith
scopes[script]
Add ability to define world-scoped script variables (likePI
)[script]
Add support for string interpolation to expression parser[script]
Add support for entity name expressions (like"e_$i" { }
)[script]
Implement support forfor var in x..y
loops[script]
Add divide by zero checks so runtime doesn't crash but reports error[script]
Add more builtin script functions for doc addon and testing for components[script]
Implement random number generator for flecs script[script]
Bulk-add components in entity scope to improve script performance[script]
Add support forelse if
[script]
Add support formatch
expressions[script]
Add support for using add assign and multiply assign in initializers[script]
Empty scopes now create an anonymous entity[script]
Allow referring to variables without$
[script]
Variables now need to useconst x: value
notation when using implicit type[script]
Props can now have implicit types[http]
Allow HTTP server to be created without threading support (thanks @basicer!)[http]
Allow for script code to be provided in body of/script
request[http]
Increase size of HTTP receive buffer, throw warning if request exceeds it[http]
Add body parameter toecs_http_server_request
[docs]
Add system & query examples foreach
andrun
callback variants[docs]
Add example that shows how to iterate multiple queries in a system[docs]
Add Unreal-Flecs link to documentation page[docs]
Fix issue with query_to_custom_json example[docs]
Fixecs
/world
typo in system manual (thanks @iHR4K!)[docs]
Add Resistance is Brutal to README[docs]
Improvements to migration guide (thanks @999pingGG!)[docs]
Add flecs tutorial links to documentation page[ci]
Fix warnings in tests (thanks @jpeletier!)[ci]
Silence clang warning about missingdefault
case[ci]
Fix CI bazel job to work with new bazel version
Breaking changes
- Flecs script API functions have been renamed: #466 (comment)
flecs::reset()
no longer exists: #466 (comment)- Events for communicating empty table state no longer exist: #466 (comment)
- The signature of
ecs_http_server_request
has changed: #466 (comment) - The
const var = value
script syntax has been deprecated: #466 (comment) - Empty script scopes now create anonymous entities: #466 (comment)
- Not strictly a breaking change, but the order in which nested observers are evaluated has changed, which may break code that relied on observer ordering (which is undefined).
New Contributors
- @jspohr made their first contribution in #1436
- @Ukendio made their first contribution in #1435
- @basicer made their first contribution in #1462
- @iHR4K made their first contribution in #1457
- @peter15914 made their first contribution in #1494
Full Changelog: v4.0.3...v4.0.4