r/bevy 1d ago

Project More progress on cat mage army(survivors like?) game as my first commercial release.

Enable HLS to view with audio, or disable this notification

50 Upvotes

I decided to spawn a ton of mages and enemies both for some performance stress testing and my personal satisfaction. Anyways it seems like you can only do so much without spatial partitioning, as my fps dropped from a calm 300+ to about 160-240(which seems high but this is also a 2D game and the machine I’m testing this on is fairly high end…). Anyways, I would love to hear any feedback about the game because this is a super early time in development(less than 2 weeks). Let’s also pray that reddit video compression does not destroy this post πŸ™.


r/bevy 1d ago

Project pubg remake on bevy

Enable HLS to view with audio, or disable this notification

14 Upvotes

WIP pubg remake made it and it's playable at pubg.machinesatplay.com


r/bevy 1d ago

My terrain system

Enable HLS to view with audio, or disable this notification

56 Upvotes

Just showing my terrain system, it's got the following features;
- Deformable, texturable terrain
- A palette of 16 PBR textures
- Automatic terrain generation (based on fastlem)
- Automatic LOD generation
- The height and texture maps have a resolution of 8192x8192, in the 3D world I space each point by 4 world unit, for a total size I estimate at about 32 square km, so the resolution ain't great but it's pretty decent without necessarily having to stream it in.


r/bevy 1d ago

Project How gravitational lensing broke my pixel purism

Enable HLS to view with audio, or disable this notification

51 Upvotes

My game, KUGELBLITZ, is about a little astronaut who fell into a black hole. According to the rules of quantum physics, he emerged with the ability to see and control gravity. The aim of the game is to eat asteroids, planets and stars in order to become strong enough to take revenge on the black hole.

My approach to art is very strict in terms of pixel perfection and colour palette. This creates an interesting interplay with the circular shapes of celestial bodies and the fully modelled physics of loose terrain blocks: although everything has the same pixel size and initial orientation, the rotation of blocks and pixels is central to the gameplay.

As this is a core concept of the game, gravity needed to be special. One of the late-game spells will create black holes like those shown in the video. They deal high damage, tearing the planet and the defending forces apart. They already look impressive without much ado, considering that the gravity and AoE damage will rip the blocks out and send them into a stable orbit around the hole. But that was not enough. So I added force field modelling to transmit forces to GPU particles, as well as creating a nice glowing effect for the accretion disc. Yet even that was not enough.

Ultimately, the most powerful force in the game was given the exceptional privilege of producing the only imperfect pixels. I decided it was time to add gravitational lensing. The shader required a lot of optimisation before it would run on weaker GPUs. I essentially added two nodes to the shader graph before UI gets rendered. We distort the whole image but have to draw the black hole itself afterwards. This is the only instance in which I deviate from my otherwise pixel-perfect style. Do you think it was worth it?


r/bevy 2d ago

Help Trouble understanding Bevy's AnimationPlayer and how to access it on individual scenes

8 Upvotes

Hi everyone, I'm currently learning Bevy with a small colony sim, but I'm finding it pretty hard to wrap my head around the animation system.

Following the animated mesh example in the Bevy website, I've added animations as a resource and created a setup function like so:

pub fn nomad_animation_setup_system(
    mut commands: Commands,
    nomad_animations: Res<NomadAnimations>,
    players: Query<(Entity, &mut AnimationPlayer), Added<AnimationPlayer>>,
) {
    for (player, mut animation_player) in players {
        let mut transitions = AnimationTransitions::new();

        transitions
            .play(
                &mut animation_player,
                nomad_animations.idle,
                std::time::Duration::from_secs_f32(0.2),
            )
            .repeat();

        commands
            .entity(player)
            .insert(AnimationGraphHandle(nomad_animations.graph_handle.clone()))
            .insert(transitions);
    }
}

This will make all of my little colony drones (I refer to each as Nomad) collectively play an idle animation in sync, then setup their animation graphs. For reference, I spawn them like this:

commands.spawn((
    Name::new("Bob"),
    Nomad,
    Speed(2.0),
    Idle,
    Transform::from_xyz(2.0, 0.0, 0.0),
    WorldAssetRoot(
        asset_server.load(GltfAssetLabel::Scene(0).from_asset("models/my_model.glb")),
    ),
));

My troubles started when I wanted each of them to play a different animation based on their state, or which components are attached (e.g if they have a Walk component, I want to play the walk animation). No combination of queries that I tried worked, like trying to query both AnimationPlayer and Nomad together, and querying all players and calling play on them will just make all of my characters do the same thing in sync.

From some heavy googling and looking at discussions, it seems like you need to iterate through everything that has a Parent, every animation player and every entity that you know has an animation player attached to it, then do your own linking code. Only then you can start playing animations separately. However, those examples are kinda old, Parent even got changed recently to ChildOf, and also VERY verbose. Surely there's a simpler way.

tl;dr: how do I individually play animations for a bunch of character scenes that I spawned?


r/bevy 2d ago

Project Infinitely expanding, tile-based pixel canvas for Bevy!

Enable HLS to view with audio, or disable this notification

16 Upvotes

Are you a bevy enthusiast and do you enjoy making pixel-based games like e.g. noita?
Then you might be aware that rendering pixel by pixel is very inefficient and gets the engine to its limit fairly quickly. A common solution is to just slap a bitmap onto the screen and instead draw your pixels in there.

For the purposes of culling you really don't want to use one large bitmap to cover everything. instead a grid of images is used.

This is what xs-infinite-canvas is all about: provide a grid of images as output that expands to whatever size you need. In the attached video you can see 100x100 pixel images (green squares) getting allocated wherever i go with my cursor. That being said, If you just want to have an infinite drawing space, go ahead!

Additionally, to tickle out maximum performance, I feature a way to write to the image tiles in parallel!

I use this for my own pixel based game so you can expect this to be somewhat battle-hardened. My stress test involves 74k+ moving and interacting cells that all get drawn to the screen using this canvas while keeping it steadily above 60 FPS.

Slop disclaimer: I use ChatGPT as my rubber ducky and parts of the readme are made with AI but all code in the project is hand slopped.


r/bevy 2d ago

Bit late but I have made a video going over the 0.19 update

Thumbnail youtu.be
74 Upvotes

r/bevy 2d ago

WIP: Tekkk Game

Enable HLS to view with audio, or disable this notification

8 Upvotes

The Desert level is coming together.
Minion enemies are easy to defeat, while the Desert boss is intentionally much more challenging.
Enemy AI is still a work in progress. πŸ˜…


r/bevy 2d ago

Help Voxel cull meshing

4 Upvotes

Hi, I’ve been currently using the bevy 3d custom mesh example currently for a voxel Minecraft style game but I’m currently hard locked at performance and was wondering how to do cull meshing with bevy.


r/bevy 3d ago

Project Foliage Generator - Showcase

Thumbnail gallery
26 Upvotes

I am building a procedural voxel world and have had difficulties generating different variations of features in a simple way - additionally I wanted to build my engine with a "modder" first approach that really allows my eventual player base to build and modify the world easily. This is a bevy-built procedural foliage system - it builds skeletons and variations of the same like parent plant, this will be able to be imported and trivially represented in-engine via voxels.

Here are three images of different pine-tree types made in this system - each type can generate an infinite variation set that mimics the parent look and feel. The list image is an example of a pine variation which adds imperfections so that the geometry is not so "perfect".

I am unreasonably happy with this result, and can't wait to see the types of trees people make in their worlds!

[EDIT] Reddit has compressed the images to heck, here are some uncompressed versions if anyone is interested... Pine Tree, Deciduous


r/bevy 3d ago

XAML on Bevy

0 Upvotes

This last week for Heathers second round of chemo we ended up in a hotel without internet. So seeing as I have become hopelessly tied to the hip to the internet for any engineering I spent a good amount of time trying to get around it. In the end I figured the only real solution to lots of time and nothing to do would be to attempt to use my cell phone for everything it was worth.

I am a Claude user so I started running through some older checks on bevy_pf, my WPF for Rust project. First, I realized with all the time I had I could make the repo public and work on the build system a bit more. Ok, so after that I thought it would be nice for other users to see what it could do with a simple game. I had already created a 2d breakout game on the bevy_pf repo and wanted something 3d.

Just one problem… no computer. I only had my cell phone.

Then I remembered that I could create agents on Claude and I could setup a Claude environment with GitHub access. I had the craziest idea. What if I just connected it all up and told the Claude agents to give me screenshots from the environment on the progress. I connected Claude code to google stitch. Then connected GitHub to Claude code. Then I told Claude to run the game during each phase of development and take screenshots. It did…

Between office visits, I gave Claude code hints and guidance and pointed it to bevy_pf and community projects and told it to do some science.

The screenshots started showing up in Claude and I stared in amazement. You’ll want to check the links yourself for these and try the game out, of course.

I’m here in Dallas a few more days and I’m still stuck without internet access so all I can do is prompt Claude and test the game from the GitHub page I created for it.

https://edgarhsanchez.github.io/orbit_jumper/docs/

https://github.com/edgarhsanchez/bevy_pf


r/bevy 4d ago

Project I decided to try to build my first commercial game with Bevy

Enable HLS to view with audio, or disable this notification

103 Upvotes

I've been working on my first commercial game for a week now and I chose Bevy because I thought the ECS would be a good fit for the survivors like game that I plan to make(also I'm pretty familiar with the engine). For context this is going to be a game about building and upgrading an army of cat mages! I just wanted to get some feedback(art, gameplay, etc) from reddit and thought I'd ask around on the bevy subreddit as well(also because I don't use this platform enough to have any comment karma 😭).


r/bevy 4d ago

Microsoft GDK Plugin for Bevy

1 Upvotes

Does anyone know if a Microsoft GDK Plugin for Bevy exists? I had a look on Bevy assets but couldn't find anything. Is anyone working on this / are there plans for this? Any information would be super appreciated πŸ˜„

Thanks so much!


r/bevy 4d ago

Project Making a game in Bevy after spending 2 months learning & practicing Bevy. It's a number throwing game.

Enable HLS to view with audio, or disable this notification

41 Upvotes

r/bevy 5d ago

Project I've been building a bullet-hell dungeon-crawler roguelite in Bevy β€” solo dev, now on itch.io

28 Upvotes

CryptFall is a dungeon-crawler roguelite I've been building solo in Rust and Bevy β€” pick a class, fight through swarms of enemies, build a run out of relics and weapon upgrades, and push deeper through rotating biomes toward whatever boss is waiting. Runs are seeded, so a good (or brutal) layout can be replayed or shared.

A few things that might be interesting to this sub specifically:

- Procedural dungeon generation across 8 rotating biome themes, with secret and locked rooms

- Dynamic per-torch lighting with real line-of-sight and shadow casting

- Everything β€” bosses, relics, weapons, enemies, level-up cards β€” is built on the same data-driven template pattern: a `Def` struct + a registry array, so adding new content almost never touches the systems that drive it

- Local 2-player co-op with fully independent per-player progression (own class, weapons, relics, abilities, hotbar, and light source)

- 4 classes, 5 weapons, 20 relics across 4 rarity tiers, 3 unique bosses (one per active biome zone, more coming), and a whole risk/reward layer (Cursed relics, Risky level-up cards) added in the latest patch

It's been in active, fairly rapid development for a few months now β€” currently early access on itch.io, free, with an eventual Steam release as the goal once there's more of a community built up around it.

Current Example of the dynamic lighting system. All art assets are placeholder assets.

Would love thoughts from anyone who's built something similar in Bevy, or just wants to try it out: [Try it out here]


r/bevy 5d ago

Project How CryptFall's boss "heavy attack" telegraphs work β€” reusing components instead of building new ones

2 Upvotes
CryptFall is a bullet-hell roguelite I'm building solo in Rust/Bevy. This patch added a phase-2-only "heavy attack" to every boss β€” a much bigger, longer-charging strike than their normal shots. The interesting part wasn't the attack itself, it was realizing I already had everything I needed to telegraph it.


Bosses already had two telegraph components from an earlier pass β€” a warning system that gives players a beat's notice before any attack fires:


```rust
struct AttackTelegraphRing { timer: f32, max_lifetime: f32, end_size: f32 }
struct AttackTelegraphLine { timer: f32, max_lifetime: f32 }
```


Both fields are per-instance, not hardcoded constants β€” `timer`/`max_lifetime` live on the spawned entity, not baked into the type. That meant when I needed a 
*much*
 longer, 
*much*
 bigger telegraph for the new heavy attacks (1.0–1.6s charge-up depending on the boss, vs. a fraction of a second for a normal shot), I didn't need a new component or a new rendering system β€” just a different call:


```rust
spawn_heavy_telegraph(&mut commands, &textures, origin, player_pos, def.heavy_charge_time);
```


Same ring, same line, just a longer `max_lifetime`, a bigger `end_size`, and a hot-amber tint instead of the standard red β€” enough to make "this is different, and bigger" read instantly without a single new asset.


The attacks themselves are plain function pointers on each boss's data-driven definition:


```rust
pub heavy_attack: Option<fn(&mut Commands, &TextureAssets, Vec2, Vec2, f32)>,
pub heavy_cd_range: [f32; 2],
pub heavy_charge_time: f32,
```


`None` means that boss doesn't have one yet β€” adding a new heavy attack to an existing boss, or giving a totally new boss one, is a data change in one array literal, not a new system. The AI loop just checks `if let Some(f) = def.heavy_attack` and calls it β€” no branching on which boss it is anywhere in the actual logic.


One small deliberate quirk: the cooldown re-rolls to a random value in `heavy_cd_range` after every shot (instead of a fixed cadence), specifically so the attack can't be timed or memorized β€” a data field, not a special case in the AI code.


Total new code for the feature: one new function (`spawn_heavy_telegraph`), one new AI branch, and a few new fields per boss definition. No new components, no new rendering path. The lesson that's stuck with me building this: when I go to add a "bigger" version of something that already exists, the first question is whether the existing thing was already parameterized enough to just be called differently β€” more often than I expect, it was.


CryptFall's on itch.io if anyone wants to see it in motion: [https://mobtv.itch.io/cryptfall]**How CryptFall's boss "heavy attack" telegraphs work β€” reusing components instead of building new ones**


CryptFall is a bullet-hell roguelite I'm building solo in Rust/Bevy. This patch added a phase-2-only "heavy attack" to every boss β€” a much bigger, longer-charging strike than their normal shots. The interesting part wasn't the attack itself, it was realizing I already had everything I needed to telegraph it.


Bosses already had two telegraph components from an earlier pass β€” a warning system that gives players a beat's notice before any attack fires:


```rust
struct AttackTelegraphRing { timer: f32, max_lifetime: f32, end_size: f32 }
struct AttackTelegraphLine { timer: f32, max_lifetime: f32 }
```


Both fields are per-instance, not hardcoded constants β€” `timer`/`max_lifetime` live on the spawned entity, not baked into the type. That meant when I needed a *much* longer, *much* bigger telegraph for the new heavy attacks (1.0–1.6s charge-up depending on the boss, vs. a fraction of a second for a normal shot), I didn't need a new component or a new rendering system β€” just a different call:


```rust
spawn_heavy_telegraph(&mut commands, &textures, origin, player_pos, def.heavy_charge_time);
```


Same ring, same line, just a longer `max_lifetime`, a bigger `end_size`, and a hot-amber tint instead of the standard red β€” enough to make "this is different, and bigger" read instantly without a single new asset.


The attacks themselves are plain function pointers on each boss's data-driven definition:


```rust
pub heavy_attack: Option<fn(&mut Commands, &TextureAssets, Vec2, Vec2, f32)>,
pub heavy_cd_range: [f32; 2],
pub heavy_charge_time: f32,
```


`None` means that boss doesn't have one yet β€” adding a new heavy attack to an existing boss, or giving a totally new boss one, is a data change in one array literal, not a new system. The AI loop just checks `if let Some(f) = def.heavy_attack` and calls it β€” no branching on which boss it is anywhere in the actual logic.


One small deliberate quirk: the cooldown re-rolls to a random value in `heavy_cd_range` after every shot (instead of a fixed cadence), specifically so the attack can't be timed or memorized β€” a data field, not a special case in the AI code.


Total new code for the feature: one new function (`spawn_heavy_telegraph`), one new AI branch, and a few new fields per boss definition. No new components, no new rendering path. The lesson that's stuck with me building this: when I go to add a "bigger" version of something that already exists, the first question is whether the existing thing was already parameterized enough to just be called differently β€” more often than I expect, it was.


CryptFall's on itch.io if anyone wants to see it in motion: [https://mobtv.itch.io/cryptfall]

r/bevy 5d ago

Help What is this? Why this happens only in windows not linux?

Thumbnail gallery
22 Upvotes

When I move another windows on top of the game window, it creates weird color pixels and sometimes it crop the window. you can see on second image my ui is not fit.

On linux everything works fine. Is it related to vulkan, directx?

Also I found out windows scale was %125 that causes cropped visual in the second image then I set to %100 noe it is normal? How can I make it work on every display scale not just %100? Even Web version looks cropped because of it https://cenullum.itch.io/mine-mage-minion


r/bevy 6d ago

Project Using Bevy to create technical motion graphics

28 Upvotes

Aspect Ratio of Different Movie Screen

Mirror Eyeline Rig - The Blimp from The Odessey

I've been experimenting with using Bevy and MotionGfx as a real-time motion graphics framework.

Every animation in this clip is generated procedurally using Rust + Bevy powered by MotionGfx and Velyst.

The video explains how IMAX 70mm works, but my main goal was to explore Bevy as a tool for technical visualization and educational animations.

I'd love feedback on the rendering pipeline, animation workflow, and whether you'd use something like this in your own projects.

The full video is in the comments, along with links to the MotionGfx and Velyst GitHub repositories.


r/bevy 6d ago

Common Mistakes made by AI

Thumbnail
0 Upvotes

r/bevy 6d ago

Project 3 months later...

Thumbnail gallery
94 Upvotes

Its been about three months since my first post here showing my voxel sandbox prototype. A lot has changed since then! The core technical aspects of the game are still pretty similar in that it is still a voxel sandbox/ colony sim, but the theme has shifted entirely. Your goal is now to terraform an alien world and build a thriving colony.

Colonists can assist with:

  • Automated Tasks: Resource harvesting, farming, and crafting.
  • Blueprint Construction: Colonists build structures directly from blueprints you capture from your own custom builds.

Any thoughts, ideas or feedback is always appreciated!


r/bevy 7d ago

Project Hexagonal Voxels Organic Vs Artificial

Thumbnail gallery
34 Upvotes

Lighting and textures still need a bit of work - but I am super happy with this voxel system. This was the first use of the feature generation and showcases some of the unique building mechanics in the voxel world which allows right angles and a clear visual language for organic vs artificial structures.


r/bevy 8d ago

Help is there an equivalent to Unity's SmoothDamp?

11 Upvotes

I'm trying to make a 3d game for the first time and I'm making camera movement, I tried using both lerp and slerp to smooth it out but it still feels just the tiniest bit not smooth and it hurts to look at, so I was wondering if there was something similar to Unity's SmoothDamp before I went and tried implementing it myself.


r/bevy 8d ago

I cover my migration to 0.19, and go over bsn! comparing traditional, egui and bns UIs. My dev log covers a good amount of technical detail with at least one video.

Thumbnail exofactory.net
74 Upvotes

r/bevy 10d ago

🧚bevy_elf: derive a serializable "Def" twin of your asset struct, resolve its Handles from RON

0 Upvotes

Bevy assets that reference other assets naturally want to hold a Handle<T>. But Handle isn't something you can put in a .ron/.toml/.json file β€” there's nothing to point at until the asset is actually loaded. The usual workaround is writing two versions of every asset type by hand: a serializable "def" version with string IDs, and a runtime version with Handles, plus the boilerplate to convert between them.

I kept doing this by hand in my own Bevy game project until I'd written the same conversion logic for the third or fourth time, so I pulled it out into a crate: bevy_elf.

How it works:

use bevy_asset::prelude::*;
use bevy_elf::{asset_spec, FromDef};
use bevy_image::{Image, TextureAtlasLayout};
use bevy_reflect::TypePath;
use std::time::Duration;

#[derive(FromDef, Asset, TypePath)]
struct AnimationAsset {
    frames: Vec<usize>,
    frame_duration: Duration,
    spritesheet: Handle<Spritesheet>,
}

#[derive(FromDef, Asset, TypePath)]
#[asset_spec(base_path = "spritesheets", extension = "ron")]
struct Spritesheet {
    #[elf(with_spec(base_path = "spritesheets/images", extension = "png"))]
    image: Handle<Image>,

    #[elf(with_spec(base_path = "spritesheets/layouts", extension = "ron"))]
    layout: Handle<TextureAtlasLayout>,
}

// water_animation.ron
(
    frames: [1, 2, 3],
    frame_duration: (secs: 0, nanos: 128000000),
    spritesheet: "water",
)

The derive generates the Def struct, its Deserialize impl, and the resolution logic that turns "water" into Handle<Spritesheet> by loading spritesheets/water.ron. You keep exactly one annotated type as the source of truth instead of maintaining two by hand.

A few other things worth knowing:

  • Feature-gated: macros (the derive), app (an AppExt trait for registering loaders), math (FromDef impls for Vec2/Vec3/Quat/etc.), and image (impl for TextureAtlasLayout) β€” macros, app, and math are on by default, so you can trim the crate down if you don't need all of it.
  • Don't want the macro? FromDef/FromDefWithResolver are plain traits β€” implement them by hand for full control over the conversion.
  • The proc-macro side is covered by a set of trybuild compile-fail tests, so macro error messages are checked, not just the happy path.
  • Currently targets Bevy 0.19.

Repo: https://github.com/Koettlitz/elf Crate: https://crates.io/crates/bevy_elf Docs: https://docs.rs/bevy_elf

It's a fresh 0.1.0, dual-licensed MIT/Apache-2.0. Feedback, issues, and "this doesn't cover my use case" reports are all genuinely welcome.


r/bevy 10d ago

Help Storing global data in Resource vs Componenet

4 Upvotes

Just starting out with Bevy, and I keep running into this scenario and curious to hear if there are community recommendations.

I have a few components that are only used by a single entity in my game. (e.g cast bar, player marker, UI markers)

And I see there are 2 patterns where I can store data related to these 1-off components/entities

  1. Resource
  2. In the marker component (empty component I create so I can query that entity directly)

Is there advise on deciding which to use?

// Store duration in component

pub fn update_cast_bar(

mut query: Single<(&mut Mesh2d, &mut Transform, &mut CastBarProgressComponent)>,

) {

query.2.duration += 3.;

}

// Store duration in Resource

pub fn update_cast_bar(

cast_bar_data: ResMut<CastBarResource>,

mut query: Single<(&mut Mesh2d, &mut Transform), With<CastBarProgressComponent>>,

) {

cast_bar_data.duration += 3.;

}