Animation Graphs, Cheatbooks, and Googly Eyes
2024-03-11
Welcome to another week in the Bevy ecosystem!
This week we've got some new work on animation graphs, a lot of Bevy Cheatbook updates, and a new bevy_dev_tools
crate.
A few new crates have also been published, including an interesting path recording crate.
Animation Graphs
An implementation of RFC 51: animation-composition
landed this week in #11989
.
Note that the implementation strategy is different from the one outlined in that RFC, because two-phase animation has now landed.
Bevy's AnimationPlayer
now supports blending multiple animations together through an AnimationGraph
.
The animation-graph
example demonstrates the usage of the new blending functionality.
Bevy Cheatbook
The Bevy Cheatbook is a reference-style book for Bevy concepts. It is a major piece of the ecosystem (IMO) and got a major update (discord), including all the scheduling-related pages: Schedules, Run Conditions, States, System Order, System Sets, Fixed Timestep!
bevy_dev_tools
The bevy_dev_tools
crate was created, which marks some progress in the editor efforts. What it will become in the future is somewhat TBD, but the original issue makes it seem like easily turning developer-tools on and off is a priority.
As usual, Alice's merge train happened on Monday which dives into some of the active PRs on a maintainer level.
Showcase
Bevy work from the #showcase channel in Discord and around the internet. Use hashtag #bevyengine.
Spatial Audio with Steam Audio and FMOD
showcase
This is a spatial audio example, so its worth clicking into the Discord thread with headphones on.
The author hopes to release a Bevy plugin soon. Until then, give the demo a listen.
The Artifact Project
showcase
I'm doing an experiment by building tools to create a Voxel Game, which will be highly customizable and rich in features. I have a whole bunch of ideas, that i haven't seen anywhere yet, and i'm curious if it works out. The goal is to make a game, that is a lot of fun, and gives unique experiences, but at the same time makes it possible to be extended by you. The initial implementation will be called The Artifact Project
Armature plugin
showcase
Armatures (also known as bones) can be used for many different kinds of entities, not just "people shaped". @cake
built a new plugin to make dealing with armature setups in Bevy easier to use.
They're looking for feedback, so check this out and let them know how it works for you in the Discord thread
#[derive(Component, Armature, Reflect, InspectorOptions)]
#[reflect(InspectorOptions)]
#[armature_path("Armature")]
pub struct MyTurretArmature {
#[armature_path("Bone")]
pub base: Entity,
#[armature_path("Bone", "Bone.Neck", "Bone.Head")]
pub head: Entity,
#[armature_path("Bone.Head.Target.IK")]
pub target_ik: Entity,
}
Algorithmically-generated floors
showcase
The floors start out as 2d polygons, which are then triangulated using earcut and the 3d geometry generated in a compute task. The different floor surface types are determined by schematics/aspects which are defined in JSON. If you look closely you can see that there are black outlines which are rendered by a custom outline shader.
The goal here is to recreate the look and feel of isometric tile games from the early 2000s (think Ultima), except that the "tiles" are actually 3d models and there's actually perspective.
Some great commentary in the Discord thread here. From "why Bevy" to an entire game soundtrack, to a link to the floor mesh generation code.
Snake!
showcase
Snake is a classic game to build to learn a new engine and this is another one!
Tiny Death Star
showcase
Tiny Death Star is a pixel-art Death Star (the Star Wars kind) simulator/manager.
Descent Clone: Audio
showcase
This is another audio demo, so check out the Discord thread to hear the multiple wonderful demos.
RougePush
showcase
rougepush is a game jam game made for the 7-day roguelike challenge.
New Bevy Googly Eye Example
showcase
Well known game asset creator kenney released some googly eyes which immediately got used to create an example desk toy widget. This example got upgraded into an the official desk-toy
example in the Bevy repo.
The desk-toy example shows off some interesting usage of window transparency to achieve the effect of a floating Bevy logo with googly eyes on top of other windows. You can drag the logo around and generally play with it.
Loading screen using a second Bevy App
showcase
Tiny Glade is extremely heavy on procedural generation, which is well-known to be resource intensive. This level of resource-intensive usage at the time of loading can cause stutters as the game loads and generates. This approach uses a second Bevy App
to basically make the loading screen a separate process, isolated from the resource-intensive usage, resulting in a smooth loading indicator.
This approach is fairly unique to Tiny Glade, as Tiny Glade has been around since Bevy 0.6 and they have rendering professionals working on it who wanted things done in specific ways.
Tiny Glade uses a custom renderer and asset system. The bevy builtin asset system does have async loading of assets and it's possible to implement a loading screen without using this 2 app technique. With that said, it still has some pitfalls and this solution could still make sense even in a game that uses the bevy asset system
There's a lot of great discussion about different rendering APIs, how to get started in rendering, as well as discussion of this technique in particular and why it exists like it does.
Moar Ants!
showcase
Moar Ants! (itch) is a clicker-inspired ant colony simulation.
Source is available on GitHub under the Polyform Strict license,
Deltarune fangame
showcase
Deltarune fangame. New work here includes the pause menu and an animation system that can load animations from .ron
files.
The animation got moved into a repository on Codeberg called bevy_sprite_anim
and it includes an example of loading the .ron
files.
Gomoku
showcase
A Gomoku implementation with capture rules. You can Play Online on Itch against a programmed AI. (I definitely lost my first game).
Painterly StandardMaterial extensions
showcase
A baked custom normal map from Blender combined with a small StandardMaterial extension shader results in this painterly tree scene. If you like this result, check out some of the inspiration for your own work as well.
Jarl: indoor space detection
showcase
Jarl is a Fantasy Colony Builder with some amazing 2d lighting systems (which are available to use separately!). This demo shows a system which can detect various kinds of indoor spaces such as rooms (yellow) and caves (red).
Check out their YouTube for devlogs and other videos.
Crates
New releases to crates.io and substantial updates to existing projects
charred-path 0.1.1
crate_release
charred-path is a component-based plugin for Bevy used for recording the homotopy type of a moving object around a specified set of points in 2D.
The charred-path crate uses some generally less-familiar math to produce some really interesting use cases, especially around tracking player movement in platformers.
The charred-path crate was initially built with platformers/metroidvanias specifically in mind, but is well-suited to a number of game development scenarios. Here are a few examples:
Beta Testing
During beta testing, it can be beneficial to understand the paths that players take through a game. By recording the path of a player's character, developers can gain insights into how players are interacting with the game environment. This can help identify areas of the game that are not being explored, or pinpoint locations where players are getting stuck.
Game Logic
The path recording functionality can also be used to influence game logic. For example, you could check whether a player's character went above or below a certain platform and trigger different events based on that information.
The README includes some great explanation of the math behind the crate.
edges first release
crate_release
Edges is a new crate supporting bevy_collider_gen
. The purpose of the crate is to find edges in images with transparency.
Currently this is mostly useful in testing scenarios, as it can be expensive and not integrated with Bevy's preprocessing system.
use edges::Edges;
use std::path::Path;
fn main() {
let image = image::open(Path::new("assets/car.png"));
let edges = Edges::from(image.unwrap());
println!("{:#?}", edges.single_image_edge_translated());
}
bevy_rts_camera first release
crate_release
bevy_rts_camera
is a simple RTS-style camera controller including support for
- Pan (keyboard or mouse), zoom, rotate
- Smoothed movement
- Automatically follows ground/terrain
bevy-yoetz first release
crate_release
bevy_yoetz
is a plugin to aid in the implementation of rule-based AI. As is the case with many new crates, the author wasn't quite satisfied with how other existing crates worked, especially related to focus on state-switching. Yoetz focuses more on the data that accompanies these states.
#[derive(YoetzSuggestion)]
#[yoetz(key_enum(derive(Debug)), strategy_structs(derive(Debug)))]
enum EnemyBehavior {
Idle,
Chase {
#[yoetz(key)]
target_entity: Entity,
#[yoetz(input)]
vec_to_target: Vec2,
},
Circle {
#[yoetz(key)]
target_entity: Entity,
#[yoetz(input)]
vec_to_target: Vec2,
#[yoetz(state)]
go_counter_clockwise: bool,
},
}
Bevy Incandescent 0.1.0
crate_release
Last week we saw a 2d lighting showcase and this week bevy_incandescent
is the release of a 2d lighting plugin that powers that showcase.
Currently the plugin only supports point lights (soft shadow using PCF) and ambient light, but there's still much to do!
The author says to consider this crate experimental for the moment.
This is an experimental release, and it's NOT recommended to use this in your formal project.
source is available on GitHub
bevy-stat-query v0.0.2
crate_release
- RPG stat system
- overdesigned
- experimental
bevy-stat-query
is self-described as
An overdesigned experimental RPG stat system.
and it looks a bit like this:
let fire = Qualifier::all_of(Flag::Fire);
let fire_magic = Qualifier::all_of(Flag::Fire|Flag::Magic);
let elemental = Qualifier::any_of(Fire|Water|Air|Earth);
let elemental_magic = Qualifier::any_of(Fire|Water|Air|Earth)
.and_all_of(Magic);
moonshine_util
crate_release
Expect
performs additional checking to make sure a component is associated with all instances of the queried component. This means this system can enforce that all components withA
also haveB
.HierarchyQuery
enables entity hierarchy traversal/query. Similar to aery with a slightly different API.RunSystemLoop
is a trait for testing systems, similar toRunSystemOnce
in Bevy.
bevy_replicon_snap
crate_release
bevy_replicon_snap
is a plugin for bevy_replicon
to allow snapshot interpolation and client-side prediction.
This library is a very rough proof of concept and not meant to be used in productive games
Bevy Replicon 0.24.0
crate_release
bevy_replicon
a high-level networking crate for the Bevy game engine. This release brings the ability write your own integration with the messaging library of your choice. renet
support will remain first-party via bevy_replicon_renet
.
The full changelog is available.
Devlogs
vlog style updates from long-term projects
First 6 months with Rust and Bevy
devlog
This person decided to jump on the Rust train for the first time and dig into Bevy for 6 months. This devlog shows off a number of different part of their journey along that time including shaders, terrain, and 3d animation.
Small Town Life AI system
devlog
Small Town Life is a City/Community builder and this update covers improvements to the AI system as well as other improvements.
HackeRPG 0.1.3
devlog
HackeRPG is an arena roguelike. This devlog talks about plans for the game.
Demo is available on Steam
Solving Teleportation Bugs
devlog
A really short (60 seconds) devlog about fixing a teleportation bug.
Deprecate `SpriteSheetBundle` and `AtlasImageBundle` authored by benfrankel
Decouple `BackgroundColor` from `UiImage` authored by benfrankel
Use NonMaxUsize for non-component SparseSets authored by james7132
remove repetitive code authored by geekvest
bevy_ecs: Fix up docs for `World::run_system` and `World::run_system_with_input` authored by MrGVSV
Quality-of-life updates for running CI locally authored by mweatherley
bevy_reflect: Recursive registration authored by MrGVSV
Example for axes gizmos authored by mweatherley
remove comment in typos.toml authored by ameknite
Improve components hooks docs authored by afonsolage
Fix #12255 Updating TargetCamera on multi camera scenes not allowing layout to be calculated authored by StrikeForceZero
Fix winit control flow when re-focusing game authored by thebluefish
Add the ability to request a redraw from an external source authored by R081n
`#[reflect(Default)]` for Handle/Mesh2dHandle authored by SludgePhD
Fix failures of typos and check-cfg authored by mockersf
Update `Input` to `ButtonInput` in a couple places at keyboard input docs authored by TrialDragon
remove background color from UI example image authored by mockersf
Add WinitEvent aggregate event for synchronized window event reading authored by UkoeHB
bevy_utils: Add `BuildHasher` parameter to `bevy_utils::Entry` type alias authored by MrGVSV
Fix duplicate dependencies on raw-window-handle authored by ameknite
Support transforming bounding volumes authored by Jondolf
Rewrite part of Commands rustdoc authored by stepancheg
update comment on `emissive` field of `StandardMaterial` struct to mention large color channel values authored by bcolloran
don't depend directly on oboe authored by mockersf
Slicing support for texture atlas authored by ManevilleF
Add note about rotations for `Aabb3d` authored by Jondolf
Use floats mathed from 8-bit values in basic color palette authored by rparrett
Fix docs for atlas + slicing support authored by benfrankel
Fix `with_scale_factor_override` improperly setting `scale_factor_override` authored by chompaa
Fix green colors becoming darker in various examples authored by rparrett
Remove initialize_resource<T> and friends authored by james7132
Remove ComponentStorage and associated types authored by james7132
Fix "dark grey" colors becoming lighter in various examples authored by rparrett
Add extra_asset_source example authored by NiseVoid
Fix ios simulator support authored by mockersf
Clean up pointer use in BundleSpawner/BundleInserter authored by james7132
Clean up type registrations authored by james7132
Fix directional light shadow frustum culling near clip plane to infinity authored by rodolphito
Add bevy_dev_tools crate authored by matiqo15
We must have googly eyes (new Game example) authored by tjamaan
Disentangle bevy_utils/bevy_core's reexported dependencies authored by james7132
Fix `ImageLoader` not being initialized with `webp` or `pnm` features authored by rparrett
Use `.register_asset_source()` in `extra_asset_source` example authored by chompaa
Improve Bloom 3D lighting authored by BD103
Implement the `AnimationGraph`, allowing for multiple animations to be blended together. authored by pcwalton
Fix incorrect link in UiMaterial documentation authored by honungsburk
Fix dim emissive values in `lighting` example authored by andristarr
Fix minimal plugins in ci authored by mockersf
move ci testing to dev_tools authored by mockersf
CI testing: don't crash if screenshot manager resource is not available authored by mockersf
Improve gizmo axes example authored by mockersf
Add "all-features = true" to docs.rs metadata for most crates authored by yrns
Contribution guidelines for `bevy_audio` authored by SolarLiner
Document ButtonInput behavior regarding window focus authored by SpecificProtagonist
Fix gizmos panicking given bad output from `GlobalTransform::to_scale_rotation_translation` authored by chompaa
Remove "features" feature authored by yrns
Move AssetEvents to Last authored by hymm
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.
Pull Requests Opened this week
Refactor 'bevy_ecs/schedule' authored by tygyh
Make get_short_name return Cow instead of String (Adopted) authored by tygyh
Simplified backtraces authored by SpecificProtagonist
Allow setting RenderAssetUsages for gLTF meshes & materials during load authored by 66OJ66
Improve generic system example authored by hymm
Support closures as ComponentHooks authored by james7132
Allow retargeting audio sources on a per-source basis authored by eira-fransham
Add axes_2d gizmo. authored by lambertsbennett
Automatic registration of ECS types authored by james7132
split check_light_mesh_visibility authored by lamalmeida
Beautify example showcase site URLs authored by TrialDragon
Move aabb gizmos to `bevy_dev_tools` authored by chompaa
Fix window spawning triggering ButtonInput<KeyCode>::just_pressed/just_released authored by SpecificProtagonist
Extracting ambient light from light.rs, and creating light directory authored by nbielans
many_cubes: Add no automatic batching and generation of different meshes authored by superdump
correctly set up background color in mobile example authored by mockersf
Fps overlay authored by matiqo15
Adds Gizmo line styles authored by solis-lumine-vorago
Add more comprehensive crate level docs for bevy_ptr authored by james7132
Issues Opened this week
`Interaction::Hovered` never happens on mobile, even when it would make sense. authored by Selene-Amanita
What is the relationship between `AmbientColor::brightness` and Blender's background color strength? authored by janhohenheim
Supporting archive assets authored by viridia
ECS metadata stores should operate on `Pin<&mut T>` authored by james7132
Add a way to cache a QueryLens authored by hymm
Opening a Window on `keyboard_input.just_pressed` makes it trigger again authored by DasLixou
Explain the philosophy of `bevy_ptr` in crate docs authored by alice-i-cecile
Error in PBR shader code when VERTEX_NORMALS is not defined authored by viridia
Line Break doesn't clear trailing whitespace authored by TheDudeFromCI
Support `--quiet` in CI script authored by mweatherley
The settings is always ignored when loading assets with settings and label in path. authored by Jly13
Consistent User-Facing Errors authored by TimJentzsch
`Entities::reserve_entities` yields invalid entities that can be used for buffer overflows authored by james7132
Black Artifacts with Light Transmission Material authored by theon
Move the already existent tools into `bevy_dev_tools` and creation of new ones authored by pablo-lua
Purdue Refactoring - PBR Related PRs authored by nbielans
InvalidGenerationError authored by viridia
Asset will wrongly unload while strong handle is alive under certain circumstances authored by Litttlefish
Misleading error message if wgsl import has bad path authored by torsteingrindvik
ReflectDeserializer does not error when deserializing incomplete enum value authored by UkoeHB
Consider making `PlaybackSettings::ONCE` not the default or removing it authored by rparrett
Clarify purpose of bevy_dev_tools in crate-level docs authored by alice-i-cecile
Abstraction of bevy_dev_tools authored by matiqo15
Upstream and use bevy_mod_picking authored by alice-i-cecile
build-templated-pages crashes when run from a subcrate authored by JMS55
Opprotunistically use dense iteration when an archetype and its table are 1:1 authored by james7132
Refactor and Turn Ui tree debug into a tool authored by pablo-lua
Use the `#[diagnostic::on_unimplemented]` attribute to improve ECS (system and query) error messages authored by alice-i-cecile
Mesh with Material2D sometimes needs a few frames before being drawn authored by MacTrissy
Investigate workspace-level dependencies authored by BD103
Consider validating that docs can build as on docs.rs in CI authored by alice-i-cecile
Implement `QueryData` for `&Archetype` authored by urben1680
Implement `QueryData` for `EntityLocation` authored by urben1680
Adding a `FlatSurface` or `Rect3d` authored by EmiOnGit
Reflection: type aliases authored by viridia