10 ms·
Bevy: A game engine built in Rust
- echelon 6y agoI'm about to build a stack on top of Unreal, but I don't really need the "game" parts, just the "real time rendering" ones. I consider building on Unreal to be an (acceptable) risk, but I'd prefer to build on something not owned by another company. I'm really hoping some of these Rust projects start to focus on rendering, not just the game pieces.
- w4rh4wk5 6y agoPBR is on the todo list. https://github.com/bevyengine/bevy/issues/179 https://github.com/bevyengine/bevy/issues/179
- prox 6y agoHave you considered Godot? You can use wrappers.
- Fred27 6y agoI'm not sure using Unreal is a risk. It's used commercially by a lot of companies for much more than gaming. It's also open source. Obviously not written in Rust though, if that's important.
- JoeyBananas 6y agoHave you considered Godot engine? Godot is free software, so legally you have the right to do basically anything with it that Godot engine's owners do. It's years ahead of the engine in the OP in terms of features+polish, and seems likely to continue being developed for a long time. I'd definitely suggest using Godot unless you really need a specific feature of Unreal engine.
- prox 6y agoHere is a nice project : https://github.com/godot-rust/godot-rust https://github.com/godot-rust/godot-rust
- mwill 6y agoIf GP is interested in real time rendering features, they may end up butting against the same wall I do every time I try to use godot for a quick 3d experiment: a lot of features you may want when it comes to rendering have been combined with the swap to vulkan, coming in Godot 4.0, which has been a long time coming, with an alpha this year hopefully, but one of the devs has already joked that it will be delayed until next year.
- ratww 6y agoHow much of rendering you need? Are you providing the shaders yourself? If you only need multi-platform rendering (including Emscripten, and a shader abstraction), have you looked into BGFX, or even Sokol GFX? They provide the bits you need to render. Unity is even using BGFX in its "Tiny" version. Sokol GFX is new but very easy to use. I believe both have Rust bindings if this is important to you.
- nindalf 6y agoThere are other attempts to build a game engine in Rust. In my opinion, what sets Bevy apart is the pace at which they’re developing. Look at the release notes for Bevy 0.4 (https://bevyengine.org/news/bevy-0-4/ https://bevyengine.org/news/bevy-0-4/), released 6 weeks after Bevy 0.3 (https://bevyengine.org/news/bevy-0-3/ https://bevyengine.org/news/bevy-0-3/). They have momentum, plenty of contributors (50+), improving the ergonomics of existing APIs, improving the performance of pieces already performing well. If I was making a game today, I’d probably pick Unity. A year from now? I’d take a good look at where Bevy is then. Good luck to cart and the other contributors.
- rapsey 6y agoBevy has a full time developer working on it and has benefited from a whole lot of lessons learned from past attempts at building an engine in Rust.
- k__ 6y agoFrom all the game engines I've seen in the last years, Bevy looks the most promising. The API looks very clean and the development speed is outstanding for an open-source product. After reading that Rust now plays in the C/C++ league I'm really excited about Bevy.
- wyldfire 6y agoWhat does it mean that "Rust now plays in the C/C++ league"? Is this referring to the Rust Foundation announcement or some other recent news?
- wheybags 6y agoA visual product like this really needs some screenshots in its readme.
- ArtWomb 6y agoAs well as a gallery of examples created with the Bevy game engine ;) https://github.com/bevyengine/awesome-bevy#games https://github.com/bevyengine/awesome-bevy#games
- GordonS 6y agoHalf of the example repos don't even have screenshots in their own readmes. It's so frustrating when I come across stuff like this - screenshots are such an important hook to really reel me in.
- willio58 6y agoAgreed. It’s a common pitfall of open source projects. Sometimes I just want to see what I can do with the thing, not the details of how I can do it.
- fctorial 6y agoBuild fails with 6 month old rust.
- richardwhiuk 6y agoAnd?
- fctorial 6y agoMost C/C++ projects do compile if you use a 6 month old compiler.
- rapsey 6y agoSo what?
- linkdd 6y agoIf you think the whole world of IT works on bleeding edge tech, you're mistaken. Most distributions have an LTS that is supported for 5 to 10 years. You won't get the newest, hottest compiler on those platforms. > So what? Rust is a great language, but y'all need to calm down with the hype. "Not Rust" != evil.
- Tuna-Fish 6y agoFor as long as Rust has existed, no-one who is writing rust actually wants to use a compiler version that's any older than the newest. The language keeps adding good stuff in every version. I thought it would calm down a bit after NLL, but now everyone is salivating for const generics, which will land in 1.41... and in a whole lot of versions after that, as they split up the feature into smaller, easier to implement and study chunks. The language simply hasn't reached the level of maturity of C++ where people yawn at the new features that are going to be added. > Most distributions have an LTS that is supported for 5 to 10 years. You won't get the newest, hottest compiler on those platforms. Yes, you do, because you won't be using the distribution-supplied compiler because like the entire rest of the rust developer community you are using rustup.
- kierangill 6y agoCan anyone speak to their experience using Bevy on the web with WASM (related [1])? Are there other non-JavaScript game engines you’d recommend? [1] https://github.com/bevyengine/bevy/issues/88 https://github.com/bevyengine/bevy/issues/88
- lwansbrough 6y agoBevy currently works on the web with a separate WebGL 2 based renderer. WebGPU is the long term target so that the wgpu based renderer will work cross platform. I’m not sure of the status of single-threaded WebGPU rendering but Bevy will not fully support web likely until this issue [1] is addressed. It is unfortunately not a high priority for the Chrome/Firefox teams so will take some time. You need to be able to render WebGPU to a canvas from a worker before you can achieve multi-threading. [1] https://bugs.chromium.org/p/chromium/issues/detail?id=1169710 https://bugs.chromium.org/p/chromium/issues/detail?id=116971...
- tmp538394722 6y agoAlso note webgl 2.0 is not enabled by default on safari (includes any iOS browser). There is an option to enable buried in the settings, but it’s not recommended to leave it on. So it’s not really an option if you’re targeting ios.
- lsmurray 6y agoDoes anybody know if bevy supports networking or multiplayer?
- lwansbrough 6y agoThere are a couple networking plugins in the works. They are focused on providing cross-platform UDP networking. But it’s still mostly roll your own.
- iptq 6y agowhy does it feel like i'm seeing more rust game engines than actual games? (outside of toy 2048 clones)
- steveklabnik 6y agoThis is a pretty common joke about all game development, not just Rust.
- pacificat0r 6y agoTo make an engine it's ok just to gather a bunch of programmers. To make a game (even a tiny one) you need artists, sound designer, designers and so on and that's what makes it significantly harder
- MaxBarraclough 6y agoThe Forth community takes this one step further: it's more common to see someone discussing their implementation of the Forth language, than to see someone discussing what they developed in Forth.
- progre 6y agoI'd bet that most new Forth implementations are done for CPU:s that already have vastly more powerful languages available. So if someone want to get stuff done they would probably rather use a more productive language for that. But if they want to tinker around I'd imagine a Forth implementation would be a pretty fun learning experience. I'm myself implementing a Lisp (MAL) just because it's fun. I'm not really planning on using the implementation for anything though.
- MaxBarraclough 6y agoCompetent Forth developers consistently seem to consider Forth a far more productive language than C. Not something I can comment on personally though, I know C far better than I know Forth.
- 6y ago
- adamnemecek 6y agoIf you re interested in Rust game dev, check out the rg3d engine https://github.com/mrDIMAS/rg3d https://github.com/mrDIMAS/rg3d. Join the rg3d discord channel https://discord.gg/xENF5Uh https://discord.gg/xENF5Uh Here’s a sample game made with it https://github.com/mrDIMAS/StationIapetus https://github.com/mrDIMAS/StationIapetus
- _cart 6y agoHey we're back on HN. I'm Bevy's creator / lead developer. Feel free to ask me anything!
- acpetrov 6y agoAny current or planned VR features? Cheers
- _cart 6y agoNothing usable yet, but people are currently experimenting with integrating VR apis into our core graphics library (wgpu)
- ttymck 6y agoI just recently started learning bracket-lib (fka rltk), and it's tutorials recommend Legion ECS, but I'm finding the macros and magic of Legion to be less ergonomic than what I've seen from bevy. Is it possible/advisable to use Bevy as a standalone ECS, that doesn't require owning the "main loop"?
- _cart 6y agoYeah Bevy ECS is built as a standalone ECS. Using it that way is perfectly advisable: https://crates.io/crates/bevy_ecs https://crates.io/crates/bevy_ecs
- ttymck 6y agoAwesome, thanks for confirming! I came across that package, it wasn't clear from the docs if it was intended to be imported on its own -- i'll give it a go!
- ncmncm 6y agoRust seems like an odd choice for game development: Given adequate runtime performance and expressiveness, perhaps the most valued quality in a language used for the purpose is minimal turnaround time in the edit-build-test cycle. Here, Rust is, AFAIK, far behind other languages. C lacks expressiveness, but C++ and C# seem popular for the purpose, and their build time is good. Incremental compilation is sometimes available, potentially avoiding a slow, non-parallelizable link step. Rust is promoted for security, but I have not heard of that as a criterion for game work, and it seems like the first criterion to be jettisoned vs. any other. What makes Rust's slow build times tolerable for this use? Has it had more progress in incremental building than I know about?
- pjmlp 6y agoSecurity is relevant on server code and copy protection mechanisms, however modern game development is composed by multiple skillets, that join efforts across middleware like Unreal. So I am with you that Rust has a very uphill battle for adoption in any game console devkit.
- _cart 6y agoBevy has very fast iteration cycles and it has been a core "required" feature since the beginning. With our "fast compiles" config, compiling iterative changes to most of the examples takes less than a second. Changes to the "3d_scene" example compile in ~0.5 seconds on my machine. Check out our most recent efforts in our last blog post, where we added easy dynamic linking for a massive compile speed boost: https://bevyengine.org/news/bevy-0-4/ https://bevyengine.org/news/bevy-0-4/ I also discuss the perception that "Rust is slow to compile " in the original Bevy announcement post: https://bevyengine.org/news/introducing-bevy/ https://bevyengine.org/news/introducing-bevy/ In short: fast compile times in Rust are possible. As long as your core libraries do the "right things" when it comes to design, writing user code can be extremely productive. The compiler has also gotten a lot faster over the last couple of years.
- Angius 6y agoCan't wait to use `player!.0.<>->move^([]->^t, Box<&loc, g*>)` to move player characters!
- _cart 6y agoWe've heavily invested in legibility and ergonomics in Bevy. I'd argue that our ECS is top tier in ergonomics and legibility across all engines / languages. Here is a gist of a fully self-contained Bevy App for player movement. Feel free to compare that to _any_ other engine / framework: https://gist.github.com/cart/96b1d39cd04274da566dbf28bf87c2a8 https://gist.github.com/cart/96b1d39cd04274da566dbf28bf87c2a...
- linkdd 6y agoI'm a Rust newbie, could you explain how a function got a method "system"? Is there some macro at work here?
- _cart 6y agoFunctions are "types" just like everything else in rust. And you can implement traits (which can add methods) on any type. So its just "normal" rust code to add a function call to a function of a certain type. This enables us to (statically) extract information from the type signature of the function and use it to populate the relevant values using the ECS. We also use this type information to automatically (and safely) parallelize system execution based on what ECS resources are accessed (and if they are mutated). We do (internally) use macros to implement our IntoSystem trait for all relevant function types, but there are no macros in user-facing code.
- linkdd 6y agoI see, that's interesting and it seems powerful. But I would never use such a feature, it increases the code mental load (what you should know before being able to read the code). From one codebase to another, I can't even keep the same assumptions.
- openfuture 6y agoGamelisp is also a super cool rust game development project. You expose gamelisp runtimes in different parts of your program, then compile and run it with gamelisp programs going into the various runtimes. Now you can iterate on your gamelisp parts without recompiling. The documentation is very good(!) and the approach is very interesting imo, iteration times disappear but you can keep all your performance (by moving the logic into rust as you settle on a design).
- deleted 6y ago[deleted]