Bevy 0.14's Release, Cosmic Text, and water reflections
2024-07-08
The release candidate process has completed for the first time and Bevy 0.14 is available now on crates.io. You can check out the official release post and migration guide.
Many, many crates have already been updated so check your dependencies. For the crates section this week we'll be omitting crates whose changelog is mostly "updated to 0.14".
If you're working on upgrading and find yourself in a situation where you have multiple major versions of Bevy installed, you can run this command to figure out why and what crates still need to be bumped:
cargo tree -i bevy
Cosmic Text
Cosmic Text is a crate that provides text shaping, layout, and rendering under an abstraction. It is also the crate used by System76's PopOS in their upcoming COSMIC desktop environment.
Bevy just merged a PR implementing cosmic-text and replacing the previously used ab_glyph.
Bevy Game Jam 5
The Bevy Jam Working Group kicked off and is working on getting ready for the next Bevy Jam: Bevy Jam #5, which will happen between July 20th and 29th.
-
July 7th: theme submission starts in #jam-theme-voting (this is right now! One submission per person this time around.)
-
July 14th: theme submission closes, theme voting starts
-
July 20th: Voting closes, theme announced, jam begins!
-
July 29th: jam concludes and submission voting begins
-
August 12th: voting closes and winner announced.
-
Read the rules and sign up here: https://itch.io/jam/bevy-jam-5.
-
Vote for a theme in the discord channel here #jam-theme-voting
-
Find a Team here: #jam-find-a-team
There should also be a semi-official bevy game template ready for the jam, coming from the jam working group.
And we've got an earlier-than-usual merge train this week: 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.
bevy_water Screen Space Reflections
showcase
This demo shows off some of the new features in Bevy 0.14. It uses bevy_water
(a dynamic water material with waves) and Bevy 0.14's Screen Space Reflections applied to the Bevy forest scene from the Bevy 0.14 release post.
Unofficial Bevy Playground
showcase
Similar to the Rust Playground this unofficial Bevy Playground enable the compilation and viewing of Bevy games from a brower. Some popular crates can be used and official Bevy examples are pulled from the repo and available to run.
lightyear multiplayer
showcase
A new multiplayer shooter demo for lightyear.
- Physics are powered via xpbd
- Inputs are handled with 0-delay thanks to client-prediction
- Similar to rocket-league, it also run client-side prediction on the asteroids + the other players so that collisions (with bullets or between players) are handled correctly, since everything runs in the predicted timeline. Player inputs are forwarded as fast as possible to make prediction for other players more accurate
- Player labels: 25±2ms [3] means 25ms server reported ping, 2ms jitter, 3 ticks of future inputs available. Each player has 6 ticks of input delay, which is why they have a [6] next to their local character.
The demo is also hosted on a server in germany: https://game.metabrew.com/
compute shader pixel mapping with nannou & bevy
showcase
Pixel mapping is mapping a display to an LED light. This LED is powered by Nannou and Bevy using a compute shader. This is in-progress work showing off Nannou's re-platforming effort to build on top of Bevy
WIP water simulation
showcase
Work in progress on a "realistic enough" water simulation that can be run as a realtime part of a game. The demo is using a midpoint-based spatial solver and Euler's method for time; and there is lots of low hanging fruit for numerical stability (MUSCL, RK4, etc.).
Later demo updates showed off 2d Gerstner waves from "Simulating Ocean Water", Tessendorf 2001: PDF link
Huge Voxel Planets
showcase
Huge voxel planets aided by big_space. The terrain is completely procedural and LODs are determined by an octree and then each chunk are generated then meshed at this specific LOD.
Object sizes in order of appearance:
- Sun: 1.4 million km
- Jupiter: 139,820 km
- Earth: 12,742 km
- Moon: 3,475 km
- The Red Cube: 1m
Highly worth viewing the video to get a real sense of the scale occurring here.
Punch to open
showcase
A first-person demo that gained the ability to punch to open trash cans. If you like this demo you may also be interested in the first_person_view_model example in the Bevy repo, originally authored by the same person.
Isometric support in HillVacuum
showcase
in-progress isometric grid support for HillVacuum, a doom-style level editor
state machine animation controller
showcase
A demo showing of animation state machines (i.e. animation controller) working in bevy_animation_graph
in preparation for the 0.4 release.
Crates
New releases to crates.io and substantial updates to existing projects
bevy_coroutine
crate_release
A library to run coroutines in Bevy!
bevy_coroutine
can help you with:
- spreading the execution of a system across several frames
- running systems in sequence over time
// Launch a coroutine
commands.add(
Coroutine::new(with_input(player, play_hurt_animation))
);
fn play_hurt_animation(In(target): In<Entity>) -> CoResult {
// Start sub coroutines in sequence
co_break().with_subroutines((
with_input((target, RED.into()), set_sprite_color),
wait(Duration::from_secs_f32(0.1)),
with_input((target, WHITE.into()), set_sprite_color),
))
}
fn set_sprite_color(
In((entity, color)): In<(Entity, Color)>,
mut query: Query<&mut Sprite, With<Player>>,
) -> CoResult {
let mut sprite = query.get_mut(entity).unwrap();
sprite.color = color;
co_break()
}
Error handling
crate_release
A series of crates relating to being able to return errors from systems and display those errors in toasts inside a Bevy app were released. This series includes
Bevy animation graph 0.4
crate_release
bevy_animation_graph
is an alternative animation crate for Bevy, supporting animation graphs, basic IK, a graphical editor and more. 0.4 brings many editor imporvements and animation state machines as nodes in the graph.
bevy_lunex 0.2
crate_release
bevy_lunex
is a path based retained layout engine for Bevy entities, built around vanilla Bevy ECS. bevy_lunex
0.2 gains support for 2d meshes.
Dexterous Developer v0.3.0
crate_release
Hot Reload your Rust game code with Dexterous Developer!
What can you reload?
- Any systems you want
- Resources, Components or States that can be serialized
- Events
It also lets you develop on one machine and run the hot-reloaded game on another (currently only on the same platform)
bevy_common_assets v0.11
crate_release
bevy_common_assets
is a collection of Bevy plugins offering generic asset loaders for common file formats.
0.11 adds support for postcard
, a #![no_std]
focused serializer and deserializer for Serde.
aery 0.7
crate_release
A plugin that enables a subset of entity relationship features for bevy
0.7
:
New in - Aery can now be reflect thanks to hooks allowing for serialization & use in scenes.
- Removed
TargetEvent
&CleanupEvent
: Superseded by hooks & observers. AddedSetEvent
&UnsetEvent
triggers. - Remove
checked_despawn
cleanup now uses hooks & regular despawn meaning:- You don't have to remember to call a different function.
- Better compatibility with hierarchy (
despawn_recursive
also triggers arey cleanup). - You don't have to worry about reminding users to call a different function if you're crate author looking to use arey as a dependency.
Avian Physics 0.1
crate_release
Avian is an ECS-driven physics engine for Bevy. It is the next evolution of Bevy XPBD, with a completely rewritten contact solver, improved performance, a reworked structure, and numerous other improvements and additions over its predecessor.
Some highlights include:
- A solver rewrite: Avian uses an impulse-based TGS Soft solver instead of XPBD for contacts.
- A reworked narrow phase: Collision detection is much more performant and reliable.
- Continuous Collision Detection (CCD): Speculative collision and sweep-based CCD are implemented to prevent tunneling.
- Optional collision margins: Extra thickness can be added for thin colliders such as trimeshes to improve stability and performance.
- Improved performance: Overhead for large scenes is significantly smaller, and collision-heavy scenes can have over a 4-6x performance improvement in comparison to Bevy XPBD.
- Improved runtime collider constructors: It is easier to define colliders and collider hierarchies statically to enable more powerful scene workflows.
- Structural improvements and polish: The module structure has been heavily reworked, and tons of inconsistencies and bugs have been resolved.
Check out the announcement blog post for an in-depth overview of what has changed and why the rebrand was done. A changelog and migration guide can be found on GitHub.
pyri_state 0.2
crate_release
A flexible bevy_state alternative
- Complete docs plus runnable examples
- Pattern-matching: e.g.
state!(Level(1 | 4 | 7)).on_enter(my_enter_systems)
- Custom storage:
NextStateStack
andNextStateSequence
are provided, and you can define your own - Local states (an example + better ergonomics will come in a later release)
- Improved API (see the full changelog for more information)
This is in addition to providing a full superset of bevy_state
's features + the features from v0.1.0:
- Disable / enable: e.g.
Menu::disable.run_if(pressed_Esc)
- Refresh: e.g.
Level::refresh.run_if(pressed_R)
(no need to configure a custom schedule to support this like inbevy_state
) - Direct mutation of the next state
Devlogs
vlog style updates from long-term projects
This Month in Rust GameDev: June
devlog
This Month in Rust GameDev is back up and running so if you're interested in the wider Rust gamedev ecosystem outside of Bevy go check it out
Educational
Tutorials, deep dives, and other information on developing Bevy applications, games, and plugins
Fix compile failure in WASM without `wgpu` backend authored by aevyrie
Handle `Ctrl+C` in the terminal properly authored by SarthakSingh31
Optimize common usages of `AssetReader` authored by JoJoJet
Merge `BuildWorldChildren` and `BuildChildren` traits. authored by yrns
Bump rodio to 0.19 authored by BD103
deregister events authored by lee-orr
bevy_reflect: Function reflection authored by MrGVSV
Apply Clippy lints regarding lazy evaluation and closures authored by Luracasmus
Clarify the difference between default render layers and `none` render layers authored by JoJoJet
Bump `accesskit` to 0.16 authored by BD103
Mouse input accumulation authored by Aztro-dev
Make gLTF node children Handle instead of objects authored by freiksenet
Support operations for render layers and fix equality comparisons authored by JoJoJet
use associated type bounds in QueryManyIter and QueryIter::sort() authored by Victoronz
Fix `push_children` inserting a `Children` component even when no children are supplied authored by janhohenheim
Backport #14083 (deregister events) to 0.14 branch authored by alice-i-cecile
Added `get_main_animation` for `AnimationTransitions` authored by mintlu8
Added feature switch to default Standard Material's new anisotropy texture to off authored by gagnus
Fix footgun for Windows users in `fast_config.toml` authored by janhohenheim
add missing mention of sort_unstable_by_key in QuerySortedIter docs authored by Victoronz
Bevy color 0.14.1 authored by ChristopherBiscardi
Skip extract UiImage When its texture is default authored by re0312
Fix border color in `ui_texture_slice` and `ui_texture_atlas_slice` examples. authored by rparrett
fix remaining issues with background color in examples authored by mockersf
Using simple approx round up in ui_layout_system authored by re0312
Cosmic text authored by TotalKrill
Release 0.14.0 version bump authored by mockersf
bevy_reflect: Re-enable reflection compile fail tests authored by MrGVSV
impl Debug for ExtendedMaterial authored by NWPlayer123
Deduplicate Wasm optimization instructions authored by benfrankel
Send `SceneInstanceReady` when spawning any kind of scene authored by daxpedda
Remove unused type parameter in `Parallel::drain()` authored by BD103
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
Fix intra-doc links and make CI test them authored by SkiFire13
Lighting Should Only hold Vec<Entity> instead of TypeId<Vec<Entity>> authored by re0312
Allow volumetric fog to be localized to specific, optionally voxelized, regions. authored by pcwalton
bevy_reflect: Function registry authored by MrGVSV
Cyclic splines authored by mweatherley
Fix crash when an asset load failure event is processed after asset drop authored by brianreavis
bevy_reflect: Add `DynamicClosure` authored by MrGVSV
implement DoubleEndedIterator for QueryManyIter authored by Victoronz
Move GPU mesh collection out of the extract phase, in preparation for bindless textures. authored by pcwalton
Optimize unnecessary normalizations for `Transform::local_{xyz}` authored by janhohenheim
prepare next version: update regexes authored by mockersf
bevy_math: faster sphere boundary sampling authored by ickk
Expose loading system fonts authored by Dimchikkk
fix asymmetrical 9-slicing authored by JJJimbo1
bevy_input: allow use without bevy_reflect authored by torsteingrindvik
use Display for entity id in log_components authored by hymm
Impl VisitAssetDependencies for HashSet and HashMap authored by jacobdufault
Expose Winit's `KeyEvent::repeat` in `KeyboardInput` authored by daxpedda
Add error message if states schedule missing (usually because StatesPlugin hasn't been added) authored by cBournhonesque
Allow observer systems to have outputs authored by cBournhonesque
Exposes Common Window Resolutions as an Enum. authored by Sapein
impl Reflect + Clone for StateScoped authored by brandon-reinhart
Dirty fix for App hanging when windows are invisible on WindowsOS authored by MiniaczQ
add entity to error message authored by hymm
WIP custom cursors authored by aMyTimed
Replace `AsyncSeek` trait by `AsyncSeekForward` for `Reader` to address #12880 authored by ldubos
Faster MeshletMesh deserialization authored by JMS55
Fix inconsistency in `KeyboardInput` examples to match migration guide authored by chompaa
Input uses references when possible authored by mockersf
disable gpu preprocessing on android with Adreno 730 GPU and earilier authored by Litttlefish
bevy_reflect: Feature-gate function reflection authored by MrGVSV
bevy_core: make bevy_reflect optional authored by torsteingrindvik
Issues Opened this week
Bad error when AssetServer::load is called on &str from event reader (possibly flawed lifetimes?) authored by laundmo
Clarify Intel macOS support authored by janhohenheim
2d custom vertex attribute not working authored by jonathandw743
Observers missing API for triggers targetting components on a given Entity authored by james-j-obrien
WebGL2 deferred rendering breaks when anisotropy is enabled authored by DGriffin91
Optimize rounding method used in UI layout authored by alice-i-cecile
Support splash screen authored by king0952
Improve observers documentation authored by cBournhonesque
Compile-out excessive wgpu log messages statically authored by JMS55
States cannot be added before `StatePlugin` / `DefaultPlugins` are added authored by alice-i-cecile
API inconsistency with `Handle` as component or field of component authored by benfrankel
Features "jpeg" and "dynamic_linking" cause linking error in 0.14-rc.4 on linux authored by Sorseg
Resource state (0x4D8F0620: D3D12_RESOURCE_STATE_[COMMON|PRESENT]) of resource [...] is invalid for use as a render target. authored by lynn2910
Using `dynamic_linking` on Windows breaks `cargo test --doc` authored by janhohenheim
Remove manual `--cfg docsrs` in `Cargo.toml` metadata authored by BD103
Use `cargo-docs-rs` for the dev-docs authored by BD103
Add a "path strip" primitive for 2d and 3d. authored by viridia
visible: false on WindowPlugin Stops Rendering authored by igorlp
docs.rs claims that `bevy_state` 0.14.0 (+ 0.14.0-rc.4) depends on a yanked dependency authored by Themayu
The function `hsv_to_rgb` in wgsl is defined or called incorrectly authored by jannik4
`depth_bias` is ignored on `StandardMaterial` authored by DiSaber
Piping values does not work on observers authored by janhohenheim
"called `Option::unwrap()` on a `None` value" when calling init_state before StatesPlugin is set? authored by ShadowMitia
Expose common window resolutions authored by janhohenheim
Pausing the virtual clock stops event updates. authored by brandon-reinhart
Crash on Widnows 11 with exit code: 0xc0000005, STATUS_ACCESS_VIOLATION authored by eidloi
Improve error message when `StatesPlugin` is missing authored by TimJentzsch
Regression: gizmos panicking given bad output from `GlobalTransform::to_scale_rotation_translation` authored by aevyrie
Padding in `Style` no longer works in 0.14 authored by Litttlefish
Crash on Android on 0.14 authored by Litttlefish
asymmetrical 9-slicing is still broken authored by JJJimbo1
SMAA looks extreme in split screen on non-top level viewports authored by paul-hansen
Support .run_if() on observers authored by forbjok
Prerequisite plugins and resources / dependency handling: `.require_plugin()` and `.require_resource()`. authored by colleen05
Add a Unsafe method for splitting access in a system authored by hymm
`.gltf` files' `.bin` dependencies aren't copied into `imported_assets` authored by Seldom-SE
The `asset_processor` feature in 0.14 causes problems with GLTF loading. authored by Neopallium
Geometric primitives for UI authored by viridia
Thin line in 9-sliced texture when sprite resolution is high authored by Litttlefish
bevy_app::App cannot be sent between threads authored by PPakalns
Feature flag to add repr(c) to bevy types authored by ScottKane
Compiler error if `sysinfo_plugin` feature is enabled, but `multi_threaded` is not. authored by inodentry