This Week in Bevy

What happened this week in the Bevy Engine ecosystem

Links

Better Errors, Settletopia, and One-to-One Relationships

2025-03-10

This week Bevy gains a new catch-all error type: BevyError which gets built into the new Bevy Result, and more Bevy APIs get Result return values.

In the showcase we see a few tower defense games and a number of submissions to the Code for a Cause Jam.

Settletopia, the multiplayer open-world fantasy colony sim, also lands its Steam page.

Error Handling

In 0.16 Bevy is moving towards more Result oriented error handling for systems, observers, and more.

#18144 introduces a brand new catch-all BevyError which improves error reporting in a similar way to crates like anyhow behave. This has been integrated into Bevy's Result type alias making the following possible:

fn oh_no() -> Result {
    let number: usize = "hi".parse()?;
    println!("parsed {number}");
    Ok(())
}

#18082 additionally brings a Result return type to Query::single and Query::single_mut. The old get_single functions are now deprecated.

One-to-One Relationships

One-to-Many Relationships already made it into 0.16, and #18087 brings directed One-to-One Relationships.

#[derive(Component)]
#[relationship(relationship_target = Below)]
pub struct Above(Entity);

#[derive(Component)]
#[relationship_target(relationship = Above)]
pub struct Below(Entity);

One important note is that this is an asymmetrical Relationship. That means one component in the Relationship is the source of truth. That's Above in the example. Adding Above to an Entity causes Below to be added to the other Entity automatically, but adding Below does not cause Above to be added.


Alice's Merge Train is a maintainer-level view into active PRs and how the Bevy sausage is made.

Showcase

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

settletopiamine ores settletopiamonsters settletopia

Settletopia

showcase

Settletopia, the multiplayer open-world fantasy colony sim now has a Steam page and a new showcase video! Wishlist now to develop a small settlement into a thriving multi-settlement civilization that spans the world

abysm

Abysm

showcase

Abysm is an action/puzzle game inspired by Boulder Dash. It was originally an entry for the Bevy Spooky Jam this last fall and the current goal is to turn the first part of the game into a small demo

keep the keep moving

Keep the Keep Moving

showcase

Keep the Keep Moving is an entry for the Code for a Cause jam where you have to keep the keep moving and avoid the grass

pixel planetspixel planetspixel planets

Pixel Planets

showcase

This is a set of Pixel Planets rendered into a video; next up is procedurally generating solar systems.

If you want to generate your own pixel planets, check out Pixel Planet Generator (github) or a Bevy port like this one

pbr shadingcel shading

WIP cel shading

showcase

A side by side comparison of a normal PBR render compared to a work-in-progress cel shading. The cel shading is implemented as an extended material that uses a 1d texture to map the pbr light to the flat light.

ray traced csg

Ray traced constructive solid geometry

showcase

The triangles in this demo are being ray traced in a fragment shader. The geometry represented by the wireframe is a tight outer bound for the true shape.

pi

Tower Defense Pi

showcase

The base mechanics for a tower defense style game where you "program" the towers yourself. The numeric calculation bits were programmed first, resulting in the ability to calculate pi.

sdf cat

Murairo

showcase

3D modeling software powered by Signed Distance Fields. Its a combination of a Bevy application and Electron

base buildingbase building pathfinding

RTS base building

showcase

A look at base building mechanics to an RTS game. The game uses dynamic flowfields that update any time an object is spawned. A preview of the flowfield logic is available here.

particles and destructionparticles and destruction

Custom Sand Engine

showcase

Falling sand and particles in this custom sand engine built with bevy_ecs and a custom lua integration

smooth normals and simplex noise

Simplex Noise and Smooth Normals

showcase

Generating planets with simplex noise and smooth normals. It works for any planet radius, noise amplitude and noise octave, and is now almost ready to be dropped into the full-size planet.

bevy_egui, iyes_perf_ui, and bevy_editor_cam are used to build the demo.

gta 2

GTA 2 maps

showcase

GTA 2 is a top-down game from 1999 and this is a map-viewer for the full maps, partially helped along by Blender to render the different block-type meshes. This project is open source on GitHub.

destructible texturesdestructible textures being destroyed

Destructible Textures

showcase

A minimalistic game reminiscent of super meat boy or an old Flash game. The textures break up into their pixels when hit, yielding a satisfying explosion that fits the minimal aesthetic.

procedural animation snake

Procedural Snake

showcase

Procedural animation of a snake based on this YouTube video in two languages: Rust/Bevy and Odin/raylib

tower defense

First Tower Defense

showcase

This tower defense game is the author's first ever game. Implemented functionality includes waves of enemies, a tower building system, and gold rewards to upgrade towers. Current assets are from a pack on Itch.io.

Crates

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

bevy_gamepad

crate_release

Replace gilrs with the Apple Game Controller framework on MacOS/iOS. This can be useful if you want to support switch pro controllers and 8bitdo switch compatible controllers.

bevy_streaming

bevy_streaming

crate_release

Stream Bevy's camera to a streaming server (through WebRTC) with ultra-low latency, and play the game through a simple browser or phone: aka "Cloud Gaming"

seldom_state

crate_release

seldom_state is a plugin that adds a StateMachine component that you can add to your entities. The state machine will change the entity's components based on states, triggers, and transitions that you define. It's useful for AI, animations, rigid player controllers, etc.

bevy_mod_openxr

crate_release

Bevy support for openxr. xr here stands for eXtended Reality, such as Augmented Reality (AR) or Virtual Reality (VR)

bevy_ui_anchor

bevy_ui_anchor 0.5

crate_release

bevy_ui_anchor supports anchoring UI elements to specific points or entities in the world.

beet_flow 0.0.5

crate_release

beet_flow is scenes-as-control-flow, use that same scene graph we all know and love to define modular behaviors.

world.spawn((
    Name::new("My Behavior"), 
    Sequence
  ))
  .with_child((
    Name::new("Hello"),
    ReturnWith(RunResult::Success),
  ))
  .with_child((
    Name::new("World"),
    ReturnWith(RunResult::Success),
  ))
  .trigger(OnRun::local());

bevy_mod_async

crate_release

bevy_mod_async is an attempt at a more ergonomic async abstraction for Bevy, built on Bevy's executor. The entire crate is built around TaskContext, which is the primary API for interacting with the ECS in an asynchronous manner.

commands.spawn_task(|cx| async move {
    let some_entity = cx
        .with_world(|world| {
            world.spawn_empty().id()
        })
        .await;

    let mut events = cx.event_stream::<MyEvent>();
    let MyEvent = events.next().await;
    cx.sleep(Duration::from_secs(1)).await;
    cx.with_world(move |world| {
        world.entity_mut(some_entity).despawn();
    })
    .await;

    cx.with_world(|world| {
        world.insert_resource(ClearColor(Color::WHITE));
    })
    .detach();
});
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