Aimlessly Going Forward

blog by Tomas Sedovic

Porting the Complete Roguelike Tutorial to Rust

gamedev, announcement, tutorial, rust

About a month ago, I’ve finished porting the Python Roguelike Tutorial to Rust using the tcod bindings.

The Python tutorial is a starting point to a lot of beginners. It shows one way of writing a roguelike in Rust and it was useful to validate that the Rust libtcod bindings are complete enough.

You can read the tutorial here:

http://tomassedovic.github.io/roguelike-tutorial/

And here’s the repository if you want to check the code out, report a bug or submit an improvement:

https://github.com/tomassedovic/roguelike-tutorial/

Initially, I tried to follow the original Python tutorial as closely as possible, but Rust is different enough that it just did not make sense. I did strive to keep most of the code organisation and architecture close so that someone familiar with the Python tutorial could just check the differences and get going.

In the end, I’m not sure that was a good idea – I have a feeling that if the game was designed with Rust in mind from the beginning, the code would have been more natural and showcased Rust better.

Some obvious differences from the Python version:

Other observations:

The tutorial is now at a parity with the original, but there’s a few things I’d like to see happen. I’m not sure when I’ll get to them, all these are up for grabs!

Once the support for custom derive lands in stable Rust, I’d like to switch to serde for saving/loading the game.

Screenshot and link to the website for the Dose Response game

Hi! I wrote a game! It's an open-world roguelike where you play an addict called Dose Response. You can get it on the game's website (pay what you want!), it's cross-platform, works in the browser and it's open source! If you give it a go, let me know how you liked it, please!