This Week in Bevy

What happened this week in the Bevy Engine ecosystem

Links

Animation Events, Curves, and no_std

2024-10-14

According to my notes there were over 100 PRs merged last week which represents a truly incredible effort by the community to get ready for the 0.15 release candidates.

0.15 is really shaping up to be a stellar release including Required Components, new Animation and Curve APIs, and more.

There's a whole lot to get into this week so let's start with some new rendering functionality.

Order Independent Transparency

oit

cubes and spheres

#14876 introduces Order Independent Transparency as an alternative to alpha blending. Alpha blending is achieved by sorting the geometry of a scene and allowing each to contribute, in that sorted order, color to the scene. Order Independent Transparency instead sorts per-pixel which can result in solving situations in which alpha blending fails.

This is a two-pass technique and the code is well documented with comments so if you're interested in digging into the lower levels of rendering definitely give this PR a read.

Foresight is a production Bevy user that has been using this implementation in production for months now without issue.

Screen Shake

screen shake

A new 2d_screen_shake example takes inspiration from Math for Game Programmers: Juicing Your Cameras With Math and implements a 2d screen shake example!

cargo run --example 2d_screen_shake

New Image APIs

cpu_draw

A number of new functions for operating on Image in terms of pixels were added in #10392. These include:

  • pixel_data_offset
  • pixel_bytes / pixel_bytes_mut
  • get_color_at / get_color_at_1d / get_color_at_3d
  • set_color_at / set_color_at_1d / set_color_at_3d

A new example cpu_draw shows off drawing a spiral pattern with the new APIs.

cargo run --example cpu_draw

Required Components

The followup work to Required Components is ongoing.

Another set of Required Components PRs went in this week as well including:

As of #15796 the Component implementation has now been removed from Handle. The API changes to enable this were already made in previous Required Components PRs.

Retained Render world

The recently merged retained render world means that entity ids aren't the same anymore between the main world and the render world. #15582 introduces a new SyncComponentPlugin<C: Component> which uses the Required Components behavior to add SyncToRenderWorld as a Required Component for the specified component C. The plugin also adds a component hook that will clear all components from the render world entity when C is removed.

#15756 also makes the retained render world a bit more type safe, especially when dealing with main world entity id keys in collections used in the render world.

Animation Events

animation events in the fox example

#15538 introduces the ability to trigger events via AnimationClip. Use cases for this include playing sounds when a characters feet touch the ground, triggering projectiles at the right time, and more.

running_animation.add_event_to_target(
    feet.front_left,
    0.625,
    OnStep
);

The animated_fox example has been updated to use events and a new animation_events example shows off a smaller use case.

Curves

curves example

In #15675 common interpolations were added. A new example was added to showcase the ease functions in 15703.

Macos Window Options

macos window

#15820 adds the ability to specify additional window options that only exist on macos, such as making the title bar transparent.

More tools for hierarchies

In 0.14 HierarchyQueryExt powers the ability to iterate over descendants and ancestors with Query and in #15627 that expands the trait to include

  • parent
  • children
  • root_parent
  • iter_leaves
  • iter_siblings
  • iter_descendants_depth_first

Text Rework

The way spans of text are structured has changed and #15591 showcases that. The new way to update spans of text (which are now entities themselves) looks like this:

fn refresh_text(
    query: Query<Entity, With<TimeText>>,
    mut writer: UiTextWriter,
    time: Res<Time>
) {
    let entity = query.single();
    *writer.text(entity, 1) = format_time(time.elapsed());
}

no_std

Bevy's no_std support is growing, and as a result its nice to make sure the improvements being made are kept. A new CI tool was introduced in #15843 to make sure crates that have been made no_std do actually compile for a no_std environment.


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.

no_std bevy

no_std Bevy

showcase

700+ FPS in this no_std demonstration Bevy UEFI app. If the prospect of no_std Bevy interests you, consider checking out the tracking issue for details on how far away this is from release!

jarl on steamdeck

Jarl on Steam Deck

showcase

Jarl running natively on Steam Deck with a stable 90 fps.

pathfinding

Optimizing Path Finding

showcase

A few optimizations went into reducing the cost of this pathfinding from about 80ms to 4ms.

poses

From Blender to Bevy

showcase

A custom approach to exporting pose bone positions and rotations from Blender into Bevy. This is done via a python script and allows the author to use a workflow based around new scene creation in Blender.

pixelmap

74 million pixels a second

showcase

A look at the in-progress bevy_pixelmap, which is a compute-shader based approach to building noita-like games

lightmappinglightmappinglightmapping

Bevy + The Lightmapper

showcase

The author of The Lightmapper has been working on an example Bevy scene while adjusting The Lightmapper to have better support for KTX files (which Bevy supports).

lockpicking

Lockpicking

showcase

A lockpicking mini-game similar to the one in TES 4 Oblivion.

rusty lander 0.7rusty lander 0.7

Rusty Lander 0.7

showcase

Rusty Lander added new graphics like background terrain and a new spaceship as well as functionality and bug fixes like increasing the gravity after each successful landing and out of fuel messages. It also now has a Windows build.

bevy_copperfieldbevy_copperfield

work-in-progress procedural mesh editor

showcase

This demo shows off bevy_copperfield, which is an in-progress procedural mesh editor made with Bevy in mind. Once added as a dependency, bevy's 3D primitives will be available to be turned into editable mesh with a procgen command. From there you can extrude, chamfer, and move around any part of the mesh

metroidvania style game

Metroidvania-style game

showcase

A new metroidvania style game that has already implemented double jumps, dashes, and damage.

solar system simulationsolar system simulation orbits

Solar System Simulation

showcase

This solar system simulation now includes a scenario system, a built-in editor, and support for SPICE files. In the scenario system, you can create, edit and launch different compositions of bodies, or re-create missions like Voyager-1, while SPICE files contain planetary body data from NASA.

tiny creatures

Tiny Creatures

showcase

A ludum dare 56: compo entry with lots of tiny creatures!

oklch color picker

Oklch color picker

showcase

This is an Oklch color picker built using bevy_color, egui, and opengl shaders.

Source is available on GitHub

radiance cascades

Radiance Cascades

showcase

Continued work on an implementation of Radiance Cascades, a 2d global illumination technique.

polderpolder

Polder

showcase

Bevy's 0.12 release header image included a video of a tiny planet city builder temporarily called Polder. The author also spoke about the implementation at the 4th unofficial Bevy meetup: Recreating Townscaper using Rust & Bevy.

The city builder is slowly growing into a larger game and recently gained a controllable character.

doorsdissolve

3d Platformer

showcase

Multiple features were added to this 3d platformer, including water and dissolve shaders as well as doors and chains using Avian3d.

yarn spinner

Disco Elysium + Yarn Spinner

showcase

This is a disco elysium inspired UI for Yarn Spinner dialogue.

to build a home

To Build a Home: Cleaning

showcase

In To Build a Home: now you will need to clean the apartment if the previous tenants left it dirty

Crates

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

bevy_debug_log

bevy_debug_log

crate_release

bevy_debug_log enables viewing the tracing debug log output inside your app - particularly on platforms like mobile where you have no easy way to follow the terminal output. It uses bevy_ui to display the logs, so no additional dependencies are required.

i-cant-believe-its-not-bsn

crate_release

Are you waiting to see what bsn! is going to be like? Me too. In the meantime check out i-cant-believe-its-not-bsn which is a convenient way to spawn hierarchies of entities from a single bundle that also works with required components!

fn spawn_with_child(mut commands: Commands) -> Entity {
    commands.spawn((A, WithChild(B(5)))).id()
}

Bevy Entitiles 0.11.0

crate_release

A 2d tilemap library for bevy. With many useful algorithms/tools built in.

0.11 brings a switch to avian2d for physics as well as a number of bug fixes from a refactor. Wasm is currently not supported but its a priority for the next releases.

bevy_pixelmap

bevy_pixelmap

crate_release

bevy_pixelmap is "an infinite pixel grid that you can edit really fast.", which is meant to drive games similar to Noita

bevy_tnua 0.20

crate_release

bevy_tnua is a floating character controller that can be used in 2d and 3d environments, and can use avian or rapier for physics. bevy_tnua 0.20 brings a new TnuaBuiltinKnockback action for applying a knockback effect to the character as well as changing the "up" direction to be determined by the gravity instead of being fixated to positive Y.

haalka

haalka 0.2

crate_release

haalka is a reactivity library powered by the FRP signals of futures-signals. It is a port of the web UI libraries MoonZoon and Dominator and offers the same signal semantics as a thin layer on top of bevy_ui. While haalka is primarily targeted at UI and provides high level UI abstractions as such, its core abstraction can be used to manage signals-powered reactivity for any entity, not just bevy_ui nodes.

haalka 0.2 brings Bevy 0.14 support, a migration to observers, a new component-driven API and more you can read in the changelog

leafwing-input-manager 0.15.1

crate_release

leafwing-input-manager 0.15.1 brings TripleAxislike inputs, an attribute macro for your Actionlike types and bug fixes galore.

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