This Week in Bevy

What happened this week in the Bevy Engine ecosystem

Links

Entity Relationships and Contact Projective Decals

2025-01-20

Relationships are the big Bevy feature dropping into the main branch this week. one-to-many relationships to be precise.

A community decals crate was also upstreamed and the Bevy Remote Protocol methods continue to grow.

In the showcases we feature GPU collision, flowfields, player controllers, procedural generation and more. While macros feature in the crates this week as bevy-butler and bevy_registration get releases.

one-to-many Relationships

Entity Relationships get a big step forward this week with #17298 introducing one-to-many non-fragmenting relationships. This simplifies relationship internals leading to improved performance and user experience.

Concretely this is a generic version of the Parent/Children components which can be implemented as such with the new APIs

#[derive(Component)]
#[relationship(relationship_target = Children)]
pub struct Parent(pub Entity);

#[derive(Component)]
#[relationship_target(relationship = Parent)]
pub struct Children(Vec<Entity>);

This opens up relationships; From being only Parent/Children components to being user-defined (or Bevy provided). This includes features like opting new relationships into "despawn descendants" behavior.

This work is foundational for the Next Generation Scene/UI effort and is the base for a number of followup features like improved spawning ergonomics and "many-to-many" relations.

If you want to check out the new features in action, go review #17443 which introduces a new example making use of Relationships.

Events are no longer Components

From an end-user perspective: Events aren't Components and you probably don't want to use them as Components (for example: Query<&MyEvent>). This can make the Component bound on Event strange to read... but digging deeper yields a different story surrounding types like ComponentId. #17380 removes the Component bound without messing with the internals, allowing space for the continued evolution of those internals.

The details around this were part of the motivation for the It's All Components and Entities document which dives deeper into the nuance here.

bevy_contact_projective_decals upstreaming

decals example

#16600 upstreams naasblod/bevy_contact_projective_decals which in turn is based on Alexander Sannikov's talk about rendering in Path of Exile 2. (note: this talk also include Radiance Cascades).

The technique involves placing a decal on a quad which will then using the depth buffer to blender the decal with the geometry it intersects, as seen in the demo image. The implementation is surprisingly concise so if you're interested in rendering this is a great implementation to go read.

Showcase

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

4 player split screen

1/2/4 player splitscreen

showcase

Camera viewport systems toggling between devmode/single player/2-player/4-player split screen, with different input maps for each player.

physics controller

Physics-based character controller

showcase

An experimental physics based character controller with procedural animation that is strongly coupled to the physics

landscapelandscape lods

Landscape LoDs

showcase

A first iteration of landscape level of detail. This work doesn't yet include textures or shaders and only deals in raw meshes.

windows in windows

Windows in Windows

showcase

A child window within the parent window area rendering a webview. The content here is just a mockup based on bevy_editor_prototypes.

hexroll's ui

Hexroll's HTML content

showcase

HTML content rendered in hexroll with html5ever. The HTML is converted into bevy_ui for rendering.

Hexroll is a sandbox-generator and a virtual-table-top for old-school D&D.

sphere collision

Compute Shader Collision

showcase

A model generation and collision detection system using compute shaders. It uses pure GPU computation and utilizes Trigger<ReadbackComplete> to access the structured GPU cache for collision detection.

building interfaceresource visualization

Settletopia

showcase

A new building interface and world resource location visualization for Settletopia, a multiplayer open-world settlement building, civilization development game.

avian caterpillar

Avian Caterpillar

showcase

A caterpillar built with Avian Physics. The red end has max friction and the blue end has min friction.

retro psx shaders

retro psx shaders

showcase

Some tests towards making retro psx style shaders

procedural world generation

2d procedural world

showcase

A procedurally generated 2D chunk based world using Perlin noise, wave function collapse, and contextual layers.

Source is available on GitHub and a demo is available on YouTube.

flowfield pathfinding

Flowfield Pathfinding

showcase

A work-in-progress flowfield pathfinding crate with a focus on visualizing the flowfield's behavior for debugging purposes.

grass

Bevy Foliage Tool

showcase

A gpu-based grass shader that integrates with additional editor tooling.

pico-8

Modified Pico-8

showcase

A modified pico-8 game running from its .p8 file in a Bevy project temporarily named "Nano-9".

zoolitaire

Zoolitaire 1.8

showcase

Zoolitaire 1.8 is released with iPad support, a fix for device heating, and a premium subscription for unlimited help

bevypunk

Bevypunk video and audio synchronization

showcase

During an upgrade to 0.15, the Bevypunk example overhauled video and audio systems involving vleue_kinetoscope and bevy_kira_audio allowing them to stay synchronized even while playing in a loop and each track has different length.

space shooter

Space Shooter/Smash Bros

showcase

Progress on a space-shooter smash-bros-like game.

Crates

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

bevy_prefs_lite 0.1.1

crate_release

bevy_prefs_lite provides basic preferences support for Bevy applications. The word "preferences" in this context is used to mean user settings that are

  1. set while running the app
  2. persistent across restarts
  3. implicitly saved.

It is not meant to be a general config file serialization mechanism. Preferences typically include things like:

  • Current editing "mode" or tool.
  • Keyboard or game controller bindings.
  • Music and sound effects volume settings.
  • The location of the last saved game.
  • The user's login name for a network game (but not password!)
  • "Do not show this dialog again" checkbox settings.
ios margins

bevy_ios_safearea

crate_release

Bevy plugin that enables querying iOS device safe area insets (margins).

Features

  • reads safe area on app start
  • easy access via a resource
  • noop on non-ios platforms (no cfgs needed in your app code)

bevy_fixed_update_task

crate_release

bevy_fixed_update_task provides a version of a Fixed timestep that doesn't block rendering, allowing game logic to take advantage of Bevy's async tasks to occur over multiple frames. This allows your logic to wait or speed up to catch up irrespective of rendering.

It may be useful to check out the examples in the GitHub repo.

bevy_webview_wry 0.1

crate_release

bevy_webview_wry provides an ipc-command, which allows you communicate between a Webview and Bevy process.

bevy-butler 0.4

crate_release

bevy-butler is a set of procedural macros aimed at reducing Plugin boilerplate and making systems more self-documenting by declaring system ordering and scheduling at the system declaration, rather than when they're added to an App.

Features

  • Annotate systems with #[system(plugin = MyPlugin, schedule = Update)] to include them on a specified Plugin with a given Schedule
  • Seamlessly apply transformations within the system annotation: #[system(plugin = MyPlugin, schedule = Update, after = previous_system, run_if(|| true))]
  • Wrap multiple #[system]s in a config_systems! {} block to set default attributes
  • Wrap multiple #[system]s in a system_set! {} to include them in an anonymous set, and apply set-level transformations like chain
  • Seamlessy integrate into a user-defined impl Plugin block or struct MyPlugin statement by using the #[butler_plugin] annotation
  • Transparently usable as a dependency in a library crate

bevy_registration

crate_release

A bevy macro that uses inventory to schedule systems.

Devlogs

vlog style updates from long-term projects

all_calls_csv

devlog

A demo of a metadata collection CLI tool built to generate a spreadsheet of all functions. Originally meant for a Bevy application.

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