Roguelike learning
Since one of the goals of this digital garden is to learn in public, here is what I’m banging through right now. I’ve lately discovered roguelike games, particularly the venerable old Nethack. Just what I needed — another rabbit hole! But something about the ASCII art, the retro vibe, turn-based gameplay, dungeon crawling, and the general impossibility of ever winning…. just grabbed my attention.
But of course, I’m never satisfied to just play a game. I want to know how it’s coded. And with some more time to spend on hobbies lately, I found a cool Python tutorial at r/roguelikedev. I’ve taught a bit of Python, but all at a very beginnerish level — Python on the Raspberry Pi, with Minecraft, with Pygame. So I actually really like the language (I am CrouchingPython on YT, after all). But I have no experience with classes, lists, arrays, etc., and not even much with creating functions.
I think this tutorial was listed with a "start here" description, so I figured it would be pretty accessible.
Nope.
I was quickly transported from teacher mode to student mode, where things didn’t make sense and I made dumb syntax errors, stumbled through trying to chase down errors across multiple classes and files, and just generally got in over my head pretty quickly. I did Java in my coding classes 20 years ago, and fortunately I guess I did imbibe enough of the concepts of object-oriented programming to help me at least start to understand what the code was doing, But I am blessed (or cursed) with the "why?" gene. It’s not enough for me to have something work, I have to know WHY it worked. Or didn’t. Maybe that helped me be a better teacher.
End result is I’ve been in a constant state of dumbness. Or at least feeling that way. A couple of things helped out. First, I found a Discord server for for Roguelikes with a channel for libtcod, the library used in the tutorial. Even visited by the writer of the tutorial (thanks @HexDecimal!), who helped me squash a few bugs. So that has been awesome, though I’m very conscious of not wearing out my welcome and running for help with every setback. The second thing that helped was moving from IDLE as an IDE to VSCode. Anybody with any experience in Python is laughing at me right now, but VSCode has certainly helped me organize my files and help me with obvious errors.
So I’m about 5/12 of the way through the tutorial. Certain things are becoming clearer to me, though I often wish I had a classmate right next to me, and I could ask my dumb questions (like why is this followed by an underscore and not a dot, or what exactly does that Return mean here). I’m getting fewer errors, and repetition is helping me absorb concepts.
I really do hope to finish the whole thing and end up with a working roguelike. And I hope that concepts I learn here will be applicable to creating something of my own someday.
Recent Comments