0.14.1, tracking change detection, and more rendering examples
2024-08-05
0.14.1 is out, Bevy Jam 5 voting is ongoing for another week, and there's plenty of submissions to showcase this week.
track_change_detection
is probably my favorite merged feature this week alongside some new quality-of-life APIs, and a fantastic new example for mid-level rendering APIs. I'm a huge fan of new rendering examples because even when Bevy's rendering changes, the examples are always kept up to date as a solid resource.
We see a bunch of game jam submissions showcase'd this week. They will be mentioned in the issue if the author's chose to showcase their work but we won't be covering games in depth until after voting has closed.
What Changed my Component or Resource?
#14034 includes an incredible new change makes it possible to know what changed your Component
or Resource
. This is a new changed_by
function on Component
s and Resource
s that is behind a new track_change_detection
feature flag.
The change_detection
example can now be run with the feature enabled.
cargo run --example change_detection --features track_change_detection
resulting in more informative output!
2024-07-28T06:57:48.946022Z INFO component_change_detection: Entity { index: 1, generation: 1 }: New value: MyComponent(0.0)
2024-07-28T06:57:49.004371Z INFO component_change_detection: Entity { index: 1, generation: 1 }: New value: MyComponent(1.0)
2024-07-28T06:57:49.012738Z WARN component_change_detection: Change detected!
-> value: Ref(MyComponent(1.0))
-> added: false
-> changed: true
-> changed by: examples/ecs/component_change_detection.rs:36:23
The actual API usage is similar to is_changed
.
fn change_detection(
changed_components: Query<Ref<MyComponent>, Changed<MyComponent>>,
my_resource: Res<MyResource>,
) {
for component in &changed_components {
warn!(
"Change detected!\n\t-> value: {:?}\n\t-> added: {}\n\t-> changed: {}\n\t-> changed by: {}",
component,
component.is_added(),
component.is_changed(),
component.changed_by()
);
}
if my_resource.is_changed() {
warn!(
"Change detected!\n\t-> value: {:?}\n\t-> added: {}\n\t-> changed: {}\n\t-> changed by: {}",
my_resource,
my_resource.is_added(),
my_resource.is_changed(),
my_resource.changed_by()
);
}
}
and this information also shows up when using a debugger.
AccumulatedMouseMotion
Early in July #14044 added support for two new resources: AccumulatedMouseMotion
and AccumulatedMouseScroll
, which store accumulated mouse movement and make it easier to use the accumulated mouse event values. This week in #14488, these resources were used in more examples, so check this out if you want to replace some MouseMotion
event usage.
More Observers
As of #13859 the SceneInstanceReady
event is now an observer event! This means that when you spawn a scene the event will be triggered either globally or on the parent of the scene if one exists.
SpecializedMeshPipeline
#14370 adds a new example showing off how to use SpecializedMeshPipeline
, which is a mid-level rendering API. The example spawn 3 entities with a custom TriangleList
mesh, including vertex colors, and introduces some Bevy-specific abstractions for draw commands and pipelines. This example also starts to expose some wgpu concepts as well, although many types in the example are still bevy_render
-specific, such as FragmentState
which is a bevy-specialized version of wgpu's FragmentState
.
This is a great example for anyone looking to move beyond Material
and AsBindGroup
BuildChildren::with_child
commands
.spawn(TextBundle::default())
.with_child(TextSection::from("Hello"));
#14594 introduces a new quality-of-life API in with_child
on the BuildChildren
trait. This improves the workflow for spawning a Bundle
as a child, which contrasts against the already-existing add_child
, that accepts an Entity
.
New Camera functions
There are a whole bunch of camera-related functions for converting between world space, viewport, and ndc (normalized device coordinates). #14590 adds two more in depth_ndc_to_view_z
and world_to_viewport_with_depth
, which enables working with depth values.
Alice's Merge Train is a maintainer-level view into active PRs, both those that are merging and those that need work.
Showcase
Bevy work from the #showcase channel in Discord and around the internet. Use hashtag #bevyengine.
Ducky Boids
showcase
Ducky Boids was inspired by implementing the Boids algorithm in Bevy and figured out a way how to make a game fitting the theme out of it.
Grow your duck population and avoid them being feasted on, enjoy!
Physics Down, Navmesh Up
showcase
Going down through a board of pegs with gravity thanks to avian2d, going back up through a navmesh from the same colliders with vleue_navigator
Recycle Ruumba
showcase
Recycle Ruumba is a physics sandbox/simulator where you design the Robot "Ruumba" for delivering containers to the Recycler. IT was built using rapier and a parametric modeling plugin called bevy_pmetra
Cyberspace Trailer
showcase
Cyberspace is a Bevy Jam 5 entry. As part of that entry a tutorial video was created to help people get into the game!
BRRRRRRRRRRRRRRRR
showcase
A highscore game where you try to make an electric motor spin as fast as possible.
Runtime editable terrain
showcase
Runtime editable terrain tools using noise and modifiable entities.
Sol
showcase
Sol is an intentionally disorienting game jam submission that contains fast-moving colors in which you try to jump from platform to platform before Sol grows and envelops you. Source is available GitHub.
Reverse Bullet Hell
showcase
An entry for Bevy Jam 5, this bullet-heaven exists on a 360 degree planet and was put together in only 2.5 days. Source is available on GitHub
The Girl Who Climbed the Tower
showcase
The Girl Who Climbed the Tower is a level-based game with roguelike elements. Source is available on GitHub
Worlanwv!
showcase
The world has ended, and it will end again - unless you can finish your art project? This game is a walking simulator and a path through time.
Garbage Collector
showcase
Collect Garbage, and destroy enemies, alone or with friends in local coop. Source is on GitHub
Crates
New releases to crates.io and substantial updates to existing projects
tiny_bail 0.1.1
crate_release
Bail on failure with 4 macro variants or_return!
, or_return_quiet!
, or_continue!
, and or_continue_quiet!
, for return vs. continue and logging vs quiet.
This is a macro'ized version of a pattern that has emerged in the Bevy community for avoiding panics and warning instead.
let Ok(value) = query.get_single() else {
warn!("x wasn't right");
return;
}
openchecks 0.1.0
crate_release
Openchecks 0.1 is the first release of a checks framework that allows writing validation for things like assets. In the future it will also enable artists to understand why an asset is failing through a UI.
bevy_mod_mipmap_generator
crate_release
bevy_mod_mipmap_generator now has optional run-time BCn texture compression and an optional disk cache for caching the compressed textures. This isn't a replacement for using proper compressed asset formats (like ktx2) and isn't really meant to be used in a final game or app. The new features are just to make using compressed/mipmapped textures easier during testing/development.
Using mipmaps and compressed textures can have a significant impact on performance, memory usage, and appearance.
Bistro w/ wine:
12.9ms | 7.0GB: without mips or compression
11.8ms | 10.4GB: with mips
10.0ms | 4.8GB: with mips & compression
Intel Sponza:
13.1ms | 5.7GB: without mips or compression
12.7ms | 7.4GB: with mips
11.8ms | 3.3GB: with mips & compression
(Bevy 0.14, RTX3060)
bevy_fmod 0.5
crate_release
bevy_fmod is a wrapper for libfmod
. FMOD is a cross-platform audio engine that is used in many games. It is a commercial product, with a free license available for specific terms.
0.5 brings support for dynamic fmod plugins.
Fix `bevy_render`'s `image` dependency version authored by SkiFire13
Add `FilteredAccess::empty` and simplify the implementatin of `update_component_access` for `AnyOf`/`Or` authored by SkiFire13
Use AccumulatedMouseMotion, AccumulatedMouseScroll in examples authored by richchurcher
Disallow empty cubic and rational curves authored by mweatherley
Refactor Bounded2d/Bounded3d to use isometries authored by mweatherley
Added serialize flag to bevy_math dep of bevy_ui authored by TheDudeFromCI
bevy_reflect: Adding support for Atomic values authored by recatek
Correct minimum range-alloc version authored by JMS55
Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org authored by SkiFire13
Disabled usage of the POLYGON_MODE_LINE gpu feature in the examples authored by SarthakSingh31
Add note on StatesPlugin requirement for state code authored by richchurcher
Optimize cloning for Access-related structs authored by CrazyRoka
Stop website examples from linking to old URL with multiple redirects authored by TrialDragon
fix issue with phantom ui node children authored by eidloi
Fix CI after #12965 authored by SkiFire13
Remove deprecated `bevy_dynamic_plugin` authored by BD103
Change `SceneInstanceReady` to trigger an observer. authored by komadori
Track source location in change detection authored by aevyrie
Fix UI texture atlas with offset authored by s-puig
Add freebsd support for sysinfo authored by GuillaumeGomez
remove changelog file authored by mockersf
Fix common capitalization errors in documentation authored by janhohenheim
Add example showing how to use SpecializedMeshPipeline authored by IceSentry
Make `AnimationPlayer::start` and `::play` work accordingly to documentation authored by DasLixou
time_system is ambiguous_with event_update_system authored by richchurcher
Update sysinfo version to 0.31.0 authored by GuillaumeGomez
Fix rust beta lints authored by BD103
Fix lints in nightly authored by richchurcher
Fix Entity Debug Format authored by Zeenobit
fix asymmetrical 9-slicing authored by JJJimbo1
Don’t prepare lights (and shadow map textures) for 2D cameras authored by brianreavis
Properly handle repeated window close requests authored by Brezak
B0003: Print caller authored by SpecificProtagonist
Opportunistically use dense iteration for archetypal iteration authored by re0312
Add `with_child` to simplify spawning when there will only be one child authored by rparrett
Add `depth_ndc_to_view_z` for cpu-side authored by DasLixou
Reflection for `DepthOfFieldSettings` authored by DasLixou
Add `Dir2::from_xy_unchecked` and `Dir3::from_xyz_unchecked` authored by Jondolf
Skip batching for phase items from other pipelines authored by james-j-obrien
Want to contribute to Bevy?
Here you can find two types of potential contribution: Pull Requests that might need review and Issues that might need to be worked on.
Pull Requests Opened this week
Expose max_mip_dimension and uv_offset in BloomSettings. authored by Katsutoshii
allow interactive worldspace uis authored by robtfm
Add `OnMutate` observer and demonstrate how to use it for UI reactivity authored by alice-i-cecile
Observers feature flag authored by orangutanrider
Mod picking upstream 2 authored by NthTensor
Change ReflectMapEntities to operate on components before insertion authored by jrobsonchase
Handle TriggerTargets that are combinations for components/entities authored by cBournhonesque
Separate component and resource access authored by cBournhonesque
Fix `MeshAllocator` panic authored by eero-lehtinen
`Trigger::entity()` only returns valid entities authored by SarthakSingh31
Add `invert_winding` for triangle list meshes authored by DasLixou
Add a sound effects example authored by alice-i-cecile
add docs explaining the two accesses of a System meta authored by cBournhonesque
Fix soudness issue with Conflicts involving `read_all` and `write_all` authored by cBournhonesque
WIP PR for making each `TextSection` its own entity. authored by Olle-Lukowski
Update QueryBuilder to change the type after each transformation authored by cBournhonesque
add `SystemIdMarker` `Component` to enable filtering for `SystemId` `Entity`s authored by databasedav
Fix TAA on camera with viewport authored by tychedelia
Improve documentation on Update vs FixedUpdate schedule dichotomy authored by ItsDoot
Fix lightmaps break when deferred rendering is enabled authored by Soulghost
Issues Opened this week
Add `try_despawn` methods to commands authored by ThomasAlban
bevy_ecs should have more modular feature flags authored by orangutanrider
ObserverSystem cannot be an ExclusiveSystem authored by camblomquist
Unlabelled closure system in `Startup` created by `setup_state_transitions_in_world` authored by bravely-beep
Query-level change detection authored by alice-i-cecile
Crash when using `TemporalAntiAliasBundle` and `Viewport` together authored by tnajdek
2d rotations are cumbersome authored by UkoeHB
Conversion between `Visibility` and `bool` authored by ThomasAlban
Disjointed QueryData access authored by vil-mo
Scene: Sort resource and component before serializing for more stable result authored by notmd
`SystemChangeTick` does not implement `ExclusiveSystemParam` even though it probably could authored by LunarLambda
Unsoundness in QueryState::transmute_filtered authored by re0312
On iOS, loading many assets in `AssetMode::Processed` causes some assets to fail to load authored by Seldom-SE
`MeshAllocator` panics when spawning and despawning lots of meshes authored by eero-lehtinen
UI sometimes renders at half the size authored by msvbg
Billboard 3d Sphere Gizmo authored by DasLixou
Texture atlas example needs tweaking authored by alice-i-cecile
Add `Mesh::invert_winding` authored by Azorlogh
Improve ergonomics when using parent/child relationships with component hooks authored by piedoom
Link more aggressively to `.chain` authored by janhohenheim
SMAA broken in wasm with webgpu feature enabled authored by Logan-010
Proposal: Despawn entities with the `Component` macro. authored by mintlu8
Move `run_if` to `IntoSystem` authored by DasLixou
Alias violations for EntityMut/EntityRef authored by re0312
Support toggling individual `bevy_diagnostic` plugins at runtime authored by benfrankel
Gizmos do not show from a triggered system authored by cark
Observer execution flow authored by UkoeHB
`Deferred` doesn't seem to work with observers authored by jrobsonchase
`world_to_viewport` should return a `Result` authored by alice-i-cecile
`DepthOfFieldMode` should not derive `Component` authored by alice-i-cecile
Add `do_not_recommend` annotation to `all_tuples` to improve error messages authored by alice-i-cecile
Missing `Reflect` on a child leads to linker errors on Windows authored by kleinesfilmroellchen
`embedded_watcher` doesn't work for crates outside of the main crate directory authored by ricky26
Metal debugger reports Out of Bounds Buffer Index in "general mesh slab" authored by komadori