Hacker News new | ask | show | jobs
by Carbonhell 1169 days ago
If I understood correctly, you are referring to applying some sort of tag component to a set of entity to be able to query it in a separate system. Am I correct? For cross system data flow, I think a mechanism similar to what Bevy does is the way to go. A specific event bus where the developer can send any type of struct, which can also allow passing a set of entity ids. I have briefly used it for my project and I think it's clear to reason about. The only catch is that you need to be careful about timing (the time between sending and receiving an event might take one frame to propagate).

https://bevy-cheatbook.github.io/programming/events.html

1 comments

That's my understanding as well.

IMO it would be interesting to consider all static components, i.e. you don't add/remove components at runtime.

If you do want "tags", have a TagsComponent (statically added to all entities that can have tags) and modify the values in it.