-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Implement a way to bypass all default filters #21615
Copy link
Copy link
Open
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-ContentiousThere are nontrivial implications that should be thought throughThere are nontrivial implications that should be thought through
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-ContentiousThere are nontrivial implications that should be thought throughThere are nontrivial implications that should be thought through
What problem does this solve or what need does it fill?
Default filters such as
EnabledandInternalallow queries to skip entities with them. Beyond these, users can create their own default filters in addition.Right now, every query must use
Allow<T>to allow a specific filter. This works for "regular" systems, but does not fit the bill for things that are used to uphold invariants. Consider:Disabled. Plugin authors can react to this by usingAllow<Disabled>, but that does not factor in any user-defined default filtersDespawnOncomponents are used to uphold invariants related to state. SeeDespawnOnEnter/DespawnOnExitno longer working onObservers#21579 for a real-world regression because we didn't remember to allowInternalonce it was added. In this specific case, we didn't even allowDisabled. But after addingDisabledandInternal, theDespawnOnmechanism still won't work when we either implement a new Bevy default filter or again a user provides their ownWhat solution would you like?
Something to bypass all default filters. E.g. a filter called
AllowAll.What alternative(s) have you considered?
AllowAllExceptor similar so that you can write down any exceptions, i.e. stuff you still want to not allowDespawnOncase thoughI can do this all day lol. For now, I think
AllowAllis a fine bandaid. It's still crappy because you have to remember to use it, but it's better than what we have now.