Text Adventure Game Remake

Book

My first assignment for the low-level programming module as a second-year student was to make a text adventure game. Firstly, I needed to write it using a high-level programming language called BASIC. In order to do it, I went through the book called “Write Your Own Adventure: Programs for Your Microcomputer” which explained how to do it. In theory, this was a fairly simple task but in practice, it turned out to be slightly more complicated. To make it easier for me, I read the entire book to get a sense of how BASIC works. Some of the things were a little confusing at first for example declaring arrays, which depending on what data they store have different syntax. Nevertheless, I got used to it.

Emulator

The most challenging part was to type it from the book into an emulator. It took me a good 3 hours to copy all the code, as I had to be really careful not to make too many errors, so I wouldn’t have to debug it forever. Apart from a few spelling errors, my code was safe and sound. Once I finished re-writing it in the emulator I needed to port it using modern C++, OOP and proper memory management.

Sped up gameplay of the original game coded in the emulator

Sped up gameplay of my remake

Post Mortem

I’m pretty satisfied with my ported version of the BASIC Haunted House. It has changed a lot in comparison to the original game. I came up with a completely different idea of how I wanted to present my port. It has received a 2D top-down environment along with a much simpler input system. It looks more like modern games where you don’t have to write commands, instead different keys do certain actions. I have really tried to make this game more player-friendly and make the entire experience more interesting.

In terms of code, I added a few extra components to focus on a composition approach rather than inheritance. There are also a few managers for example movement manager or game state manager to keep specific code in one place, so it is easier to follow and manage. I also used Json which helped me to keep game data in files which are easier to edit rather than hardcoding and managing things inside the codebase. I also used a great package called SoLoud for audio playback.

Overall, I’m pretty happy with my ported version of Haunted House, but there is definitely plenty of room for improvement. I have learned new things and I will try to use more of their functionality in my next projects.

An unhandled error has occurred. Reload 🗙