Skip to content

Latest commit

 

History

History
108 lines (67 loc) · 4.83 KB

File metadata and controls

108 lines (67 loc) · 4.83 KB

+++ title = "Bevy 0.10" date = 2023-03-04 [extra] author = "Bevy Contributors" +++

Thanks to X contributors, X pull requests, community reviewers, and our generous sponsors, I'm happy to announce the Bevy 0.10 release on crates.io!

For those who don't know, Bevy is a refreshingly simple data-driven game engine built in Rust. You can check out our Quick Start Guide to try it today. It's free and open source forever! You can grab the full source code on GitHub. Check out Bevy Assets for a collection of community-developed plugins, games, and learning resources.

To update an existing Bevy App or Plugin to Bevy 0.10, check out our 0.9 to 0.10 Migration Guide.

Since our last release a few months ago we've added a ton of new features, bug fixes, and quality of life tweaks, but here are some of the highlights:

  • Headliner Feature: Description here.

Section Template

authors: @Foo, @Bar

Description here.

Spatial Audio

authors: @mockersf, @DGriffin91, @harudagondi, @alice-i-cecile

The library Bevy uses for audio, rodio, contains support for spatial audio. In this version, we now support spatial audio (with certain caveats, like no HRTF and no first class support for Emitter and Listener components).

Interestingly, during the development of this specific feature, @harudagondi found a bug where the audio channels reverse when running the app in either debug or release mode. This turns out to be a rodio issue, and this also affects previous versions of Bevy. Thanks to @dis-da-moe, the bug has been fixed upstream. See the linked PR for interesting details about audio programming quirks and performance issues.

You can now have spatial audio in your game! Clone the bevy repository and invoke cargo run --example spatial_audio_3d --release in the command line for a showcase of 3D spatial audio in Bevy.

Custom Audio Sources

authors: @dis-da-moe

Bevy supports custom audio sources through the Decodable trait, but the way to register to the bevy app is very boilerplatey and sparsely documented. In Bevy 0.10, a new extension trait for App is added and the documentation for Decodable has vastly improved.

As such, instead of doing this:

struct MyCustomAudioSource { /* ... */ }

app.add_asset::<MyCustomAudioSource>()
    .init_resource::<Audio<MyCustomAudioSource>>()
    .init_resource::<AudioOutput<MyCustomAudioSource>>()
    .add_system(play_queued_audio_system::<MyCustomAudioSource>.in_base_set(CoreSet::PostUpdate))

You only have to do this:

app.add_audio_source::<MyCustomAudioSource>()

Much cleaner!

Ref<T> Queries

authors: @Guvante, @JoJoJet

Since Bevy 0.1, Mut<T> has been used to enable change detection (along with related types like ResMut<T>). It's a simple wrapper type that provides mutable access to a component alongside its change tick metadata, automatically marking a change when the value is mutated.

In Bevy 0.10, the change detection family has grown with Ref<T>, the immutable variant of Mut<T>. Like its mutable sibling, it allows you to react to changes made outside of the current system.

use bevy::prelude::*;

fn inspect_changes_system<T: Component + Debug>(q: Query<Ref<T>>) {
    // Iterate over each component of type `T` and log its changed status.
    for val in &q {
        if val.is_changed() {
            println!("Value `{val:?}` was last changed at tick {}.", val.last_changed());
        } else {
            println!("Value `{val:?}` is unchanged.");
        }
    }
}

We are also deprecating ChangeTrackers<T>, which is the old way of inspecting a component's change ticks. This type will be removed in the next version of Bevy.

What's Next?

  • Some Work In Progress Feature: Description here.

Support Bevy

Sponsorships help make our work on Bevy sustainable. If you believe in Bevy's mission, consider sponsoring us ... every bit helps!

Donate heart icon

Contributors

A huge thanks to the X contributors that made this release (and associated docs) possible! In random order:

  • @Foo

Full Change Log