Open msvbg opened 1 day ago
This is partly a bug with bevy-inspector-egui, in that it should special-case Observer entities like it does for other classes of objects. But yeah, we should use the system name ideally.
This should be easy to fix in inspector egui. See my recent commit fixing lights associations. https://github.com/jakobhellermann/bevy-inspector-egui/commit/8b684b3608aa321c01b3eb730fefc8307e9a30c6
If someone doesn’t get to it first I’ll try and do a PR over there, separately to this ticket.
Does adding a Name component to every Observer create significant overhead for the sake of a a feature which could be implemented instead by the editor GUI? In other words, can the editor just see what the system name is and use that for Observers? (Special-cased)
Does adding a Name component to every Observer create significant overhead for the sake of a a feature which could be implemented instead by the editor GUI? In other words, can the editor just see what the system name is and use that for Observers? (Special-cased)
I sincerely doubt it! Observers are not spawned often and there should not be that many of them in a game. Personally I think it's good practice for every entity to have a name, and strive to enforce this in my projects, but this may not be standard in the community. Though I'm fine with any solution.
I think we should aim to use Name
more aggressively. Long-term, I'd like to move more of our name-like identifiers (like system names) out into the proper Name
component.
In that case, maybe bevy_cli could recommend that with a lint?
Yeah, I would say that's a good style
level lint.
Putting names on everything means allocating strings for everything. They are nice to debug, but will have a cost
What problem does this solve or what need does it fill?
Observers are spawned as entities. When using a tool like the egui inspector, observer entities are listed under the generic "Entity" name which makes it difficult to understand what they are at a glance
What solution would you like?
Observers should spawn with a
Name
component which indicates that they are observers.