• 0 Posts
  • 2 Comments
Joined 5 days ago
cake
Cake day: November 7th, 2026

help-circle
  • I’m familiar with the arguments for Rust’s approach. It makes sense for many use cases. I’m not saying it’s wrong, just that there are tradeoffs and that for me, different ones are a better match for gamedev.

    Rather than focus on difficulties, though, I can point out some code that was a really nice fit for the language. Top of mind there is my behavior trees implementation. With a few macro invocations, I can define a tree that’s easy to read in source, that statically checks that nodes fit together, that supports full “time-travel” debugging, and that compiles to fully-specialized code. Besides the regular pathfinding and shadowcasting helpers, this file is the core “library” the game is built on.


  • Hello! I’d like to see this community grow and participating is the only way to make that happen.

    I wrote WildsRL in Rust with minimal use of libraries. I’m using termion to render to the terminal in the native build, and wasm-bindgen to expose JavaScript bindings in the web build. The only libraries I use for the core game logic are rand and rand_distr, for RNG. So most of the code is plain old Rust.

    I have mixed feelings about Rust for game development. The biggest problem is its “shared xor mutable” default. Games are all about mutable state. You often want to have a mut ref to an entity and const access to the rest of the game state (which itself refers to the entity). Languages like Java and JavaScript prove that there’s no actual reason that you can’t have that AND be memory-safe.

    This post explains my issues better than I can: https://loglog.games/blog/leaving-rust-gamedev/

    Why do I stick with it? Well, it’s really pleasant in other ways. I like that constructors are trivial to understand (looking at you, C++). I use union types everywhere. cargo check runs in ~0.02s so any errors in my code are instantly highlighted. Most importantly, I have a few years’ worth of code and I’m not going to throw it away.