Bevy 0.7: data oriented game engine built in Rust
bevyengine.org
bevyengine.org
Some examples. What are commands? What is the world? How should I be creating and destroying objects? How do I ensure some systems run before others? How should I delay loading most of the systems until a button is pressed on the first screen? How do I unload systems? How do I pass information between systems?
I'm not looking for someone to answer all of these questions, I just want to know where I'm supposed to read about them because I feel like I'm missing some important docs.
The Unofficial Bevy Cheat Book looks promising because it appears to explain some of the core concepts. However, it is weird that I have to read an unofficial book to learn these things. Without the Unofficial book, where was I supposed to learn the coordinate system convention or how to use events?
IMO you should only really bother with Bevy right now if you find it inherently interesting and you are down to dip into the source sometimes. Even in the universe of Rust based ECS game engines there are more stable and documented options.
These are absolutely reasonable concerns, and a centralized, first-part introduction to the core concepts is essential.
I'd be cautious towards Bevy; it's a product that capitalized with great success on hype; there's nothing inherently wrong with that (I don't doubt at some point it will reach a stable point), but it should be clear to users that it's currently "very alpha" (that said, I'm happy to report that Bevy made huge strides in stability/usability between v0.5 and v0.7).
But, in my half educated opinion, it creates a massive amount of unnecessary complexity for many types of games. If you are making something pretty basic like pong/pac man/ simple 2d rpgs, etc, you just have all this infrastructure and all these new paradigms when all you wanted was a way to efficiently load and draw sprites and play sounds.
But it's potentially not idiomatic within the Rust language, at least at the moment (as mentioned in the OP). However, I think that the tide is likely to turn on that; for example, in the api-guidelines repo, there's a PR[2] to remove this advice. This appears to have stalled, although that appears to be not for reasons of it being controversial, just lack of reviews; the discussion had broad support.
We have discussed (in Discord[3]) a kind of 'internal' `Deref`, which would use lenses to do automatic unwrapping for queries. See #4413 [4] for an example of what this would look like. I'm not sure how necessary that is if we can just use `Deref[Mut]`, but it's definitely another angle we could go down long-term.
[0]: https://bevyengine.org/news/bevy-0-7/#deref-derefmut-derives
[^1]: This newtype requirement isn't a negative for bevy, since it makes it much easier to avoid interoperability headaches between different crates.
I don't think there's a whole lot of value in that design, but that's my personal opinion having built an engine for the Lua community that did somethings no one else was doing.
Mainly, providing an out of the box experience for, typically, hobbyist developers who don't actually know anything about multiplayer serialization or prediction, etc.
The sort of younger developers and people who are playing around with code and posting on Reddit and such.
A lot of engines are just wrappers around popular libraries and I don't know if there's a tremendous value around that sort of thing.
Consider, for example, audio. It's really easy to provide audio bindings to, I don't know, let's say OpenAL, because I don't know what else is used these days. But game developers eventually mature enough where they don't just care about playing audio.
What they'll eventually want is to play a sound, with DSP, and have that audio automatically networked by the engine to play on different connected client's based on visibility rules or at least a simple emit sound networked event.
There's an entire class of hobby engines that don't consider these things, and leave it as an exercise for the user to implement. They are entirely non-trivial features that the users will never implement, though, and instead just never pursue that feature because the engine doesn't provide it.
I wrote a VR GMod clone[1] based on Source2/SteamVR Environments, mostly in lua, with some basic HTML/JS/CSS for Panorama UI components, incorporating the usual art assets updated/ported for Source2 made by kind artists from the community with their permission. My work was mostly to re-write the physics gun and toolgun with UI/controller input bindings to the physics engine and my custom UI. Of course, all of the hard work is credit to the teams at Valve.
[1] https://steamcommunity.com/sharedfiles/filedetails/?id=20429...
I'm also the author of Planimeter's (previously Team Sandbox's) Half-Life 2: Sandbox reference implementation, which was the first Source engine game to use LuaJIT.
We also ported the base code to allow users to use Lua in other games as a Valve Server Plugin. It relied heavily on reverse engineering.
Once it's not prohibitively expensive to run raytracing in VR, we're going to see some cool stuff.
> The story is similar for networking. Ultimately we will have a built in api, but we're focused on more fundamental things at the moment. There are _tons_ of community-developed networking plugins though: https://bevyengine.org/assets/#networking
That is, we do definitely want to make multiplayer work properly, and our data design should give us inherent advantages here. But it hasn't been a priority so far, as we've had other more pressing requirements (e.g. animation this release).
But a lot of what you want should in the medium term be provided by external crates; our use of systems as the unit of logic should make this viable, as behaviour implemented by the engine is not special. These external crates could potentially be made official if that made sense, but that's for much longer time scales.
https://github.com/peterholko/bevy_tokio_tungstenite/blob/ma...
So, doing something like:
entity:networkVar( "health", 10 )
-- ...
local health = entity:getNetworkVar( "health" )
entity:setNetworkVar( "health", health - 2 )
Does exactly what you'd expect.You can set the console variable `tickrate' and, that too, does exactly what you'd expect.
It's like saying "The problem is difficult," it doesn't inform anyone and no one learns from it.
Further, most advanced engines simply allow you to construct payloads and `setReliable( true/false )` or something similar.
It's nice that you've found your niche, but Bevy attempting to follow would be a big mistake.
The abstractions you use work OK in a world where everything looks like Quake, but they're simply not universal.
An engine like yours should be built on top of Bevy, it shouldn't be part of Bevy.
And that feeling that it needs to be abstracted/genericized might be the same reason why it never gets done.
Bevy’s data oriented design seems great for the kind of stateless physics required here, but I couldn’t find any physics OR networking features in a quick five minute browse. Is this something that is well supported by Bevy today, or will be in the future?
It supports opt-in determinism, which should be great for some networked physics scenarios.
https://rapier.rs/docs/user_guides/bevy_plugin/getting_start...
The story is similar for networking. Ultimately we will have a built in api, but we're focused on more fundamental things at the moment. There are _tons_ of community-developed networking plugins though: https://bevyengine.org/assets/#networking
The only question concerns the missing last paragraph: what's next on the roadmap? Is a UI overhaul (and an early stage editor) happening soonish?
Some of my priorities for the next 3-month release cycle are: high level render targets, asset preprocessing, a new "stageless" ECS scheduler, multi-track animation playback / blending, and bevy organization scaling.
I like asking this because while a whole bunch of smaller games do a great job showing examples of how to use the engine, larger games practically demonstrate the scalability of the engine.
As to scale, they crunch absolutely absurd amounts of data, seem to have an impressive amount of functionality, and are regularly hiring new folks from the community onto their team.
[0]: https://www.foresightmining.com/ [1]: https://github.com/emilk/egui
There are very few "complete games / apps" built in Bevy. We're still very much in the "enthusiast / jammer" phase, but we're dangerously close to working our way out of that.
To my knowledge there are only a couple of "released" full games / apps: Molecoole was very recently the first Bevy game released on Steam: https://store.steampowered.com/app/1792170/Molecoole/ Noumenal is a really cool "constructive solid geometry" Bevy-based 3D modeler on the iOS app store: https://noumenal.app/
That being said, we just had a very successful first Bevy game jam: https://itch.io/jam/bevy-jam-1/
We also have a number of nice open source games listed in Bevy Assets: https://bevyengine.org/assets/#games
And there are a lot of Bevy games listed on itch.io: https://itch.io/games/tag-bevy
The main advantages right now would probably be improved performance, better cross-platform support and access to a wide collection of interoperable community plugins.
The ECS architecture and the fact that's in Rust could also be serious benefits, but for small games, those are really a matter of taste.
[0]: https://bevyengine.org/news/bevy-0-6/#the-train-release-sche...
In Bevy's case, it also helps onboard the developer into engine development too, since engine code is entirely ECS based, so engine code looks nearly identical to both user and plugin code. For your typical user, this is a bit odd, but speaking as someone who went from new to the engine to helping write the headliner features for this release in the course of just a few months, this is a surprisingly empowering experience.
[1] https://community.amethyst.rs/t/bevy-engine-addressing-the-e...
"written in Rust" won't make the game by itself
Some of the larger distinctions:
- Everything lives in the ECS
- The ECS is incredibly ergonomic: basically just structs and functions
- Systems are automatically run in parallel based on their type signatures
- Rendering is powered by a composable rendering graph
- Everything is modular, and engine code looks like user code
- A culture that cares about genuinely good, up to date docs
As we grow to properly cover more areas, this list will grow. I'm one of the core contributors to Bevy and I can assure you we're not interested in writing "yet another game engine" <3
> As we grow to properly cover more areas, this list will grow. I'm one of the core contributors to Bevy and I can assure you we're not interested in writing "yet another game engine" <3
Rust people gotta be Rust people, that's sad
Also, one of the main reasons I'm interested in Bevy is that the engine is modular, pluggable, and extensible at the core renderer level, which is nice for those of us experimenting with different rendering techniques. Unity in particular is not a good fit for this type of thing.
This aside: if we assume the speed gains in future computing will be more about number of cores than CPU frequency then using a language which has some guarantees around concurrent code and data races is probably not a bad idea. It is really quite easy to shoot yourself into the foot when you run parallel code in traditional systems programming languages.
Right now, the team who is seeing the most success with Bevy are actually building CAD software! They needed something powerful, fast, incredibly flexible with "game-like" functionality.
That said, from talking to the hobbyists in the community, they like Bevy because it's:
- code-first
- written in Rust (C# is fine, but Unity's C# is something of a DSL, and game engine C++ is really rough)
- cares about good documentation and a helpful learning experience
- supports them in contributing fixes to issues they run into
- is incredibly flexible: you can just swap in your own physics or rendering to realize that weird idea you had, or just for the learning experience
Someone liked the idea of writing a game engine in Rust and so they did. I wrote my own sidescroller engine when I was 16 as well, although there were existing things around and it thought me a great deal about how to tackle multiple classes of problems.
Now the bevy devs seem way more experienced and if there was already a game engine that ticked all their boxes they might not have started developing a new one. But the point here is: Not everything is a product with an clearcut target audience — and not everything has to be.
Projects like these ultimately help the whole field of game engines to move on and innovate.
Unity in particular was a meme for the last generation due to CPU-based stuttering.