Skip to content

Add a Removed query filter #2148

Open
Open
@alice-i-cecile

Description

@alice-i-cecile

What problem does this solve or what need does it fill?

The existing RemovedComponent API is somewhat unclear and cumbersome. It also commonly requires a manual query filtering step to make use of, which is both slow and full of boilerplate.

What solution would you like?

I want to be able to add Removed<T> to my queries as a filter to only include entities that have had the component removed since the system last ran using reliable change detection.

What alternative(s) have you considered?

We could also store the values of the removed components, but that won't be feasible with reliable change detection.

Additional context

With the addition of subworlds / multiple worlds (bevyengine/rfcs#16), we could move removed components to a parallel purgatory subworld for two frames using a double-buffer pattern, allowing us the ability to access removed data.

#13928 offers another way to remove RemovedComponents, which should be pursued. It may still be worth having a Removed filter after that, but its value is much less clear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleC-UsabilityA targeted quality-of-life change that makes Bevy easier to useS-Needs-Design-DocThis issue or PR is particularly complex, and needs an approved design doc before it can be merged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions