This Week in Bevy

What happened this week in the Bevy Engine ecosystem

Links

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

bevy game gam 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.

water simulationwater simulation2d Gerstner waves

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

bevy_waterbevy_water

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.

bevy playground

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.

shopkeeper darkshopkeeper light

Shopkeeper

showcase

Preview of the graphics for an in-progress shopkeeper game.

city sim emptycity sim full

1-bit city sim

showcase

a 1-bit art style city simulation game using sprites. Uses a minimal set of additional crates: rand and noise.

multiplayer

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/

pixel-mapped LED powered by compute shader

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

more loadingshadersstripes

Creative UI Material Shaders

showcase

Creative UI material shaders building segments of lines and and loading them in over time as the Bevy application boots up

hot-reload ui

hot-reloading UI with bevy_cobweb_ui

showcase

bevy_cobweb_ui (unreleased as of the demo) powered hot-reloading of UI scenes

planets from afarplanets approachinglandscapesplanet

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.

fistspunch

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.

spelunky levelsspelunky-like

spelunky-like roguelike

showcase

Progress on a spelunky-like fully procedurally generated roguelike game:

  • Level progression
  • Damage + Health + Iframes
  • Character movement via tnua and animation
  • Camera clamping on arbitrary level sizes
isometric gridisometric level

Isometric support in HillVacuum

showcase

in-progress isometric grid support for HillVacuum, a doom-style level editor

animation graph

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

toast

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_dynanim

crate_release

bevy_dynanim is a procedural animation/second order dynamics crate inspired by the work of t3ssel8r. There's not much documentation for this one yet, so be prepared to read the source if you want to use it.

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()
}

pyri_state 0.2

crate_release

A flexible bevy_state alternative

  1. Complete docs plus runnable examples
  2. Pattern-matching: e.g. state!(Level(1 | 4 | 7)).on_enter(my_enter_systems)
  3. Custom storage: NextStateStack and NextStateSequence are provided, and you can define your own
  4. Local states (an example + better ergonomics will come in a later release)
  5. 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:

  1. Disable / enable: e.g. Menu::disable.run_if(pressed_Esc)
  2. Refresh: e.g. Level::refresh.run_if(pressed_R) (no need to configure a custom schedule to support this like in bevy_state)
  3. Direct mutation of the next state
bevy_lunex

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

New in 0.7:

  • Aery can now be reflect thanks to hooks allowing for serialization & use in scenes.
  • Removed TargetEvent & CleanupEvent: Superseded by hooks & observers. Added SetEvent & 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

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.

bevy_animation_graph

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.

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

Zero to Pong with Bevy

educational

PhaestusFox wiped their windows install this week and recorded a video writing a pong game from scratch including installing all required dependencies.

Pull Requests Merged This Week
Contributing

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.

How do I contribute?

Pull Requests Opened this week

Issues Opened this week