This Week in Bevy

What happened this week in the Bevy Engine ecosystem

Links

Meshlets, Stable Interpolation, and Generalized ECS Reactivity with Observers!

2024-06-17

Release Candidate 0.14.0-rc.3 is out this week with one last new feature for 0.14 (Observers), an upgrade to wgpu 0.20 (previously 0.19), as well as assorted fixes for rc.2.

With the 0.14 release getting closer fewer major features are getting merged but we still have some great functionality to talk about.

As always you can keep up to date with the release using the 0.14 milestone.

Observers

#10839 (Generalised ECS reactivity with Observers) introduces the idea of Observers to Bevy. Fundamentally Observers seem like an infrastructure-level improvement to the ECS implementation in Bevy. They are absolutely usable in application-level code but personally I'm looking forward to see how they develop and what gets built on top of them over the next few releases.

Observers can use systems with all the dependency injection you'd expect as well as a new Trigger type. Observers can be "global" or watch specific entities.

#[derive(Event)]
struct Speak {
    message: String,
}

world.observe(|trigger: Trigger<Speak>| {
    println!("{}", trigger.event().message);
});

// Observers currently require a flush() to
// be registered. In the context of schedules,
// this will generally be done for you.
world.flush();

world.trigger(Speak {
    message: "Hello!".into(),
});

Virtual Geometry in Bevy 0.14

meshlets

The upcoming experimental meshlets feature in Bevy 0.14 is comparable to Unreal Engine's Nanite (PDF) in purpose. The primary author of the feature in Bevy (jms55) wrote an in-depth post titled Virtual Geometry in Bevy 0.14 which is a fantastic read for anyone interested in the functionality meshlets provide. The post is less "how to use meshlets" and more "how meshlets is implemented" and includes numerous code examples and screenshots showing off the functionality.

Custom Primitives

custom primitives

#13795 introduces a new example that shows off custom primitives and extrusions of those primitives. This is an interesting example because it shows off a lot of the primitive and meshing features that have developed over the last few months, including the Bounded, Measured, Meshable, and Extrusion traits.

Extrusion Segments

segments on various extrusions

#13719 adds support for segments to the ExtrusionBuilder

Stable Interpolation

Freya's big takeaway slide

Freya Holmer recently gave a talk titled lerp smoothing is broken which then influenced an implementation of stable interpolation in #13741. The video and the PR are both top-notch documentation resources for what is going on here, so I'll leave you with the short version of StableInterpolate is:

A type with a natural interpolation that provides strong subdivision guarantees.

2d top-down camera example

centered

bottom right

#12720 adds a new top-down 2d camera example shows off how to use lerp to make a camera follow a player's movement.


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.

grass!

Grass/Fur

showcase

This is an implementation of grass inspired by the concepts in this Acerola video: "How Are Games Rendering Fur?".

wave function collapse generationmap generationfinal map result

Wave Function Collapse on Hex Grids

showcase

This is a demo of an in-progress wave function collapse implementation. Here its generating in a hexagonal grid.

graybox

Graybox

showcase

This is a graybox level layout built using bevy_mesh_terrain_editor.

audio tooling

Audio debug tooling

showcase

This is some custom audio debugging tooling built with egui

  • left pane is a list of all sounds in game
  • right pane is a place to change the level, replay a sound, and save the adjustments
  • bottom pane has a list of the last 10 sounds to play with most recent to the right
map generationmap generation

Noise generation

showcase

Noise generation with an interactive debug menu in preparation for map generation.

navmeshvleue_navigatormany agents

Navigation Meshes with Polyanya

showcase

This demo is preparation work for NavMesh pathfinding crate releases.

The first demo is spawning random obstacles made from extrude primitive shapes from Bevy, updating the NavMesh several times per second, and recomputing all paths at every update, all that running at 120fps. While the second demo shows off many different agent operating at once.

There is also a wasm-based demo you can run in the browser.

The code is on GitHub and is using a Polyanya implementation. Both repos have additional links to references should you want to understand what's happening at a deeper level.

network traffic dissector

Network traffic dissector

showcase

This is a work-in-progress network traffic dissector for netcode + renet2 + replicon in Lua. A dissector is a Wireshark concept, which is a network protocol analyzer application. The goal is to open source this work in the future.

map generatormap generator

Map Generator

showcase

A map generator built from MarkovJunior grammar. The goal was to evoke walking through a big valley and the mesh generation and layout generation are separated. Layout and mesh generation as well as the MarkovJunior grammar are all covered in more depth in the Discord thread including some code samples.

3 body simulator

3 body simulator

showcase

This person's first foray into Bevy and Rust was building a 3-body simulator. They intend to clean the code up a bit before sharing it.

chalkboard

Chalkboard Audio

showcase

A chalkboard application that uses the mouse speed to adjust the sound of chalk hitting the chalkboard. It uses Bevy's native audio implementation.

lidar Suzannelidar-rslidar bistro

LIDAR

showcase

This LIDAR-style effect uses a custom render pipeline to render points and order-independent transparency to compose them which means no transparency sorting. The points are in a PointCloud component and it respects culling.

raycasting 2d2d raycasting2d portal mirrors

2d raycast-based rendering

showcase

Raycasting is used to power this 2d shader implementation. For each pixel a ray is cast from the player to that pixel, and then what it collides with is used to decide its colors

Crates

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

bevy_svg_processor

crate_release

bevy_svg_processor enables working with .svgs with the rendering simplicity and performance of raster images like .png.

// Enable AssetMode::Processed 
// and add the SvgProcessorPlugin
app.add_plugins((
    DefaultPlugins.set(AssetPlugin {
        mode: AssetMode::Processed,
        ..default()
    }),
    SvgProcessorPlugin::default(),
));

// Spawn your svg!
commands.spawn(SpriteBundle {
    texture: asset_server.load("warrior.svg"),
    ..default()
});

glam 0.28

crate_release

glam is a foundational crate when it comes to the Bevy ecosystem. This is probably most visible in the Vec types Bevy consumes and re-exports, like Vec3.

v0.28 brings AArch64 NEON SIMD support as well as a couple smaller breaking changes.

Its too late for this glam release to make it into Bevy 0.14 but the improvements should filter through the ecosystem (for example, encase) in time for 0.15.

HillVacuum

HillVacuum 0.2.5

crate_release

HillVacuum is a 2d map editor inspired by the TrenchBroom editor.

The releases add new documentation as well as the ability to edit texture animations independently of selected brushes.

bevy_scriptum 0.5

crate_release

bevy_scriptum adds scripting language support to Bevy, including Rhai and Lua.

0.5 brings the Lua support and introduces a documentation book

bevy_mod_picking

bevy_mod_picking 0.19

crate_release

bevy_mod_picking adds picking to Bevy. If you want to hover, drag, or click entities in your Bevy App then you're looking at the right crate. There are ongoing efforts to upstream some of this functionality into Bevy.

0.19 introduces a new render_to_texture example to show how to render viewport textures that support picking and relaxes the requirements for egui and rapier, allowing the use of a wider range of compatible crates.

No devlogs this week

Educational

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

Bevy Cheatbook updates

educational

A bunch of Bevy Cheatbook updates in various areas. New updates for Bevy 0.14 are under way as well.

Using tracing to profile a Bevy project

educational

This post covers Bevy's built-in capabilities around using tracing and outputting chrome-compatible traces.

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