-
-
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
Observer entities should have names #16384
Comments
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. jakobhellermann/bevy-inspector-egui@8b684b3 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) |
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 |
In that case, maybe bevy_cli could recommend that with a lint? |
Yeah, I would say that's a good |
Putting names on everything means allocating strings for everything. They are nice to debug, but will have a cost |
FWIW Rust makes it easy to put commands.spawn((
#[cfg(feature = "entity_names")]
Name::new("Foo"),
Foo,
)); |
This cost should be very minimal in the grand scheme of things. In my project I have a few dozen observers, and the total memory allocation for names would probably be somewhere south of 1kb. I struggle to see how this would be significant even for a much larger project.
It could be feature gated but I don't think this should be this big of a big deal, and Bevy should not offer more obscure flags than it has to. I could see it being gated by |
Yeah, I'd love to see this unified under a |
Should this use the same Maybe a |
Yeah, I would prefer to avoid using the component named |
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.The text was updated successfully, but these errors were encountered: