Dungeons and Debugging

There were three things I used python for when I first started learning it back in High School.

First, was doing my math homework. It wasn’t hard, but If I could make it easier, why wouldn’t I? I also learned a bit of TI-BASIC to program the graphing calculators, but it couldn’t compare to python3.

Second, was getting around the restrictions they put on the school computers; mainly the block on accessing the Windows Command Prompt. I had no ill intent, I just wanted to do it because they told me not to and I wanted to see if I could. Turns out I could. Easily.

Third, was games. I understood that creating a game with graphics would be complex, and I still hate writing GUIs to this day, so I tried my hand at creating a text adventure game. Something just for fun for me and my friends, but back then I didn’t understand functions, let alone objects, so it was a mess of whiles, ifs, and elses. It wasn’t very good, and frankly, I’m glad it never progressed past the first level.

Enter CPSC 240, Object Oriented Analysis and Design. My fourth Computer Science class at UMW, and my first real exposure to object oriented programming. Our big assignment in that class was to create a text adventure game; a clone of Zork. I was ecstatic, but thanks to an uncooperative group member and the fact we had to write it in Java, I did not have a good experience and honestly did not absorb much information. Skip forward a few years, and I decided that I wanted to try my hand at writing a text adventure game once more. I was a few years older, and thanks to python (and reluctantly, C++), I finally grasped the idea of object oriented programming.

I played around with a few ideas, until I decided to create a reusable set of functions to create this, and future, games. It took me longer than I’d like to admit to realize I could put these functions in a library, instead of just copy-pasting them into each game. Sometime in 2018, I released the first incarnation of this library, with a game included as an example of how to write a game using it. But there were just so many hacks to make it work, I knew I eventually wanted to sit down and re-write it.

So I did. Currently at Version 2.0.2, the VuurEngine can be used to write simple text adventure games in python3. I’ve put it out under the open source BSD 3-clause license, so anyone can use or modify it.

There are still a ton of changes I want to make to it, like adding the ability to save and load a game, or creating a custom scripting language to build games in rather than requiring they be written in python3, but for now, it works. And compared to every previous version I’ve written, it works well.

I’ve written into the library a tutorial on writing a game using it, as well as an example game (with Monty Python references; correct answers to the questions enable cheat mode), but I still need to find the time to sit down and write a real game with a real story using it. Maybe I can even turn the short story I’ve been trying to write into a game. I can’t write dialogue, but I can write python.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.