-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Entity groups #1592
Comments
What I've been doing in my widgets prototype is to store the entity id of the "widget root" inside the other entities of the widget, and also the reverse when needed (saving the entity id of a "widget child" in the root to make it accessible to all). It feels a little bloated but it works well. |
From @Davier: Solution 3 can be naturally implemented using scenes, with the scene instance ID serving as the |
Hi, just commenting to say that having groups of
|
What problem does this solve or what need does it fill?
In non-trivial games, entities commonly need to be bundled together to share common behavior, despite being mostly heterogenous. As a few concrete examples:
Possible Solutions
min const generics might work well herewe need dynamic components (see Dynamic Systems and Components #623) (thanks @BoxyUwU and @TheRawMeatball).Solutions 1 is clearly a poor fit. Solution 2 comes with performance costs (hundreds of tiny, fragmented vecs, recomputation) and hurts conceptual clarity. Solution 3 is probably fine, but can result in broad queries and doesn't leverage the ECS super well (e.g. for data fragmentation).
Regardless of the solution that we reach consensus on as best-practice, we should make sure it's properly supported and has good examples. These patterns are surprisingly tricky, and I've seen various complaints about how hard these designs are to implement in ECS.
Additional context
This challenge / pattern was brought up in the context of widgets, prompting this issue.
The pattern selected here should be used when designing our UI framework: see #254.
The text was updated successfully, but these errors were encountered: