16 votes

Any Bevy (the rust game engine) users here?

Bevy just released their version 0.11, so I figured it would be a nice opportunity to ask the Tildes gamedevs if they were using it :)

Bevy is a rust game engine - more like a set of libraries actually - that's been gaining popularity the last few years. It has become the de facto toolset if you want to make a game in rust. It is very opinionated towards Entity-Component-System (ECS), and uses the pattern to facilitate parallelism and multi-threading.

Personally, I'm using the bevy-ecs lib (not the whole engine) to write a roguelike and hone my skills in rust. I enjoy it but it's not really beginner-friendly. The official docs are lacking, and you'll have to dig in the auto-generated api docs to make the most out of it. However, I appreciate that each release not only brings new features, but also refines existing ones. The engine is getting better - not only bigger - release after release.

7 comments

  1. Jakobeha
    Link
    I'm not using it now (don't really make games) but I'm definitely watching it and I hope it succeeds. I like how it's very well-designed and encourages good design and clean code. I also like how...

    I'm not using it now (don't really make games) but I'm definitely watching it and I hope it succeeds.

    I like how it's very well-designed and encourages good design and clean code. I also like how it's open-source and community-driven (every release has 100+ contributors), while at the same time it seems to have a solid organization and roadmap. I may be biased towards "written in Rust", but I imagine Bevy is a lot less buggy than Unity or Unreal or Godot; I've heard horror stories about things broken and workarounds in these game engines. Being much newer, it has the potential to grow into something more reliable.

    That being said, I do think Bevy is a lot harder to get into than other game engines, not to mention it's still very new. Besides being written in Rust, there's also no visual editor or source code hot reloading, which makes development much less interactive and iteration much slower, which is really bad when developing a game. Semi-related, I'd also like Bevy to have a scripting language; I'm a big fan of Rust but still, it's not the best language for everything, and while some parts of gamedev need to be "blazingly fast" a lot doesn't (case in point: Unity and Godot use a scripting language)

    Even in a big team of competent people, you don't just have software developers; you have designers, artists, musicians, and others who aren't very familiar with code. These people can work in visual editors, but expecting them to write idiomatic Rust code is a hard ask. Bevy does a lot to be accessible and present a clean API, but being non-interactive and requiring Rust's lifetime rules are inherently big obstacles.

    Regardless, for anything more than a small game (and maybe even then), I'd absolutely choose Bevy over Unity or Godot or any other general game engine. It has a very clean API, uses ECS (as mentioned), it's already grown a decent-sized ecosystem with crates specifically designed to work with bevy (like the recent Bevy XPBD), and it's all open-source. And most importantly (/s, kind of), it's written in Rust.

    7 votes
  2. [2]
    click
    Link
    I’m nowhere near experienced, but I’m currently playing around with Bevy and a bunch of its libraries to create a simple 3D game, mainly for fun and to learn rust practically. Renet for...

    I’m nowhere near experienced, but I’m currently playing around with Bevy and a bunch of its libraries to create a simple 3D game, mainly for fun and to learn rust practically.

    Renet for networking, Rapier for physics (and character controllers!?), Dolly for advanced cameras. I love how the ecosystem is at the sweet spot of new enough to still be super rough around the edges and rapidly change, but old enough to offer a suite of libraries for newbies to play around! Its enough to start learning if you have prior programming experience, anyways.

    The ECS model of game development also really speaks to me too as a developer familiar with the MVC way of doing things.

    You’ve probably already seen this, but I can highly recommend tantan on YouTube, he’s using Bevy to create a 3D Voxel ROG game similar to cube world!

    3 votes
    1. 0xSim
      Link Parent
      Actually I have not, thanks for the recommendation :) I rarely watch videos but that might be interesting to see how people make 3D games without a visual environment.

      You’ve probably already seen this, but I can highly recommend tantan on YouTube, he’s using Bevy to create a 3D Voxel ROG game similar to cube world!

      Actually I have not, thanks for the recommendation :)
      I rarely watch videos but that might be interesting to see how people make 3D games without a visual environment.

      3 votes
  3. [3]
    Liru
    Link
    Are there any actual good resources for developing games using an ECS system? I've been following Bevy on-and-off since 0.4, making trivially small games with it, but the lack of development...

    Are there any actual good resources for developing games using an ECS system? I've been following Bevy on-and-off since 0.4, making trivially small games with it, but the lack of development guides has been killer due to the uncertainty of if something is being done in the correct way or not. Ironically, when I had more time to try it out, it seemed like there were more articles on how to implement your own ECS library than how to actually use one properly. It didn't really help that most ECS guides were of the typical "here's a position component, here's a velocity component; wow, physics! Now go code the rest of the fucking owl" variety.

    2 votes
    1. FlippantGod
      Link Parent
      The best references are conference talks by major developers who were doing ecs before it was cool, and blogs about rolling your own by people who actually rolled their own and then ran into "the...

      The best references are conference talks by major developers who were doing ecs before it was cool, and blogs about rolling your own by people who actually rolled their own and then ran into "the inventory problem". There is also a book.

      Nothing quite like you are looking for, sadly. But if having someone to bounce stuff off of would help you can totally PM me any time.

      2 votes
    2. 0xSim
      (edited )
      Link Parent
      I can recommend Hecs - if you're willing to use rust - as a "first ECS lib"; it's small and mostly without magic. An excellent learning resource is the rust roguelike tutorial. It uses an older...

      I can recommend Hecs - if you're willing to use rust - as a "first ECS lib"; it's small and mostly without magic. An excellent learning resource is the rust roguelike tutorial. It uses an older ECS lib, but mostly the same base concepts apply, and you can follow along with Hecs.

      There are certainly a few tutorials for your language/engine of choice :)

      At a high level, an ECS is mainly comprised of 2 things: entities made up of components (bags of data), and a query engine. The query engine, be it explicit (Hecs docs) or used through dependency injection in Systems (Bevy docs) has the same goal: retrieve all entities with the same inclusive combination of components. With that, you can iterate over entities and apply logic that needs those specific components only.

      e.g a "Physics" system will indeed look like something like this

      pub fn apply_velocity(mut query: Query<(&mut Transform, &mut Velocity, Option<&Friction>)>) {
          for (mut transf, mut velocity, friction) in query.iter_mut() {
              let mut dx = velocity.x;
              let mut dy = velocity.y;
              // Clamp velocity to not go too fast
              if let Some(max_x) = velocity.max_x {
                  dx = dx.clamp(-max_x, max_x);
              }
              if let Some(max_y) = velocity.max_y {
                  dy = dy.clamp(-max_y, max_y);
              }
              // Apply velocity to position
              transf.translation.x += dx;
              transf.translation.y += dy;
      
              // Apply friction to velocity, if a Friction component is present
              if let Some(friction) = friction {
                  velocity.x *= 1.0 - friction.0;
                  velocity.y *= 1.0 - friction.0;
              }
          }
      }
      
  4. Marukka
    Link
    You might want to ask on programming.dev too. It's a topical lemmy instance.

    You might want to ask on programming.dev too. It's a topical lemmy instance.