diff --git a/content/news/2023-10-21-bevy-0.12/index.md b/content/news/2023-10-21-bevy-0.12/index.md index 020f2161d1..acb5c3fa0f 100644 --- a/content/news/2023-10-21-bevy-0.12/index.md +++ b/content/news/2023-10-21-bevy-0.12/index.md @@ -19,6 +19,38 @@ Since our last release a few months ago we've added a _ton_ of new features, bug
authors: @author
+## Ignore Ambiguous Components and Resources + +
authors: @hymm
+ +Ambiguity Reporting is an optional feature of Bevy's scheduler. When enabled it reports conflicts between systems that modify the same data, but are not ordered in relation to each other. While some reported conflicts can cause subtle bugs, many do not. Bevy has a couple existing methods and two new ones for ignoring these. + +The existing APIs: `ambiguous_with`, which ignores conflicts between specific sets, and `ambiguous_with_all`, which ignores all conflicts with the set it's applied to. In addition, there are now 2 new APIs that let you ignore conflicts on a type of data, `allow_ambiguous_component` and `allow_ambiguous_resource`. These ignore all conflicts between systems on that specific type, component or resource, in a world. + +```rust +#[derive(Resource)] +struct R; + +// These systems are ambiguous on R +fn system_1(_: ResMut) {} +fn system_2(_: Res) {} + +let mut app = App::new(); +app.configure_schedules(ScheduleBuildSettings { + ambiguity_detection: LogLevel::Error, + ..default() +}); +app.insert_resource(R); + +app.add_systems(Update, ( system_1, system_2 )); +app.allow_ambiguous_resource::(); + +// Running the app does not error. +app.update(); +``` + +Bevy is now using this to ignore conflicts between the `Assets` resources. Most of these ambiguities are modifying different assets and thus do not matter. + ## Spatial Audio API Ergonomics
authors: @rparrett, @hymm, @mockersf