Ignore ambiguous components or resources#9895
Ignore ambiguous components or resources#9895alice-i-cecile merged 14 commits intobevyengine:mainfrom
Conversation
|
@rj00a can I get your review on this as a user please? |
alice-i-cecile
left a comment
There was a problem hiding this comment.
We should probably use this internally in this PR for some of our asset collection ambiguities.
|
@alice-i-cecile I added exceptions for |
|
|
||
| /// list of [`ComponentId`]'s to ignore when reporting ambiguity conflicts between systems | ||
| #[derive(Resource, Default, Clone)] | ||
| pub struct IgnoreSchedulingAmbiguities(Vec<ComponentId>); |
There was a problem hiding this comment.
This should have two distinct fields: one for resources, and one for components. Otherwise the API below doesn't make sense.
There was a problem hiding this comment.
The difference between one or two fields can't be observed in the API, so this seems alright to me. Only reason I could think to split it would be for a nicer Debug impl.
There was a problem hiding this comment.
I'm not a fan of splitting it up, makes the logic for filtering more complicated.
I think so: @cart's opinion was that basically all of these ambiguities are noise. Probably include it in the docs for asset registration too? |
24e1525 to
d5f0864
Compare
rj00a
left a comment
There was a problem hiding this comment.
The approach looks good to me.
Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>
14a6808 to
3d407c5
Compare
| /// * Registering the [`Asset`] in the [`AssetServer`] | ||
| /// * Initializing the [`AssetEvent`] resource for the [`Asset`] | ||
| /// * Adding other relevant systems and resources for the [`Asset`] | ||
| /// * Ignoring schedule ambiguities in [`Assets`] resource. Any time a system takes |
There was a problem hiding this comment.
Nit: a unit test to validate that these docs stay correct would be nice.
james7132
left a comment
There was a problem hiding this comment.
Not sure how I like the idea of using a resource for this purpose. It seems trivial to alter behavior at runtime by mutating or removing the resource. IMO this should be a part of the World itself instead of included as an item we store in it.
|
We already store Schedules as a resource to be fair. I'd rather make this a field of that than move it up to the World level. |
|
I actually started with it as part of |
|
I think that this is tightly coupled to the scheduling information: long-term, I think that all of our cross-schedule config belongs under |
# Objective - Fixes bevyengine#9884 - Add API for ignoring ambiguities on certain resource or components. ## Solution - Add a `IgnoreSchedulingAmbiguitiy` resource to the world which holds the `ComponentIds` to be ignored - Filter out ambiguities with those component id's. ## Changelog - add `allow_ambiguous_component` and `allow_ambiguous_resource` apis for ignoring ambiguities --------- Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>
# Objective - Fixes bevyengine#9884 - Add API for ignoring ambiguities on certain resource or components. ## Solution - Add a `IgnoreSchedulingAmbiguitiy` resource to the world which holds the `ComponentIds` to be ignored - Filter out ambiguities with those component id's. ## Changelog - add `allow_ambiguous_component` and `allow_ambiguous_resource` apis for ignoring ambiguities --------- Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>
# Objective - Fixes bevyengine#9884 - Add API for ignoring ambiguities on certain resource or components. ## Solution - Add a `IgnoreSchedulingAmbiguitiy` resource to the world which holds the `ComponentIds` to be ignored - Filter out ambiguities with those component id's. ## Changelog - add `allow_ambiguous_component` and `allow_ambiguous_resource` apis for ignoring ambiguities --------- Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>
Objective
Solution
IgnoreSchedulingAmbiguitiyresource to the world which holds theComponentIdsto be ignoredChangelog
allow_ambiguous_componentandallow_ambiguous_resourceapis for ignoring ambiguities