This Week in Bevy

What happened this week in the Bevy Engine ecosystem

Links

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 Components and Resources 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.

debugger view

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

triangles on triangles

#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

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!

Source Code

pegboardpegboard

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 ruumbarecycle ruumba

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

straight skeleton

Straight Skeleton

showcase

A straight skeleton implementation that now works with concave polygons. The implementation for this one isn't planned to be open sourced at the moment.

cyberspace

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!

crazy bikecrazy bike

Crazy Bike

showcase

Crazy Bike is a hectic first-person game about delivering stuff on your bike in time. Physics abuse is encouraged!

brrrrrrrrrrrr

BRRRRRRRRRRRRRRRR

showcase

A highscore game where you try to make an electric motor spin as fast as possible.

Source Code

hexagonal chess

Hex grid war game

showcase

A hexagonal grid war chess game featuring crates like hexx, ⁠bevy_tweening, bevy_rts_camera, bevy_outline, and more.

container system

Generic Container System

showcase

a first pass at environment interactions and player inventory with an abstract container system where other items like chests and can also have inventories.

dialoguedialogue

Custom Dialogue System

showcase

This demo shows off a work in progress dialogue system. The end-user API is made up of observers and one-shot systems.

binary greedy meshing

Binary Greedy Meshing

showcase

A work-in-progress binary greedy meshing implementation that just reached a working state. It is just in the positive x direction right now, but the other directions are just shifting some signs around.

landscape

Runtime editable terrain

showcase

Runtime editable terrain tools using noise and modifiable entities.

cyclesiocyclesio

cyclesio

showcase

A multiplayer 'io' game where you have to make closed cycles around other players to kill them! Uses lightyear for the networking; with client-prediction, interpolation, and also delta-compression to replicate only the latest diffs instead of the entire trails/zones

blobo partyblobo party

Blobo Party!

showcase

Blobo Party! is a casual musical roguelike deckbuilder. Dance, upgrade, and dance some more.

rounded world levelrounded world level

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

solsol endgame

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.

hamster cycle zerohamster cycle zero

Hamster Cycle Zero

showcase

In Hamster Cycle Zero you play as a hamster in a wheel in a 2d platforming world. Collect blueberries and hamster collectibles as you race to the finish!

the girl who climbed the towerthe girl who climbed the tower

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

debugger

utility debugger

showcase

A gizmo based utility ai debugger

worlanwvworlanwv

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.

live.die.repeat.live.die.repeat.live.die.repeat.

Live. Die. Repeat.

showcase

self-described as "Zelda meets Groundhogs Day in a creepy/cute dungeon", Live. Die. Repeat is a 2D stealth-action game where each life only lasts 1 minute, you have no weapons, and each time you die time loops and you start over in the same place again and again.

whalesong

Whalesong

showcase

A peaceful, meditative swimming simulator that follows a humpback whale on its annual migration cycle from the warm Northern waters off Australia down to the frigid Antarctic.

There is no ending, and you can't die. Instead, just sit back, relax and swim.

surviving todaysurviving today

Surviving Today

showcase

Surviving Today is a semi-survivors-like without the meta progression, with five days, five minutes each.

simon sayssimon says

Simon Says

showcase

Simon Says is a cosmic horror themed puzzle game with 25 unique levels and 48 additional challenges. Headphones strongly recommended. Source available on GitHub

garbage collectorgarbage collector

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

bevy_lit

bevy_lit v0.2

crate_release

bevy_lit is a 2d lighting crate. 0.2 brings webgl compatibility.

mips

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)

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.

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;
}

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.

No devlogs this week
No Educational this week
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