If you are interested in both roguelikes and rust, there's an embarrassment of riches for tutorials. In addition to the (very good!) tutorial on the OP by Tomas Sedovic, I wanted to mention the rust roguelike tutorial by Herbert Wolverson / The Bracket: http://bfnightly.bracketproductions.com/rustbook/ The main difference is that on this case they use rltk_rs, a pure-rust library for roguelike development, instead of…
Roguelike Tutorial: Up-to-Date and Literate
11–20 of 28 posts
Re: Roguelike Tutorial: Up-to-Date and Literate
#12Roguelike creators need to experiment a bit more with different themes and different core mechanics to make gameplayore interesting and diverse. > High Fantasy is the vanilla ice cream of video game themes https://www.goldenkronehotel.com/wp/2018/08/01/things-i-hate... > We have lots and lots of fantasy dungeon crawlers, so naturally if you want to really distinguish your project, go for any unique theme that’s not a…
Re: Roguelike Tutorial: Up-to-Date and Literate
#13If you are interested in both roguelikes and rust, there's an embarrassment of riches for tutorials. In addition to the (very good!) tutorial on the OP by Tomas Sedovic, I wanted to mention the rust roguelike tutorial by Herbert Wolverson / The Bracket: http://bfnightly.bracketproductions.com/rustbook/ The main difference is that on this case they use rltk_rs, a pure-rust library for roguelike development, instead of…
In addition to it being a pure Rust library (which does make a difference when you get started, but also when you try to distribute your game) it compiles to WebAssembly as well meaning you can use the same code to produce a game that runs on the desktop and the web. And the tutorial covers much more ground as well, including ECS for those interested.
And finally, both the tutorial and tcod-rs are barely maintained anymore. I try to address questions/fix serious issues from time to time, but the chances of this seeing any significant developments in the future are very slim. The RLTK stuff is actively maintained and developed.
(I'm not the OP, but I did write the linked post, the tutorial -- which is based on the classic Python+libtcod one as well as started tcod-rs)
Re: Roguelike Tutorial: Up-to-Date and Literate
#14Roguelike creators need to experiment a bit more with different themes and different core mechanics to make gameplayore interesting and diverse. > High Fantasy is the vanilla ice cream of video game themes https://www.goldenkronehotel.com/wp/2018/08/01/things-i-hate... > We have lots and lots of fantasy dungeon crawlers, so naturally if you want to really distinguish your project, go for any unique theme that’s not a…
If this is the reaction to the theme in the Rust tutorial that the original post talks about, that's because it's basically a port of the classic Python+libtcod one. It implements the same game, but walks the reader through doing it in Rust.
I (not OP but the author of the article and the Rust tut) wanted to use the same game & structure so folks can compare and contrast. A lot of folks are coming from Python or are familiar with libtcod. Plus it's trained generations of RL devs for better or worse.
If you do want to see roguelike creators experimenting, check out the annual Seven Day Roguelike Challenge[1]. Lots of absolutely amazing stuff keeps coming out of that, including most of my favourites.
[1]: http://www.roguebasin.com/index.php?title=Seven_Day_Roguelik...
Re: Roguelike Tutorial: Up-to-Date and Literate
#15Re: Roguelike Tutorial: Up-to-Date and Literate
#16Roguelike creators need to experiment a bit more with different themes and different core mechanics to make gameplayore interesting and diverse. > High Fantasy is the vanilla ice cream of video game themes https://www.goldenkronehotel.com/wp/2018/08/01/things-i-hate... > We have lots and lots of fantasy dungeon crawlers, so naturally if you want to really distinguish your project, go for any unique theme that’s not a…
I'm surprised the context is always fantasy instead of sci fi, given the games are inherently tech dependent.
Re: Roguelike Tutorial: Up-to-Date and Literate
#17If you are interested in both roguelikes and rust, there's an embarrassment of riches for tutorials. In addition to the (very good!) tutorial on the OP by Tomas Sedovic, I wanted to mention the rust roguelike tutorial by Herbert Wolverson / The Bracket: http://bfnightly.bracketproductions.com/rustbook/ The main difference is that on this case they use rltk_rs, a pure-rust library for roguelike development, instead of…
Re: Roguelike Tutorial: Up-to-Date and Literate
#18> the workflow could be better. In the example above, we had to define the function body, prelude, if statement, else statement and both if/else blocks.
> It would be much better if we could inverse this: defining the whole function block with holes for the if/else blocks that the code generation would put in.
The original CWEB and newer NOWEB do handle these things a bit better - sections can be defined and included in any order, and sections can define which file their in.
It lends itself particularly well to laying out a program "top down", ie:
We define the utility ctof as consisting of a c file: ctof.c.
It has the following structure:
standard header includes
defining constants for conversion
defining the function ctof that converts a float value of degrees Celsius to Fahrenheit, returning a float
A help procedure that prints help
A main function that parses command line parameters, and conditionally call the help procedure or ctof function... Etc
Then can go on to define the inner bit of ctof first (the calculation).
In general literate programming is very nice. It can be a bit of a challenge when breaking out small sections (we define a loop that iterates over an array like so...) - because of scoping issues - if the programming language discourages many small (max 10 lines) functions/procedures.
At that point the literate system itself takes on the role of a macro assembler of sorts - which can work with old school "structured programming" - short programs, well defined global state (a few array/lists, a few "in" and "out" global variables).
See eg: http://literateprogramming.com/cweb_download.html (historic relevance)
http://leoeditor.com/ (not sure if it's alive - an interesting idea in "all literate, all the time"
https://www.cs.tufts.edu/~nr/noweb/ modern-ish take on literate programming - if you want LaTeX for the document part
Finally, the most pragmatic variant I'm aware of - literate markdown tangle - which might be close enough to what's in op to encourage a port:
Re: Roguelike Tutorial: Up-to-Date and Literate
#19If you are interested in both roguelikes and rust, there's an embarrassment of riches for tutorials. In addition to the (very good!) tutorial on the OP by Tomas Sedovic, I wanted to mention the rust roguelike tutorial by Herbert Wolverson / The Bracket: http://bfnightly.bracketproductions.com/rustbook/ The main difference is that on this case they use rltk_rs, a pure-rust library for roguelike development, instead of…
&s.to_string()
which is an expression that could be shortened to just s. (Specifically, s has type &str, calling to_string() on it converts it to a String, and borrowing it allows it to be coerced back to a &str but now with unnecessary copying.) Elsewhere (this from Chapter 3) it has explanations like> Copy and Clone allow this [type] to be used as a "value" type (that is, it just passes around the value instead of pointers)
which is also not a correct explanation, or at least is a misleading one: things can still be passed by value even without Copy and Clone and without any pointers at all. (Arguably, he meant, "You can share the value without using borrows," but that's not what the explanation said.)
That said, all this is nitpicky (and I suspect that Herbert would be receptive to feedback along these lines—I just haven't had a chance yet to provide it!) because the tutorial's explanation of roguelike-writing is still very good, and in fact I've been following it as a guide for writing a tutorial on top of a different Rust library myself! But I do want to warn about using it as a model for learning Rust specifically.
Re: Roguelike Tutorial: Up-to-Date and Literate
#20If you're interested in the technical aspects of roguelikes, such as map generation and simulation, I recommend checking out the articles at roguebasin: http://www.roguebasin.com/index.php?title=Articles
The developer diaries for Cogmind are also a treat: https://www.gridsagegames.com/cogmind/