This Week in Bevy

What happened this week in the Bevy Engine ecosystem

Links

Rust Conf, Space Games, and UI crates

2024-09-16

Back from Rust Conf its time to catch up on another week in Bevy!

A Bevy meetup happened in-person at Rust Conf featuring Tiny Glade demos and a Q&A session from Alice, and there was a Bevy talk “Shooting Stars! Livecode a Game in 30 Minutes” presented at the conference. Videos will go out sometime in the future.

The community also responded to Bevy's 4th birthday post this week. The posts were collected in the Community Reflection on Bevy's Fourth Year post on the Bevy blog including Alice's Dream Job post and more from the community.

Assets

Asset documentation is getting a boost in a number of PRs (including #15057 (AssetMode)) and with that newfound clarity some modifications are being made as well. In #15090 the LoadAndSave asset processor was deprecated and replaced with LoadTransformAndSave, with IdentityAssetTransformer being a nice tag along.

AspectRatio

#15091 improves AspectRatio with a few new constants: SIXTEEN_NINE (16:9), FOUR_THREE (4:3), ULTRAWIDE (21:9), and some great error messages. These are used under the hood for various image and projection use cases and can also be used standalone.

UiImage rect

ui image rect

2d rendering and UI get closer together as UiImage gets a rect field, allowing the selection of areas of an image. There's a full demo in the PR for this one.

Ui Material border

ui material border

#15120 adds to the ui/ui_material example by drawing a border in a UiMaterial using the uv coordinates and a fragment shader.

StateScoped Events

#15085 added state scoped events that will be automatically cleared when exiting a state. Useful when you want to guarantee clean state transitions. Currently you can add events with add_event.

fn setup(app: &mut App) {
    app.add_event::<MyGameEvent>();
}

In 0.15 you will be able to add a state-scoped event, which will cause events to be automatically cleared when exiting a state.

fn setup(app: &mut App) {
    app.add_state_scoped_event::<MyGameEvent>(GameState::Play);
}

Observers

#15066 adds an observer function to the Trigger type that is required to be the first argument in an Observer. This returns the entity observing the triggered event, which in turn would allow an Observer to delete itself.

fn my_observer(trigger: Trigger<MyEvent>, mut commands: Commands) {
    if trigger.event().done {
        commands.entity(trigger.observer()).despawn();
        return;
    }
}

Projections

The OrthographicProjection default values have been oriented around 3d for awhile now, with the 2d defaults being set by the Camera2dBundle default instead. This has caused 2d users to need to re-define the near and far clipping plane values when setting other fields like OrthographicProjection::scale.

There is no good near and far values that work for 2d and 3d at the same time, so in #15073, the default was split into default_2d and default_3d.

projection zoom

There's also a new projection_zoom example showing off Orthographic and Perspective zooms and the orbiting example now lives in camera/camera_orbit

EntityRef::components

#13127 describes new methods for fetching components focusing on a specific ergonomic approach: accessing components related to an Entity more directly.

#15089 implements ready-only access in this way on EntityRef.

let (transform, player) = world.entity(entity).components::<(&Transform, &Player)>()

More triangles/vertices per meshlet

In #15023 meshlets gained an increase in max vertices/triangles from 64/64 to 255/128. This results in a greater percentage of triangles with a maximum triangle count (128).

As usual the PR has great descriptions of what tradeoffs are being made and additional details.


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.

orbitplanetsorbits

Orbit tessellation

showcase

Orbit tessellation and a new gas giant and ring shader. Using gizmos to visualize the segments of the orbits and the red lines to visualize the viewport.

building tools

Project Harmonia: editing, undo, and redo

showcase

Project Harmonia added the ability to edit and remove previously spawned walls, along with an undo/redo system.

The undo/redo system implementation is linked in the Discord thread.

rusty lander

Rusty Lander

showcase

A work-in-progress lander game with a main menu, gameplay, and game over screen.

planetplanet with atmosphere

Planet Generation

showcase

A generated planet with atmosphere.

locked doordotted wolfdotted locked door

Sneak Peek

showcase

A couple months of work went into this demo which has some interesting terminal-based rendering and the ability to make files that become entities. It also takes advantage of lua and yarnspinner.

tower defense

Tower defense game

showcase

A tower defense game with an objectives panel and more.

bevy ui html like templating

html-like templating for bevy_ui

showcase

Hotreloadable, HTML-like templating on top of Bevy UI. No widgets, just the tools to build them.

menumenu

CSS for Bevy UI

showcase

A work-in-progress style and animations crate that enables applying styles directly to standard bevy_ui nodes using css.

terrainterrain with cube

Procedurally Generated Terrain

showcase

bevy_terrain_test is terrain deformation with splines and shapes.

4-up

4-up cameras

showcase

Early problem solving for a future Bevy app: 4 viewports and bevy_panorbit_camera plugin for the orbiting.

health bars

3-layer health bar

showcase

3 separate bars stacked on top of each other make up the background and two bar layers. The frontmost layer responds instantly while the second layer eases in with a quadratic easing.

space

Stars and Planets

showcase

A screenshot from Cosmos: A multiplayer block-based space exploration game in active development. The skybox was enabled by spacescape

inventory

To Build a Home: Inventory

showcase

A new UI for inventory in To Build a Home.

hudhud in blenvy

HUD in Blenvy

showcase

In progress work on a HUD in Blender, using Blenvy to set up the materials to give it a pre-rendered look.

carcar fallingworld destructioncar moon

Cars on Destructible Planets

showcase

The large-scale destruction of planets using user-driven choices. Following the decimation of the planet, a car drives around the planet and can fall off into the gaps that were created.

More updates were posted in a Discord thread later this week.

Generic stat tracking

showcase

An unreleased crate that powers arbitrary stat collection that can be modified through commands or events. The crate can be used to track player play time, enemies defeated, crops planted, games won, different types of crops harvested, etc

commands
    .entity(entity)
    .modify_stat::<EntityStats>(
        EnemiesKilled,
        ModificationType::add(5u64)
    );
mud

Untold Dawn

showcase

After several months of hard work, Untold Dawn is getting ready to open for pre-alpha this October 5. Untold Dawn is a next-generation Role-Play Intensive (RPI) Multi-User Dungeon (MUD) game developed in Rust, using Bevy as its engine.

MUDs are multiplayer, persistent text-based games, which can trace their origins back to 1975. They are played through telnet or dedicated MUD clients, making them ideal to work on nearly any device without requiring any graphics cards or the like. If your device is connected to the internet, it's very likely you can play a MUD.

devlogs are also available.

underground lightingaboveground

Underground lighting

showcase

Short demo with underground lighting. Bevy really is such a joy to work with!

3d platformer3d platformer3d platformer

3d Platformer

showcase

A few months of work on a new 3d platformer. Its a timed run so get jumping and don't fall in the lava.

path

Dungeon Raid PoC

showcase

Inspired by an old mobile game called Dungeon Raid, this game provides a twist in its path selection mechanics.

fracturemorningstar

Fast fracture simulation

showcase

Morningstar is a fast dynamic fracture using position-based rod-bonded discrete method. Links to the relevant PDFs are available in the GitHub repo.

water shader

Waves

showcase

Overhauling the water shader in this rollercoaster tycoon style game.

surface netssurface nets

Marching cubes or Surface Nets?

showcase

This demo started out using the Marching Cubes algorithm before trying out a new Surface Nets based approach using fast-surface-nets-rs.

Surface Nets is an algorithm for extracting an isosurface mesh from a signed distance field sampled on a regular grid.

fractals

Fractals

showcase

A zooming fractal application with arbitrary precision and resolution.

monsters

Monster Animations

showcase

Animated monsters chasing the camera in a city-style environment. The city in the background is a 3-layer parallax shader using a plane for the sky and spherical projections for the rest.

radiance cascadesradiance cascadesradiance cascades

Radiance Cascades and bevy_motiongfx

showcase

A demo of bevy_radiance_cascades combined with bevy_motiongfx.

tetris2d wallspongother game

2D physics sandbox

showcase

A 2D physics sandbox with Lua scripting, custom tools, and a package system (for distribution of third party scripts, tools, etc).

A demo of the lua scripting is included in the Discord thread.

velyst

Velyst Demo (Bevy + Typst + Vello Ui)

showcase

velyst is a work-in-progress crate that combines Bevy with Typst and Vello.

world generation

RPG world generation

showcase

Performant, deterministic, infinite world generation for an RPG game.

sand simulationsand simulation with water

Sand Simulation with Water

showcase

More on the sand simulation from last week, this time with water!

Crates

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

avian_interpolation

avian_interpolation

crate_release

Ever had your character jitter around when making the camera follow them? Is your game using Avian sliiiightly choppy whenver something moves? avian_interpolation may be for you!

If you use Avian physics and don't directly mutate any rigid body's Transform manually, adding this plugin will automagically make stuff smoother for you. Note that this was developed for the coming Avian release and as such depends on Avian's main branch until then. This also means no crates.io release until then.

unbug

crate_release

unbug provides programmatic breakpoint macros in a similar fashion to some of the asserts in Unreal engine. Breakpoints require nightly Rust and the core_intrinsics feature.

bevy_rustysynth

crate_release

bevy_rustysynth allows you to play MIDI files and soundfonts in your game! The demo in Discord has some scary monsters and nice sprites.

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