This Week in Bevy

What happened this week in the Bevy Engine ecosystem

Links

Bevy Remote Protocol, TheLightmapper, and particles

2024-12-16

The Bevy Remote Protocol is still capturing the attention of anyone with an editor available. We've now seen neovim, emacs, egui, standalone, and VSCode based inspectors using the new Bevy Remote Protocol.

Meanwhile interesting lightmapping experiments are happening with TheLightmapper/Bevy workflows, picking through portals, and more.

A number of PRs made it in this week, including really interesting reflection, curve, and event source features.

SystemInput tuples

#16814 introduces the ability to accept arbitrary tuples of SystemInputs. While only 8-arity tuples are implemented in core, 9+ can be added in userland if necessary.

fn by_mut((InMut(a), In(b)): (InMut<usize>, In<usize>)) {
    *a += b;
}

let mut world = World::new();
let mut by_mut = IntoSystem::into_system(by_mut);

by_mut.initialize(&mut world);

let mut a = 10;
let b = 5;
by_mut.run((&mut a, b), &mut world);
assert_eq!(*a, 15);

Event Source Location Tracking

#16778 adds core::panic::Location to EventId which allows users to figure out where an event was sent from.

This functionality is behind the tracking_change_detection feature.

fn apply_damage_to_health(
    mut dmg_events: EventReader<DealDamage>,
) {
    for (event, event_id) in dmg_events.read_with_id() {
        info!(
            "Applying {} damage, triggered by {}",
            event.amount, event_id.caller
        );
2024-12-12T01:21:50.126827Z  INFO event: Applying 9 damage, triggered by examples/ecs/event.rs:47:16

bevy ui debug overlay

bevy ui debug

As of #16693 the bevy ui debug overlay is rendered by the ui renderer and lives behind the bevy_ui_debug feature.

cargo run --example testbed_ui --features bevy_ui_debug

Derivative access patterns for curves

#16503 introduces the ability to access the derivatives of curves.

let points = [
    vec2(-1.0, -20.0),
    vec2(3.0, 2.0),
    vec2(5.0, 3.0),
    vec2(9.0, 8.0),
];

// A cubic spline curve that goes through `points`.
let curve = CubicCardinalSpline::new(0.3, points).to_curve().unwrap();

// Calling `with_derivative` causes derivative output to be included in the output of the curve API.
let curve_with_derivative = curve.with_derivative();

// A `Curve<f32>` that outputs the speed of the original.
let speed_curve = curve_with_derivative.map(|x| x.derivative.norm());

Make StandardMaterial bindless

#16644 takes advantage of the work in #16368 to enable using bindless textures in Bevy's StandardMaterial

bevy_reflect: Generic and Variadic Functions

#15074 introduces the ability to overload reflected functions. This adds support for generic functions:

let reflect_add = add::<i32>
    .into_function()
    .with_overload(add::<u32>)
    .with_overload(add::<f32>);

as well as variadic functions

// Supports 1 to 4 arguments
let multiply_all = (|a: i32| a)
    .into_function()
    .with_overload(|a: i32, b: i32| a * b)
    .with_overload(|a: i32, b: i32, c: i32| a * b * c)
    .with_overload(|a: i32, b: i32, c: i32, d: i32| a * b * c * d);

Showcase

Bevy work from the #showcase channel in Discord and around the internet. Use hashtag #bevyengine.

fluid particles

Fluid Particles

showcase

CPU particles from an older Bevy 0.12 fluid simulation. The intended use is for crowd simulation in more recent projects.

audio streaming

Audio streaming

showcase

bevy_matchbox and cpal for audio recording/playback

picking through portals

Picking through Portals

showcase

bevy_picking through portals with bevy_easy_portals (coming soon)

css-like macros

css-like bevy_ui macros

showcase

WIP css-like macros for bevy_ui with documentation still working for the values.

"lite" utility ai

showcase

A small bevy-0.14-compatible gist with some "lite" ai utility inspired by big-brain. The discord thread has some comments from the author of big-brain comparing the approaches.

rustcraft

Rustcraft 0.8

showcase

Rustcraft is a recreation of Minecraft using Bevy. Updates are in the changelog

Bevy Remote Protocol: VSCode

Bevy Remote Protocol: VSCode

showcase

A VSCode extension that uses the new Bevy Remote Protocol in 0.15 to display relevant data in-editor.

project harmonia

undo/redo with bevy_replicon for Project Harmonia

showcase

networked undo/redo for Project Harmonia is powered by bevy_replicon in this demo.

minibuffer + bevy-inspector-egui

minibuffer + bevy-inspector-egui

showcase

Using minibuffer to trigger bevy-inspector-egui behaviors.

the lightmapperthe lightmapper

The Lightmapper + Bevy

showcase

An architecture visualization demo using The Lightmapper along with light instructions for how to play with it yourself! Note that the instructions are not a tutorial and is only confirmed to work on Windows at the moment (Lightmapper One work is ongoing)

minigame join via qr code

Multiplayer minigame

showcase

a multiplayer minigame with networking powered by Aeronet via WebTransport. The goal is to create a QR-code accessible minigame for mobile devices.

poisson distribution

Poisson distribution

showcase

A poisson distribution, visuals almost entirely gizmos.

balls and lasers

Platforming bouncing orb

showcase

A platforming bouncing orb with lasers. Artwork done in Blender, sounds in Ableton.

cinemachine-like implementation

Cinemachine-like Camera

showcase

A Cinemachine-like camera controller built for Bevy. Source code is available in the Discord thread.

color space visualization

Color space visualizer

showcase

Spherical Color Model visualization with a wasm deployment!

Source is available on GitHub

Crates

New releases to crates.io and substantial updates to existing projects

ramp_gen

crate_release

A utility to generate functions for rust and wgsl similar to Blender's "Color Ramp" node.

iyes_progress v0.13.1

crate_release

iyes_progress is a crate to help you with creating loading screens where you might need to do arbitrary complex work, beyond just loading assets. It can keep track of everything for you and transition your state when all of your stuff reports completion.

This semver-compatible release adds a couple of new big features:

  • "Progress as Entities". This is an additional/alternative way of tracking progress. You can add the new ProgressEntity<S> component to entities and store progress there. This progress will be summed up and counted alongside all progress reported via the other existing mechanisms (returned by systems, stored in manual entries, etc.).
  • Progress from background tasks/threads. Give them a ProgressSender and they can send their progress updates, which iyes_progress will apply to their respective progress tracker entries. Requires the "async" cargo feature.
bevy_cobweb_ui

bevy_cobweb_ui v0.6.0

crate_release

bevy_cobweb_ui is an asset-oriented UI framework.

0.6 brings Bevy 0.15 support as well as a new book.

fire particles

berdicles

crate_release

General purpose instancing and projectile system

0.3 brings a new ribbon shader, support for custom instance buffers, and more

magica voxel

bevy_vox_scene 0.17

crate_release

bevy_vox_scene is a plugin for loading Magica Voxel files directly in bevy as usable meshes.

0.17 brings support for importing Magica Voxel's cloud materials as fog volumes, using the new fog density image feature in bevy 0.15. This means that bevy_vox_scene now supports all of Magica Voxel's material types.

bevy_minibuffer

crate_release

A gamedev console in your application with support for tab completion, user prompts, command running, and more. Currently supports Bevy 0.14

Beet 0.0.4

crate_release

Similarly to how observers introduced entities as events, beet introduces entities as control flow.

Why its cool

  • Its modular: instead of creating a new type for each state/behavior, add another child entity.
  • Its paradigm agnostic: At its core Beet simply provides tools to describe whether a behavior entity is running, the rest is just various ways that behaviors can be connected

There is a Quickstart

Devlogs

vlog style updates from long-term projects

The Daily Bonk - Dev Log #1

devlog

The first devlog for a minigolf project

Educational

Tutorials, deep dives, and other information on developing Bevy applications, games, and plugins

Bevygap: Autoscaling multiplayer Bevy game servers with Edgegap & Lightyear

educational

An article that covers deploying lightyear multiplayer Bevy apps to Edgegap's hosting.

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