Bevy: A data-driven game engine and app framework built in Rust
bevyengine.org
bevyengine.org
I'm happy to answer whatever questions people have!
I just hope that the `Turtles All The Way Down` philosophy won't hinder game devs from supporting scripting language of their choice. Because at some point someone is going to need domain specific language somewhere.
1. How ambitious is Bevy as an engine? Do you see it as aimed squarely at the casual-game space like ggez, or do you think it could eventually compete with Godot, growing more advanced features like GI? (I appreciate that competing with Unreal is probably, well, Unrealistic for the forseeable future.)
2. You talk a lot about keeping the build light, which is great to hear. Does this extend to deployment too? What kind of binary filesizes are you looking at for a "hello, world" game?
2. Small binaries is absolutely something I care about. Last time I checked we could produce a "hello world" game with windowing + rendering thats just a little bit over 1 MB. I think we could probably make that smaller with some effort.
edit for some additional clarity: this involved running a post-processing "strip" process on the binary.
The API looks great in any case, and I’ll try it out, at least as a starting point to get back into Rust and ECS. Nice work!
Harking back to ancient history for a moment, Frontier: Elite II was a AAA title for its day and was basically all code.
Their overlords always stress on developer conferences how install size is the number one reason for users to remove applications and games from their devices.
We ran LTCG on every game I shipped.
The error that I am currently facing (if you're curious):
EDIT: This is because I was using Rust 1.40 rather than 1.45. Oops.
$ cargo run --example breakout
Compiling glam v0.9.3
Compiling same-file v1.0.6
Compiling anyhow v1.0.32
Compiling once_cell v1.4.0
Compiling adler32 v1.2.0
Compiling anymap v0.12.1
Compiling crc32fast v1.2.0
Compiling remove_dir_all v0.5.3
Compiling pin-project-internal v0.4.23
error[E0599]: no method named `map_or` found for type `std::result::Result<std::string::String, std::env::VarError>` in the current scope
--> /home/myname/.cargo/registry/src/github.com-1ecc6299db9ec823/glam-0.9.3/build.rs:7:10
|
7 | .map_or(false, |cfg| cfg.split(',').find(|&f| f == "sse2").is_some());
| ^^^^^^ help: there is a method with a similar name: `map_err`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0599`.
error: could not compile `glam`.
warning: build failed, waiting for other jobs to finish...
error: build failedIn the features section would really like to see about how Text rendering is handled by Bevy. It is a big feature.
Edit: To clarify, I wanted to know if it uses any known lib (Skia) or technique (signed distance fields) for some fancy text rendering.
For anyone curious this is the game from the author:
https://www.youtube.com/watch?v=FxW4PcX0fa8
It looks like a lot of fun honestly!
I hope that Bevy users won't be forced to use the Bevy editor for coding. VS Code, vim, emacs and other editors have lots of extensions and work well for coding. I'd rather see some kind of project builder UI for Bevy, which would allow using existing code editors.
> Being able to use Rust functions directly as systems might feel like magic, but I promise it's not! You may have noticed that we do this when registering systems in our App (...)
> (...) This works because we implement the IntoQuerySystem trait for all functions that match a certain set of function signatures.
This pattern is a great example of how Rust achieves to be both very ergonomic or dynamic (in the sense of expressiveness) and type safe at the same time.
Things that come to mind are (incomplete list):
- From trait
- derive
- traits you can implement to convert a data structure into a iterator
- Deref, Drop traits, MutexGuard
These things appear magical at first but make for very expressive abstractions.
In regards to web-dev: a framework that makes heavy use of traits and macros is Rocket.
As for material: when I’m learning I typically have The Book, Rust by Example and some tabs of the standard library open. Then just go by curiosity. Perhaps not the best approach?
I don't really want to have to write my own 3d renderer or ECS because the engine's one is bad or nonexistent... this really scratches an itch for me.
Clojure take note...
For me that would be a multiplatform GUI library.
But I'm secretly hoping for a multiplatform GUI library that covers smartphones too. I realize that might be too much to ask though ;)
Color me stoked!
I'm wondering what you find not well thought out about it.
I found the application of the research -- the execution -- too early in development for my needs. I have the feeling it will grow into something more flexible with time, but at least back then, I wasn't able to render to a texture being applied to a mesh. Not being able to get around the deeply integrated ECS was hard, as well.
This was a while ago so it might not be fair as things probably improved since then and one should definitely give it a try as well.
That being said the whole bevy way of doing things looks very well considered indeed — maybe both projects can profit from each others existence?
Contrary to popular belief, the need to build your own engine is real for a significant amount of projects. I look forward to being able to quickly put together a few building blocks, customize the renderer and experiment with new systems.
Basically an ECS is not really a secret easy pattern to cache coherent data access. This benchmark shows its fast for the easy cases but says nothing about typical game requirements.
Also as a claim I also find this highly doubtful particularly as I’ve been working as a game developer for many years and not really seen it used on a single project in that time. There’s a reason why there are dozens of hobby implementations but no full scale games written using them.
Looking at that it has way more in common with an OOPish inheritance/composition approach to entities than the ECS view of an entity being a primary key into a data store of components with a pipeline of systems acting in a component centric manner to update the game state.
I was trying to see how Bevy embraced data-orientation, but I think it doesn't necessarily do so, since data orientation is more about reducing indirection, for ex., reducing or removing excessive data hierarchies. I think dod is also related to "mechanical sympathy" [2].
Edit: maybe the ECS part is the dod part? I saw the tree demo and it did not look very ECS to me. Maybe it is just the UI? :-)
1: https://meetingcpp.com/mcpp/slides/2018/Data-oriented%20desi...
2: https://mechanical-sympathy.blogspot.com/2011/07/why-mechani...
Yes, ECS' usually give you at least a good default that is data oriented. At a glance it seems like it does[0]. Notice how some systems (functions) iterate over components rather than entities, which implies a "struct of arrays" layout that benefits caching.
[0] https://bevyengine.org/news/introducing-bevy/#bevy-ecs
Also check here (in their book):
edit: and seems like I'm not the only one, as there's at least one upvote already. probably worth checking!
> "Bevy is a refreshingly simple data-driven game engine built in Rust."
The strange use of the word refreshingly implies that "bevy" could be related to beverage ... (bevy is Australian slang for beverage).
But apparently this is not the origin of the name...
> A bevy is a group of birds!
Congrats to the author on great work.
* Garbage collectors often scare game developers since they can lead to hard-to-fix latency spikes.
* Rust has some cool libraries (specs, rayon, etc.) that let you safely parallelize computation.
Over C++:
* It's a memory-safe language, which instantly avoids tons of bugs.
* Library interfaces are usually higher-level in Rust than in C++, for various reasons (sum types being a big one).
* It's a much smaller language, so there aren't any dark corners that you'll randomly be forced to learn.
* It has an easy-to-use package manager, and I'm not sure where C++ is on that front.
In the inescapable hell of n+1 competing standards.
To name a few:
https://github.com/cpp-pm/hunter
https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-201...
A reference to this xkcd https://xkcd.com/927/
Rust has other more technical advantages. But if you want to know why management is choosing it, it's because getting good C/C++ developers is a painful process nowadays.
this has the potential to be rust’s flutter! (Bevy UI)
dang, do you want to swap the link to github?
Does Rust also compile to the GPU?
There are people working on this. https://github.com/MaikKlein/rlsl
This is supposed to produce SPIRV though, Becy uses WebGPU which has a custom shading language.
Yesterday's thread on /r/rust: https://www.reddit.com/r/rust/comments/i7bcwu/introducing_be...
The big three specifically, which is pretty close to the reasoning for choosing any game engine thats not Unreal/Unity probably would be:
1. Rust
2. ECS
3. More likely to understand the damned thing
Size: Bevy is probably thousands of times smaller than UE. That is either a feature or a bug, depending on your needs.
Complexity/feature set: Bevy is a lot simpler because it's simply smaller. This of course means it's less capable. Again, feature or bug, depending on needs.
Language: UE is written in C++, so you can make games in C++ and its own language UnrealScript. Bevy is written in rust. Feature/bug depending on needs.
License: UE has a source-available commercial license, while bevy is FOSS (MIT license). A more open license is obviously better, but the commercial licenses generally come with support.
That said, I'm not a professional game developer, but am currently experimenting with the Godot engine (Also an indie FOSS engine, but a little older). I don't really like GDScript, but I can just use C++ bindings anyways.