Highlights from "I spent 6 years developing a game in Rust and it just shipped, AMA" (2024)
The author spent six years developing a game called Way of Rhea using the Rust programming language. This puzzle game, inspired by titles like Braid, Talos Principle, and Portal, was released after the author shared an AMA on r/rust_gamedev where numerous questions were asked by interested readers.
Prior to adopting Rust, the author had experience with a C++ game engine. A friend had encouraged the author to explore Rust, but initial skepticism led to a brief break from coding. The turning point came when the author discovered Steve Klabnik's Rust book, which provided a comprehensive introduction to the language. The author was impressed by Rust's built-in build system, unit testing, documentation generation, algebraic data types, and non-exception based error handling.
While the memory safety aspect was appealing, it was not a primary concern for a single-player video game developer.
The author has since actively promoted the shift away from C/C++ and is involved in the Zig community, serving on the Zig Software Foundation board. They acknowledge that while there might be a tendency to view these efforts as competitive, a more productive approach would be to consider multiple high-quality low-level languages that keep each other accountable.
Writing game engines has exposed the author to numerous low-level tasks, including bit manipulation, which can be challenging within the Rust ecosystem. Unsafe Rust, often poorly documented and difficult to work with, has frustrated the author. The Rust language assumes a focus on heap and stack allocation, with limited support for custom allocators and reflection. Ecosystem choices sometimes prioritize theoretical ideals over practicality, such as binary search trees or other paradigms that may not always be the best fit.
The author emphasizes the importance of evaluating language choices based on their impact on the end-user experience. Instead of remaining dogmatic about a single programming paradigm, they suggest seeing the consequences of design decisions throughout the development process. This includes creating accompanying tools, such as music players for audio libraries or real games for game engines.
In the development of Way of Rhea, the author utilized various crates and libraries, including OpenGL function pointers, scopeguard, SDL for windowing and input handling, notify for file change notifications, and STB headers for tasks like parsing TTF fonts. They opted against using a library for parsing their scripting language, favoring the approach of writing a recursive descent parser themselves.
The application integrates Steam Input for controller support, although the author expresses reservations about its long-term viability due to issues with Steam Input's implementation and associated bugs.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.