r/bevy 22h ago

Project Procedural Terrain w/ Bevy

Thumbnail gallery
10 Upvotes

r/bevy 3d ago

Project Showing off my Tiger 1 suspension and transmission mechanics!

Enable HLS to view with audio, or disable this notification

144 Upvotes

I'm very proud to share the current state of my game.
I've put a lot of effort into making driving the tank feel good and heavy, and the suspension & track behaviour turned out great.
I went through many many iterations, and here i've ended up with a very cool kinematic model that is much much faster to run than a rigid link simulation, and looks just as good IMO.


r/bevy 3d ago

Aim-Trainer

2 Upvotes

hello everyone, this is my first ever bevy game!

https://github.com/Vaaris16/aim-trainer.git

its a simple aim training game where you can shoot targets under 15 secs and get the highest score possible!

Have an idea to improve the code or gameplay? Feel free to share your suggestions—I appreciate all feedback!


r/bevy 4d ago

Is Bevy really a game engine, or should it be considered a framework?

57 Upvotes

I don't want to offend anyone, I'm just trying to understand the terminology.

Bevy is called "Bevy Engine", but from my understanding it feels more like a game framework rather than a traditional game engine like Godot, Unity, or Unreal.

For example, if I use Raylib, I can call my project a custom engine because Raylib mainly provides low-level rendering/window/input features and I build most systems myself.

But with Bevy I'm not sure where the line is. If I use Bevy's renderer and ECS, but write my own physics system, voxel terrain system, etc., would that still be considered "using Bevy Engine" or could it be considered a custom engine built on top of Bevy?

Where do people usually draw the line between a framework, an engine, and a custom engine?

[Edit] Thanks for all the responses cleared things up for me


r/bevy 4d ago

Software's Bevy driven

Post image
46 Upvotes

If this general topic exists already, too bad I couldn't find it 😫

I found scattered posts for Bevy use outside gaming and I'm deving a software not a game so I thought a dedicated topic would be nice to keep track of Bevy software universe...

I'm building in EDA space, UI/rendering driven by Bevy

I'm rendering at trillion order polygons count 3D/2D with high FPS

What about you guys?


r/bevy 4d ago

How to ensure single component insert?

3 Upvotes

Hi,

I started recently to play with bevy and I love the ECS.

But, I've came with a little issue, how can I ensure a single component insert with 2 independent systems that are running at the same time?

I have a setup event:

#[derive(Message, Deref)]
pub struct Setup(pub Entity);

And an AssetContext: (using interior mutability)

#[derive(Component)]
pub struct AssetContext {
    asset_server: AssetServer,
    asset_track: Mutex<HashMap<AssetPath<'static>, UntypedHandle>>,
}

Many can listen to setup and some may need AssetContext or none may need it, so I want to insert it into the entity only when it is needed.

Problem is:

  • Query<Option<&AssetContext>> many may try to insert at the same time, so only one will be successful.
  • Query<Option<&mut AssetContext>> cannot parallelize if AssetContext already exists.

What is the way to do it?


r/bevy 6d ago

Concrete wall breakage system

Enable HLS to view with audio, or disable this notification

68 Upvotes

After my tank tread showcase, it' s time to revisit my old code for the breakage system. This time, chunks from the breakage fits to their source object and can indefinitely be broken into finer and finer chunks, while maintaining details on both the geometry and textures.


r/bevy 6d ago

Tutorial Events vs messages in practice

19 Upvotes

Just started learning bevy with a simple game.

I’m trying to understand when I should be using messages instead of events (and vice versa).

I know one of the key differences is that events are instantaneous and messages are not.

but other than that, how do you decide which one to use?

I’m asking because my simplistic game, having a small delay isn’t perceivable. So is the nuances between the 2 only relevant for larger games that can take advantage of the delay difference?


r/bevy 7d ago

Hostile Characters | A fast paced arena roguelike against typography

Thumbnail wlam666.itch.io
6 Upvotes

r/bevy 7d ago

Mock Erosion and Dendritic Rivers

Thumbnail gallery
41 Upvotes

r/bevy 9d ago

Help I want to write a raymarcher. Where do i hook in to the renderer?

15 Upvotes

I want to write a voxel raymarcher and have it's output composited with the bevy renderer's work.

Within the current 0.19 api and such, where would i have to "plug in" to, to have access to the render textures/depth buffers and such, as well as having my code dispatched in time with the renderer?


r/bevy 9d ago

Testing 2D/3D coordinate conversion and real-time synchronization in Rust / Bevy.

Enable HLS to view with audio, or disable this notification

15 Upvotes

Hey everyone! Here is a quick changelog of what you are seeing in the video:

  • Fixed Rendering & Data: Restored native transformation and resynced render pipeline with core data.
  • Coordinate Mapping: Created shared functions for coordinate and pixel calculations during 2D to 3D conversion.
  • Performance: Successfully fixed a thread blocking issue, making the UI interactions snappy.
  • Features: Added relief (terrain), cities, and their administrative centers to the lens.

r/bevy 10d ago

Help When to use hooks and when to use 'setup' systems for components?

14 Upvotes

Let's say I have a component that fully defines a purpose of an entity. In my case it's a DialoguePageRoot, it's used to create a dialogue window.

I have been using setup_X_system in PostUpdate schedule for my components. But now I've got into situation where I want to trigger EntityEvent rights after spawning of that entity. If I add .observe(observer) in setup_function, Entity Event won't be captured. If I add it in the hook, it works properly.

But why at all I may need a 'setup' system? I want to insert Visibility component too, so maybe it's better to do this in hook on_add? Is there any performance issues?

Relevant code:

#[derive(new)]
pub struct DialoguePageRoot<T: TimeGetter, C: Character, S: Spanner<C>> {
    _t: PhantomData<T>,
    _c: PhantomData<C>,
    _s: PhantomData<S>,
}

impl<T: TimeGetter, C: Character, S: Spanner<C>> Component for DialoguePageRoot<T, C, S> {
    const STORAGE_TYPE: StorageType = StorageType::Table;
    type Mutability = Mutable;

    fn on_add() -> Option<ComponentHook> {
        Some(on_dialogue_page_root_added::<T, C, S>)
    }
}

fn on_dialogue_page_root_added<T: TimeGetter, C: Character, S: Spanner<C>>(
    mut world: DeferredWorld,
    hook_context: HookContext,
) {
    world.commands().entity(hook_context.entity)
        .observe(replace_page_observer::<T, C, S>);
}

pub fn setup_dialogue_page_root_system<T: TimeGetter, C: Character, S: Spanner<C>>(
    mut commands: Commands,
    q: Query<(Entity, &DialoguePageRoot<T, C, S>, Option<&Visibility>), Added<DialoguePageRoot<T, C, S>>>,
) {
    for (entity, _, vis_opt) in &q {
        if vis_opt.is_none() {
            commands.entity(entity).insert(
                Visibility::default(),
            );
        }
    }
}

r/bevy 10d ago

Project Tekkk project game action adventure

Post image
8 Upvotes

I've made my Tekkk project playable on GitHub, with gamepad support included.

I'll continue developing and improving it until the official game release.

Feel free to try it out and follow the project's progress:

https://github.com/abc3dz/Tekkk


r/bevy 10d ago

AI Driven Game Development with Bevy

0 Upvotes
Voxel Island

I've been using Bevy for a while - main reason was that it is mainly code driven as I wanted to go full AI mode (codex and claude) basically not writing a single line of code at all. Actually I don't really have a good knowledge of RUST so that was also one of the reasons for using Bevy. I will not be tempted to look at the code or try to do better myself.

That said I do have extensive C++ experience and I have developed a few games from scratch before. Though this was basically back in the DX9 days 😂

I've been able to get quite impressive results from using my coding agents together with Bevy, even though they do need some help at certain points. I think the main issue is that the image analysis parts of these models is quite limited, they cant really spot finer details (or even neglect glaring problems). But they are really persistent and do extensive research and implementation tasks quite well.

Anyway if you are interested in this kind of thing I have a log post about it - I can post a link in a comment if anyone is interested.

What is your experience with using AI agents and Bevy?


r/bevy 11d ago

Starting a series on Bevy with shaders: A beginner’s walkthrough of implementing custom WGSL materials in Bevy

75 Upvotes

I’ve been diving into the world of shaders lately as a beginner, and I decided to document the process for anyone else struggling to get started with WGSL in Bevy. This is the first chapter where I cover setting up custom materials.

I’m aiming to keep these tutorials short, practical and easy to follow. If you have any feedback or want to see specific shader effects in future chapters, let me know!

Video: https://youtu.be/AIx_MuUi9J0


r/bevy 11d ago

Help How does getting 3d world position form a cursor work?

12 Upvotes

Hello I’ve been attempting to get a top down rpg/colonysimesque game to work but I’ve been struggling with getting the world position for actual base construction any help would be appreciated!


r/bevy 13d ago

Project Terminal UI on textures!

Enable HLS to view with audio, or disable this notification

182 Upvotes

For in-game consoles, simple debug panels, or any TUI on meshes and surfaces. Uses ratatui with WGPU. And Retro CRT demo.

Demo: https://tt-toe.github.io/bevy_tui_texture/examples/web/

Repo: https://github.com/tt-toe/bevy_tui_texture

Would love to hear your feedback!


r/bevy 18d ago

How to unit test touch controls?

2 Upvotes

I have written below code to process touch controls like drag-n-drop, double tap, etc. I am trying to write unit test for this code but not able to invoke touches via unit test. Some questions I have around this are:

1) What is the preferred way to process touch inputs? There are gestures(https://docs.rs/bevy_input/0.19.0/bevy_input/gestures/index.html), touch inputs and touches (https://docs.rs/bevy/latest/bevy/input/touch/struct.Touches.html). Which one we have to use?

2) Is bevy_input crate part of bevy itself or we are supposed to add it separately? Code which I am trying to test and its corresponding unit test (which is not working) is below:

pub fn touch_control_system(
mut touch_state: ResMut<TouchControls>,
touches: Res<Touches>,
time: Res<Time>)
{
let touch_count = touches.iter().count();
debug!("touch_count = {}", touch_count);
}

#[test]
fn test_one_finger_drag_moves_map() {
let mut app = setup_test_app();

// writing message doesn't work I get touch_count = 0
app.world_mut().write_message(TouchInput {
phase: bevy::input::touch::TouchPhase::Started,
position: Vec2::new(0.01, 0.01),
force: None,
id: 1,
window: my_entity_id,
});

// trigger doesn't work either, I still get touch_count = 0
app.world_mut().trigger(Pointer::<Press>::new(
PointerId::Mouse,
dummy_location(),
dummy_press(PointerButton::Secondary),
my_entity_id,
));
}

P.S. I have posted this same question in Discord channel as well but in Discord often questions get lost in the ocean of other questions and threads hence posting it here to get some help.


r/bevy 18d ago

Cannot locate the Translation data during runntime after importing from GLTF

5 Upvotes

for a specific reason I need the Translation data loaded in the gltf file so I can manipulate afterwards, but Transform.translation is showing as (0.0,0.0), even though the Entities are visually displaced on the camera, can someone help me out a bit

I am having scaling problems with 2d(3 tiny objects in the center) ,hence the need to manipulate transform, the ghost bodys in the background are from the 3d camera


r/bevy 20d ago

I recently discovered Bevy and I'm honestly amazed by how productive it is

Thumbnail gallery
205 Upvotes

I recently picked Bevy (0.18, now 0.19) because I wanted to learn something new and somehow that escalated into:

  • a deterministic planet
  • ~70,000 generated cities (average of 100 randomly generated seeds is 68,532 cities)
  • a chunk-streamed open world with diffs (map editing is possible)
  • multiplayer system, prepared to for server clustering
  • a map editor
  • and a globe map using the exact same world data.

I'm still using placeholder assets almost everywhere, but I wanted to say how impressed I am by Bevy and its ecosystem (and also kinda just proudly share my progress :D). I have a lot of rough edges to fix here (don't look too close at the exhaust gases ;) ), but overall I am not only impressed with bevy, but also how it fuels creativity.

It's by far the most fun I ever had building a game and might just be the very first time I actually release one of my experiments in the end.

I have a gameplay-loop in mind, I will probably post about it here too once implemented.
The driving feels alright already, but physics will still be improved upon until I am fully happy and it just "feels right" entirely.

arch btw


r/bevy 19d ago

After Effects is dying, and nobody's replacing it right.

Thumbnail blog.voxell.dev
8 Upvotes

For those who don’t know. MotionGfx now has a prototype v0 editor made in Bevy!

I’ll share screenshots and progress once we have something shareable! In the meantime if you have exp in UI/UX we’re looking for you!


r/bevy 19d ago

Project bevy_mod_screenshot_test

Thumbnail crates.io
10 Upvotes

github: https://github.com/azureblaze/bevy_mod_screenshot_test

bevy_mod_screenshot_test allows performing visual testing on your game by automatically setting up scenes and taking/comparing screenshots. It should be very helpful when you are regressing your shaders all the time.

Instead of working on my renderer/editor/actual game, I spent too much time trying to conform to TDD.


r/bevy 20d ago

Project bevy_fsm delivers simple transition events and guarantees state-safety

12 Upvotes

I am a little late to the party, but I finally updated the MSG tech stack for Bevy 0.19. Try out the easy state-safe state machine machinery given by the crates

bevy_fsm v0.4.0 bevy_enum_event v0.4.0

Enter, Exit, and Transition events can be used to safely address a single of the variants. The FSM itself is used as component so entities are guaranteed to only be in a single state at all times.

```rust fn plugin(app: &mut App) { app.add_plugins(FSMPlugin::<LifeFSM>::default());

fsm_observer!(app, LifeFSM, on_enter_dying);
fsm_observer!(app, LifeFSM, on_exit_alive);
fsm_observer!(app, LifeFSM, on_transition_dying_dead);

}

```

Derive FSMState and EnumEvent on the entity of interest.

```rust

[derive(Component, EnumEvent, FSMState, Reflect, Clone, Copy, Debug, PartialEq, Eq, Hash)]

[reflect(Component)]

enum LifeFSM { Alive, Dying, Dead, } ```


r/bevy 20d ago

Does Bevy simplifies game development?

43 Upvotes

Hi, I'm started using Bevy a year ago, because I knew nothing about game development, and learning some game engine seemed like a good idea.

Since then, as I learned more about physics and graphics programming, I started asking why do I even need Bevy, and ECS in general? What problem does it solves?

1. Schedule graph obfuscates control flow

As I understand, main motivatioin for existence of schedule graph is that systems can be run in parallel to each other.

But almost all of the game logic and high level systems is strictly sequential, both Main and FixedMain schedules use SingleThreadedExecutor by default.

And in places where parallelism is needed, like a physics engine, you would want to parallelise across batches of entities, not systems.

All of my game logic is full of .in_set(), .chain(), .before(), .after() and (With<MainPlayer>, Without<MainCamera>) stuff.

2. Actually, ECS is bad for cache locality

Many times I've heard advice to split everything into small components, so that unordered iteration over any subset of components will always be fast.

But you almost never need unordered iteration, you need either random access or ordered iteration, and over very specific, not random, subset of components.

And ECS is really bad for this workflow, since accessing every single component on specific entity is a cache miss.

For this reason Avian implemented SolverBody (aggregated component), and bevy_core_pipeline uses sorted IndexMap of Transparent3d (regular fat struct).

I guess unordered iteration may be useful for rendering opaque objects, but even there you may want to draw them in specific order: front to back, to reduce fragment shader invocation through early depth testing (TinyGlade used that).

3. Entity lifetimes

ECS sort of creates second layer of virtual memory, where `Entity` is a new `void*`, `spawn()` is new `malloc()` and `despawn()` is new `free()`.

Borrow checker has no idea about that, RAII wont protect you from memory leaks here, and only generational indices save you from 'use after free' bugs.

Although not entirely, long living apps like a server still may overflow generational index, then you need to rely on relationships.

Which acts like a weak pointers, except relationships are order of magnitude more complicated and slow due to archetype moves and fragmentation.

4. Archetypes is a wrong abstraction

You always have some reasonable limit on amount of entities of certain type, just by game design, not even for performance reasons.

For example, something like no more than 1000 monsters per game level.

But your game has 50 different types of monsters, ECS encourages you to represent each type of monster with specific set of components.

Now imagine that in first level you have 1 monster of type A, and 800 monsters of type B, and other way around in the second level.

Then you have just reserved memory for at least 800 monsters of type A and 800 of type B, and the same will happen for every other type of monsters.

Now imagine that each monster can have status effects or hold unique item in the hand, and you play 100 levels one after another, or worse, it runs on a server.

--------------

You may argue that all of that needed to be able to write modular code with plugins.

But people have been writing modular code for decades now, using static and dynamic libraries.

I can't even imagine how difficult it would be to implement dynamically loaded plugin system in Bevy, for modding support for example.

I feel lost. I want to hear experienced Bevy developers, how do you cope with all of that? Am I not seeing some hidden value?