Skip to content

Commit

Permalink
Add stub release notes and migration guides for 0.15 release (#1673)
Browse files Browse the repository at this point in the history
  • Loading branch information
alice-i-cecile authored Oct 20, 2024
1 parent 43685e7 commit 24506ff
Show file tree
Hide file tree
Showing 248 changed files with 3,093 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- `SceneInstanceReady { parent: Entity }` is now `SceneInstanceReady { id: InstanceId, parent: Option<Entity> }`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Because `cargo-apk` is not compatible with `GameActivity`, building/running using `cargo apk build/run -p bevy_mobile_example` is no longer possible.
Users should follow the new workflow described in document.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Gamepad input is no longer accessed using resources, instead they are entities and are accessible using the Gamepad component as long as the gamepad is connected.

Gamepads resource has been deleted, instead of using an internal id to identify gamepads you can use its Entity. Disconnected gamepads will **NOT** be despawned. Gamepad components that don’t need to preserve their state will be removed i.e. Gamepad component is removed, but GamepadSettings is kept.
Reconnected gamepads will try to preserve their Entity id and necessary components will be re-inserted.

GamepadSettings is no longer a resource, instead it is a component attached to the Gamepad entity.

Axis<GamepadButton>, Axis<GamepadAxis> and ButtonInput<GamepadButton> methods are accessible via Gamepad component.

```diff
fn gamepad_system(
- gamepads: Res<Gamepads>,
- button_inputs: Res<ButtonInput<GamepadButton>>,
- button_axes: Res<Axis<GamepadButton>>,
- axes: Res<Axis<GamepadAxis>>,
+ gamepads: Query<&Gamepad>
) {
for gamepad in gamepads.iter() {
- if button_inputs.just_pressed(GamepadButton::new(gamepad, GamepadButtonType::South)) {
+ if gamepad.just_pressed(GamepadButton::South) {
println!("just pressed South");
}

- let right_trigger = button_axes
- .get(GamepadButton::new(
- gamepad,
- GamepadButtonType::RightTrigger2,
- ))
- .unwrap();
+ let right_trigger = gamepad.get(GamepadButton::RightTrigger2).unwrap();
if right_trigger.abs() > 0.01 {
info!("RightTrigger2 value is {}", right_trigger);
}

- let left_stick_x = axes
- .get(GamepadAxis::new(gamepad, GamepadAxisType::LeftStickX))
- .unwrap();
+ let left_stick_x = gamepad.get(GamepadAxis::LeftStickX).unwrap();
if left_stick_x.abs() > 0.01 {
info!("LeftStickX value is {}", left_stick_x);
}
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
`Table` now uses `ThinColumn` instead of `Column`. That means that methods that previously returned `Column`, will now return `ThinColumn` instead.

`ThinColumn` has a much more limited and low-level API, but you can still achieve the same things in `ThinColumn` as you did in `Column`. For example, instead of calling `Column::get_added_tick`, you’d call `ThinColumn::get_added_ticks_slice` and index it to get the specific added tick.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- The new `Set` variants on the enums listed in the change section should probably be considered by people working with this level of the lib

__Help wanted!__

I’m not sure if this change is able to break code. From my understanding it shouldn’t since we just add functionality but I’m not sure yet if theres anything missing from my impl that would be normally provided by `impl_reflect_value!`
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- `ColorMaterial` now contains `AlphaMode2d`. To keep previous behaviour, use `AlphaMode::BLEND`. If you know your sprite is opaque, use `AlphaMode::OPAQUE`
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
If you were using `RenderCommandResult::Failure` to just ignore an error and retry later, use `RenderCommandResult::Skip` instead.

This wasn’t intentional, but this PR should also help with https://github.com/bevyengine/bevy/issues/12660 since we can turn a few unwraps into error messages now.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
All active fields for reflected types (including lists, maps, tuples, etc.), must implement `Typed`. For the majority of users this won’t have any visible impact.

However, users implementing `Reflect` manually may need to update their types to implement `Typed` if they weren’t already.

Additionally, custom dynamic types will need to implement the new hidden `MaybeTyped` trait.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SSAO algorithm was changed from GTAO to VBAO (visibility bitmasks). A new field, `constant_object_thickness`, was added to `ScreenSpaceAmbientOcclusion`. `ScreenSpaceAmbientOcclusion` also lost its `Eq` and `Hash` implementations.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
```diff
let ui_node = ExtractedUiNode {
stack_index,
transform,
color,
rect,
image,
- atlas_size: Some(atlas_size * scale_factor),
+ atlas_scaling: Some(Vec2::splat(scale_factor)),
clip,
flip_x,
flip_y,
camera_entity,
border,
border_radius,
node_type,
},
```

```diff
let computed_slices = ComputedTextureSlices {
slices,
- image_size,
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- `WindowMode` variants now take a `MonitorSelection`, which can be set to `MonitorSelection::Primary` to mirror the old behavior.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Image format related entities are feature gated, if there are compilation errors about unknown names there are some of features in list (`exr`, `hdr`, `basis-universal`, `png`, `dds`, `tga`, `jpeg`, `bmp`, `ktx2`, `webp` and `pnm`) should be added.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Users currently using `ManualEventReader` should use `EventCursor` instead. `ManualEventReader` will be removed in Bevy 0.16. Additionally, `Events::get_reader` has been replaced by `Events::get_cursor`.

Users currently directly accessing the `Events` resource for mutation should move to `EventMutator` if possible.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
`Scene::write_to_world_with` no longer returns an `InstanceInfo`.

Before

```rust
scene.write_to_world_with(world, &registry)
```

After

```rust
let mut entity_map = EntityHashMap::default();
scene.write_to_world_with(world, &mut entity_map, &registry)
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
If you have a system which read `SceneInstanceReady` events:

>
`fn ready_system(ready_events: EventReader<'_, '_, SceneInstanceReady>) {`

It must be rewritten as an observer:

>
`commands.observe(|trigger: Trigger<SceneInstanceReady>| {`

Or, if you were expecting the event in relation to a specific entity or entities, as an entity observer:

>
`commands.entity(entity).observe(|trigger: Trigger<SceneInstanceReady>| {`
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- TODO -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Manual implementations of `Event` should add associated type `Traverse = TraverseNone` and associated constant `AUTO_PROPAGATE = false`;
- `Trigger::new` has new field `propagation: &mut Propagation` which provides the bubbling state.
- `ObserverRunner` now takes the same `&mut Propagation` as a final parameter.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Added `changed_by` field to many internal ECS functions used with change detection when the `track_change_detection` feature flag is enabled. Use Location::caller() to provide the source of the function call.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The API for `SystemBuilder` has changed. Instead of constructing a builder with a world and then adding params, you first create a tuple of param builders and then supply the world.

```rust
// Before
let system = SystemBuilder::<()>::new(&mut world)
.local::<u64>()
.builder::<Local<u64>>(|x| *x = 10)
.builder::<Query<&A>>(|builder| { builder.with::<B>(); })
.build(system);

// After
let system = (
ParamBuilder,
LocalBuilder(10),
QueryParamBuilder::new(|builder| { builder.with::<B>(); }),
)
.build_state(&mut world)
.build_system(system);
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>
now `SpotLightBundle` , `CascadesVisibleEntities `and `CubemapVisibleEntities `use VisibleMeshEntities instead of `VisibleEntities`
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- A `FogVolume` is now necessary in order to enable volumetric fog, in addition to `VolumetricFogSettings` on the camera. Existing uses of volumetric fog can be migrated by placing a large `FogVolume` surrounding the scene.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The type parameter of `Parallel::drain()` was unused, so it is now removed. If you were manually specifying it, you can remove the bounds.

```rust
// 0.14
// Create a `Parallel` and give it a value.
let mut parallel: Parallel<Vec<u8>> = Parallel::default();
*parallel.borrow_local_mut() = vec![1, 2, 3];

for v in parallel.drain::<u8>() {
// ...
}

// 0.15
let mut parallel: Parallel<Vec<u8>> = Parallel::default();
*parallel.borrow_local_mut() = vec![1, 2, 3];

// Remove the type parameter.
for v in parallel.drain() {
// ...
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- Regenerate your `MeshletMesh` assets, as the disk format has changed, and `MESHLET_MESH_ASSET_VERSION` has been bumped
- `MeshletMesh` fields are now private
- `MeshletMeshSaverLoad` is now named `MeshletMeshSaverLoader`
- The `Meshlet`, `MeshletBoundingSpheres`, and `MeshletBoundingSphere` types are now private
- `MeshletMeshSaveOrLoadError::SerializationOrDeserialization` has been removed
- Added `MeshletMeshSaveOrLoadError::WrongFileType`, match on this variant if you match on `MeshletMeshSaveOrLoadError`
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replace all instances of `AsyncSeek` with `AsyncSeekForward` in your asset reader implementations.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
`EventLoopProxy` has been renamed to `EventLoopProxyWrapper` and is now `Send`, making it an ordinary resource.

Before:

```rust
event_loop_system(event_loop: NonSend<EventLoopProxy<MyEvent>>) {
event_loop.send_event(MyEvent);
}
```

After:

```rust
event_loop_system(event_loop: Res<EventLoopProxy<MyEvent>>) {
event_loop.send_event(MyEvent);
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Rename usages of `bevy_core::name::DebugName` to `bevy_core::name::NameOrEntity`
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
`UiSystem` system set adjustments.

- The `UiSystem::Outline` system set is now strictly ordered after `UiSystem::Layout`, rather than overlapping it.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Change `DynamicArray::from_vec` to `DynamicArray::from_iter`
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
__Changed__

- Vertex and index buffers for meshes may now be packed alongside other buffers, for performance.
- `GpuMesh` has been renamed to `RenderMesh`, to reflect the fact that it no longer directly stores handles to GPU objects.
- Because meshes no longer have their own vertex and index buffers, the responsibility for the buffers has moved from `GpuMesh` (now called `RenderMesh`) to the `MeshAllocator` resource. To access the vertex data for a mesh, use `MeshAllocator::mesh_vertex_slice`. To access the index data for a mesh, use `MeshAllocator::mesh_index_slice`.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Since we have added a new filed to the Skybox struct, users will need to include `..Default::default()` or some rotation value in their initialization code.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`Msaa` is no longer configured as a global resource, and should be specified on each spawned camera if a non-default setting is desired.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- `CursorIcon` is no longer a field in `Window`, but a separate component can be inserted to a window entity. It has been changed to an enum that can hold custom images in addition to system icons.
- `Cursor` is renamed to `CursorOptions` and `cursor` field of `Window` is renamed to `cursor_options`
- `CursorIcon` is renamed to `SystemCursorIcon`
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Removed second generic from `PluginGroupBuilder` methods: `add_before` and `add_after`.

```rust
// Before:
DefaultPlugins
.build()
.add_before::<WindowPlugin, _>(FooPlugin)
.add_after::<WindowPlugin, _>(BarPlugin)

// After:
DefaultPlugins
.build()
.add_before::<WindowPlugin>(FooPlugin)
.add_after::<WindowPlugin>(BarPlugin)
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Since we have added a new filed to the `EnvironmentMapLight` struct, users will need to include `..default()` or some rotation value in their initialization code.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
`bevy_window` had an empty default feature flag that did not do anything, so it was removed. You may have to remove any references to it if you specified it manually.

```toml
# 0.14
[dependencies]
bevy_window = { version = "0.14", default-features = false, features = ["default"] }

# 0.15
[dependencies]
bevy_window = { version = "0.15", default-features = false }
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Addition of `new` method to the 3D primitive Cone struct.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Change `GltfAssetLabel::Skin(..)` to `GltfAssetLabel::InverseBindMatrices(..)`.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- The behaviour of `AnyOf<()>` and `Or<()>` has been changed to match no archetypes rather than all archetypes to naturally match the corresponding logical operation. Consider replacing them with `()` instead.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- TBD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- TODO -->
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This change does not introduce any breaking changes. Users of the Bevy engine will automatically benefit from this performance improvement without needing to modify their code.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The `to_curve` method on Bevy’s cubic splines is now fallible (returning a `Result`), meaning that any existing calls will need to be updated by handling the possibility of an error variant.

Similarly, any custom implementation of `CubicGenerator` or `RationalGenerator` will need to be amended to include an `Error` type and be made fallible itself.

Finally, the fields of `CubicCurve` and `RationalCurve` are now private, so any direct constructions of these structs from segments will need to be replaced with the new `CubicCurve::from_segments` and `RationalCurve::from_segments` methods.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- To avoid surprising performance pitfalls, `Transform` / `GlobalTransform` propagation is no longer performed down through hierarchies where intermediate parent are missing a `GlobalTransform`. To restore the previous behavior, add `GlobalTransform::default` to intermediate entities.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The user will just need to replace functions named `is_playing_animation` with `animation_is_playing`.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- When using the iterator returned by `Mesh::attributes` or `Mesh::attributes_mut` the first value of the tuple is not the `MeshVertexAttribute` instead of `MeshVertexAttributeId`. To access the `MeshVertexAttributeId` use the `MeshVertexAttribute.id` field.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
No breaking changes, but users can use the new methods if they did it manually before.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**This is not a breaking change for users migrating from 0.14, since `MeasureArgs` did not exist then.**

When the `bevy_text` feature is disabled for `bevy_ui`, the type of the `MeasureArgs::font_system` field is now a `PhantomData` instead of being removed entirely. This is in order to keep the lifetime parameter, even though it is unused without text being enabled.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Some run conditions have been simplified.

```rust
// Before:
app.add_systems(Update, (
system_0.run_if(run_once()),
system_1.run_if(resource_changed_or_removed::<T>()),
system_2.run_if(resource_removed::<T>()),
system_3.run_if(on_event::<T>()),
system_4.run_if(any_component_removed::<T>()),
));

// After:
app.add_systems(Update, (
system_0.run_if(run_once),
system_1.run_if(resource_changed_or_removed::<T>),
system_2.run_if(resource_removed::<T>),
system_3.run_if(on_event::<T>),
system_4.run_if(any_component_removed::<T>),
));
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
No user-visible changes needed from the users.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The method `World::increment_change_tick` now requires `&mut self` instead of `&self`. If you need to call this method but do not have mutable access to the world, consider using `world.as_unsafe_world_cell_readonly().increment_change_tick()`, which does the same thing, but is less efficient than the method on `World` due to requiring atomic synchronization.

```rust
fn my_system(world: &World) {
// Before
world.increment_change_tick();

// After
world.as_unsafe_world_cell_readonly().increment_change_tick();
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The `Bounded2d` and `Bounded3d` traits now take `Isometry2d` and `Isometry3d` parameters (respectively) instead of separate translation and rotation arguments. Existing calls to `aabb_2d`, `bounding_circle`, `aabb_3d`, and `bounding_sphere` will have to be changed to use isometries instead. A straightforward conversion is to refactor just by calling `Isometry2d/3d::new`, as follows:

```rust
// Old:
let aabb = my_shape.aabb_2d(my_translation, my_rotation);

// New:
let aabb = my_shape.aabb_2d(Isometry2d::new(my_translation, my_rotation));
```

However, if the old translation and rotation are 3d translation/rotations originating from a `Transform` or `GlobalTransform`, then `to_isometry` may be used instead. For example:

```rust
// Old:
let bounding_sphere = my_shape.bounding_sphere(shape_transform.translation, shape_transform.rotation);

// New:
let bounding_sphere = my_shape.bounding_sphere(shape_transform.to_isometry());
```

This discussion also applies to the `from_point_cloud` construction method of `Aabb2d`/`BoundingCircle`/`Aabb3d`/`BoundingSphere`, which has similarly been altered to use isometries.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dynamic plugins were deprecated in 0.14 for being unsound, and they have now been fully removed. Please consider using the alternatives listed in the `bevy_dynamic_plugin` crate documentation, or worst-case scenario you may copy the code from 0.14.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
`AnimationPlayer::start` now correspondingly to its docs restarts a running animation.
`AnimationPlayer::play` doesn’t reset the weight anymore.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The `get_conflicts` method of `Access` now returns an `AccessConflict` enum instead of simply a `Vec` of `ComponentId`s that are causing the access conflict. This can be useful in cases where there are no particular `ComponentId`s conflicting, but instead **all** of them are; for example `fn system(q1: Query<EntityMut>, q2: Query<EntityRef>)`
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`CameraUpdateSystem` is now explicitly ordered before `UiSystem::Prepare` instead of being ambiguous with it.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- TBD (ask me at the end of the release for meshlet changes as a whole)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- `QueryState::transmute`, `QueryState::transmute_filtered`, `QueryState::join` and `QueryState::join_filtered` now take a `impl Into<UnsafeWorldCell>` instead of a `&Components`
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
The optional builder methods on

```rust

gizmos.primitive_3d(&Plane3d { }, ...);

```

changed from

- `segment_length`
- `segment_count`
- `axis_count`

to

- `cell_count`
- `spacing`
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Users might have to double check their already existing calls to all the `grid` methods. It should be more intuitive now though.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The `AsBindGroup` `storage` attribute has been modified to reference the new `Handle<Storage>` asset instead. Usages of Vec` should be converted into assets instead.
Loading

0 comments on commit 24506ff

Please sign in to comment.