-
-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Querying for flattened relationship #967
Comments
Iterating using a flattened relationship is currently only supported by queries. Support for filters (which is what |
Okay. Are there any other known limitations for flattening than that filters is not supported, plus the things documented at https://www.flecs.dev/flecs/group__entity__info.html#gaa15f32a7016cfe84291207e209ba7a1a Could you guess at an ETA based on how you prioritize this filter work? Perhaps done Q2 this year? Or before end of year? Also, in what way is the commit above related to this issue? |
I reimplemented the test using a query instead and got the same results. Are queries using filters when iterating over their results? Or how would I write a query which works?
|
ecs_flatten()
sets invalid ChildOf relationships
Yeah the challenge is that in a flattened tree the index that stores where the children of a parent are located no longer exists. To make querying for children of a specific flattened parent work will require a new data structure that's stored alongside the flattened tree. I'll have to think a bit about what this would look like. One of the benefits of a flattened tree is that it can significantly reduce RAM utilization because the lookup indices are no longer stored for each flattened parent, I don't want to undo that. |
Describe the bug
The flatten function sets invalid ChildOf relationships, so when using
ecs_children()
of the root after flattening we get all entities in the world.To Reproduce
I wrote a test for it:
The text was updated successfully, but these errors were encountered: