Aimlessly Going Forward

blog by Tomas Sedovic

Porting the Complete Roguelike Tutorial to 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.

Tomas Sedovic on 30 September, 2016