8 ms·
Bevy 0.7: data oriented game engine built in Rust
- _cart 5y agoLead Bevy developer (and creator) here. Ask me anything!
- karmakurtisaani 5y agoWhat does data oriented mean in practice?
- elanning 5y agoThis chapter encapsulates much of data oriented design: https://www.dataorienteddesign.com/dodbook/node5.html https://www.dataorienteddesign.com/dodbook/node5.html
- piefayth 5y agoOne of my grievances with most engines is a poor story around networked physics. It’s desirable to me to be able to leverage historical physics states in a performant way, sometimes querying or stepping many modified versions of those states at once. 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?
- _cart 5y agoWe haven't (yet) prioritized an official physics plugin for Bevy, but the Rapier physics engine has their own official Bevy plugin, which is the de-facto standard at this point. It supports opt-in determinism, which should be great for some networked physics scenarios. https://rapier.rs/docs/user_guides/bevy_plugin/getting_started_bevy 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 https://bevyengine.org/assets/#networking
- lazypenguin 5y agoHi Cart, have you considered giving a presentation or writing an article about how you successfully manage the project? I remember when you first publicly released bevy and the onslaught of support you received. I'd be curious how you were able to successfully manage that as it's clear you've done that well as Bevy continues to grow at an incredible pace.
- _cart 5y agoI'd consider doing that once I feel like I've actually "solved" this problem. Adjusting to this scale of community development has been a slow and sometimes painful process. I started with a "benevolent dictator for as long as I can manage it" model and we have slowly been transitioning into a more distributed decision making process where more people are reviewing code and more people have merge rights. Currently these merge rights are very "scoped" and I am still making basically every "controversial" call when it comes to code and api design. This means that I am a bottleneck, and the pressure to resolve this increases as the community grows. I have "big plans" here that involve continuing to expand the scope of the other maintainers (Francois and Alice), pulling in even more maintainers, and empowering "working groups" to make decisions more autonomously. Expect to see significant progress here in the very near future.
- the_duke 5y agoI still haven't been able to use Bevy yet, but as always: the release notes are a joy to read and the speed of development is impressive. 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?
- _cart 5y agoHaha that was definitely a miss. We normally do include that section at the end. From a high level, breaking ground on the Bevy editor is my priority. But getting there still requires some intermediate steps (finalizing UI, scenes, and assets, which are all functional at the moment but still need some work). 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.
- The_rationalist 5y ago
- dukeofdoom 5y agoHow hard would it be to port a pygame to this? What would be the advantages?
- alice-i-cecile 5y agoIt would be a full rewrite, so moderately easier than writing it from scratch. 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.
- Waterluvian 5y agoWhat’s the largest or most impressive game shipped that uses the Bevy engine? (Open or closed source) 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.
- tomtheelder 5y agoI doubt there are projects of significant scale right now. This is a very, very young engine.
- alice-i-cecile 5y agoThe largest "game" that I'm aware of is a piece of closed source CAD software [0]. They've been thrilled with the performance and ergonomics of the code, although they're relying on egui [1] for the UI. 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/ https://www.foresightmining.com/ [1]: https://github.com/emilk/egui https://github.com/emilk/egui
- Waterluvian 5y agoWow. What a great example. Thank you!
- _cart 5y agoAs a disclaimer: Bevy is still very new, our apis are still in flux and incomplete, and we actually recommend that people don't use Bevy for "serious projects" yet in our official docs. Don't expect to see Elden Ring equivalents in Bevy for a long time. People shouldn't be staking their livelihoods on Bevy yet (although some still do because they see our value and potential ... there are a surprising number of paid Bevy jobs out there). 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/ 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/ https://noumenal.app/ That being said, we just had a very successful first Bevy game jam: https://itch.io/jam/bevy-jam-1/ 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 https://bevyengine.org/assets/#games And there are a lot of Bevy games listed on itch.io: https://itch.io/games/tag-bevy https://itch.io/games/tag-bevy
- malwrar 5y agoThis is exciting! Bevy is the rendering engine equivalent of python’s Flask module in terms of ease-of-use & flexibility, and if you’re looking to render things I think it’s a pretty solid bet to put your time into.
- capableweb 5y agoIsn't Flask a web framework for python, and at that, a quite small one? Not sure how that compares to a game framework, especially one that "forces" you to one architecture (ECS in this case). Games will always be more complicated to create and maintain than web services.
- james7132 5y agoI think it's more in terms of the ergonomics and developer UX. Both Bevy and Flask have a very minimal and surprisingly idiomatic "hello world" example, and both rather seamlessly and progressively introduce concepts, which helps onboard developers into the framework/engine. 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.
- Sparkle-san 5y agoI'm impressed by the speed of this release. I started checking out Bevy after reading Hands-on Rust[1] and wasn't expecting any updates given 0.6 came out in January. [1]https://pragprog.com/titles/hwrust/hands-on-rust/ https://pragprog.com/titles/hwrust/hands-on-rust/
- MiniaczQ 5y agoThat's because with 0.6 Bevy moved onto a 3-month release schedule :)
- djmcnab 5y agoYes, indeed. This was mentioned in 0.6's release notes[0]. However, this is the first actual stop of the train, so we probably could have mentioned it in these release notes as well. [0]: https://bevyengine.org/news/bevy-0-6/#the-train-release-schedule https://bevyengine.org/news/bevy-0-6/#the-train-release-sche...
- Shadonototra 5y agoother than "written in Rust", what it does different than the billion other open source game library? "written in Rust" won't make the game by itself
- atoav 5y agoFrom what I gathered the ECS (Entity Component System) it uses allows for great performance. 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.
- minimaxir 5y agoAlso, the gaming industry has shifted such that performance is important. Go on any gaming forum and assert 30fps and 60fps are equivalent, or a 60fps that's not stable is OK. Unity in particular was a meme for the last generation due to CPU-based stuttering.
- andrewmcwatters 5y agoThe issues hobbyist game developers face don't typically have anything to do with performance, though. The issues they face are that no one plays their games, sometimes because they're too simple, and the software toolchain they're using isn't powerful enough to help them.
- atoav 5y agoWho says this is targeted at hobbyist game developers? 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.
- djmcnab 5y agoA change I find interesting in this release is the addition of `Deref`/`DerefMut` derives[0]. It addresses a very real pain point in bevy, due to `#[derive(Component)]`'s interaction with the orphan rules requiring newtypes[^1]. 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 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. [2]: https://github.com/rust-lang/api-guidelines/pull/251 https://github.com/rust-lang/api-guidelines/pull/251 [3]: https://discord.gg/bevy https://discord.gg/bevy [4]: https://github.com/bevyengine/bevy/pull/4413 https://github.com/bevyengine/bevy/pull/4413
- ______-_-______ 5y agoI hope the tide does turn and then keeps going. I think the language restrictions around Deref(Mut) and Index(Mut) originally borne of purism are just not all that helpful in practice. I can make a network request in my Deref impl, but I can't return a smart pointer?
- Kinrany 5y agoThe danger with DerefMut is that one may accidentally allow violating the type's invariant. Same with Deref when interior mutability is present.
- andrewmcwatters 5y agoAny plans to provide out of the box multiplayer? Lots of engines today don't think about it at all, and instead seem to focus on the sort of feature set provided by Unreal and Unity. 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.
- faitswulff 5y agoI'm no gamedev, but multiplayer seems very dependent on the use case. Is your game turn based? Real time? In the case of a fighting game, do you need millisecond resolution? I'm not sure a satisfactory out of the box multiplayer experience would be something a game engine could abstract.
- andrewmcwatters 5y agoIt's a good point, but something is better than nothing. For instance, in our engine my team provides those mechanisms from the network variables associated with an entity/actor. 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.
- OnionBlender 5y agoI've been trying to learn Bevy on and off for months but I'm finding it difficult. The official Bevy Getting Started tutorial is very short. I've looked through many of examples but I find them difficult to follow because I'm not familiar with how Bevy wants you do to things. I find that the API docs don't explain what things are used for. I feel like I'm missing some core concepts but I don't know where I'm supposed to learn them. 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?
- dhruvdh 5y agoYou would probably benefit from watching a talk or two on ECS (Entity component system).
- gameswithgo 5y agoIn general in Rust game engine culture right now there is a strong trend towards using entity component system based design. Sometimes this is a definite good thing, for certain kinds of games it can have benefits both for performance and coding niceness. Entity component systems also play nicely with Rust's borrow checker. 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.
- tomtheelder 5y agoAs another commenter suggested I think a really solid foundation in ECS architecture will get you some of the way, but you're totally right that the documentation is sparse. I think the engine should really be thought of as being in alpha right now given how rapidly it's evolving and how unstable different APIs are. I suspect at some point the docs would stabilize. 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.
- rosenjcb 5y agoThis reminds me a lot of Amethyst.
- qchris 5y agoThat's very understandable--there has been a significant amount of influence from Amethyst on Bevy's design[1], and a number of members in that community have ended up joining the Bevy project in one way or another. Cart, the lead Bevy dev, has a comment in the linked thread. [1] https://community.amethyst.rs/t/bevy-engine-addressing-the-elephant-in-the-room/1645 https://community.amethyst.rs/t/bevy-engine-addressing-the-e...
- deleted 5y ago[deleted]
- alserio 5y agoFor everyone who's following this awesome tutorial has been updated: https://mbuffett.com/posts/bevy-snake-tutorial/ https://mbuffett.com/posts/bevy-snake-tutorial/
- deleted 4y ago[deleted]