Game Development With Rust and Bevy


Bevy is an open-source game engine that is written in the Rust programming language. This gives it some advantages over competitors, such as Unreal Engine and Unity, that are inherent to the language. Unreal Engine is written in C++ and leaves inexperienced developers exposed to memory leaks and undefined behavior. C# alleviates these issues by having simplified memory management and a garbage collector, but at the cost of performance. Rust strikes somewhat of a balance between these two. It includes automatic memory management through a system of ownership. Every value in Rust can have only one owner, and when the owner goes out of scope the memory is returned. This gets rid of the garbage collection pause that happens in C# programs.

In addition to the benefits that come with Rust, the Bevy game engine is considerably light-weight and modular compared to other engines. This makes it ideal for small projects or indie game developers who don’t want to spend time optimizing something built in other engines that come with many features that won’t be used. Unfortunately, this means that Bevy might also not have every feature a developer is looking for. Bevy benefits from a large community of contributors, however, and new versions are released frequently. There are also many unofficial plugins available that bridge some of the gaps between what developers want and what Bevy has to offer.

I started this project with some experience in Unreal Engine and Unity. Both of these game engines offer some pretty extensive real-time editors and include the ability to create games using visual scripting. Bevy, on the other hand, does not include an editor or visual scripting. This means that everything must be done in code and without the use of a real-time editor (there are plugins available that provide some of the functionality of editors, like bevy-inspector-egui and bevy-editor-pls).

Besides familiarizing myself with a new game engine, Rust syntax is different from C++ and C#, so there has been a bit of a learning curve. The documentation for Rust is fantastic, however, so it’s generally pretty easy to find an answer when stuck on something. There is an official Rust Programming Language book, Rust by Example (a collection of examples that demonstrate all the core concepts of the language), and a course called Rustlings that guides you through alternatives to Rust by Example. There is no shortage of resources to learn Rust. It can be difficult at first, but if the determination is there it can be done with the vast amount of help available.

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *