Sunday 4 April 2021

Roguelikes, a very strange hobby

Disclaimer. This post assumes some familiarity with the idea of roguelike games, if not with the games themselves. This isn't a 'history of roguelikes' post, for that see here

Recently I was working on a graphical roguelike that I occasionally dust off and tinker with, Axes, Armour & Ale. It uses graphics in a very loose sense of the word, just small static tiles with no animation. I was trying to add stairs to the caves and dungeons to allow the player to go deeper and deeper into the dungeon and realised that I needed to do a lot of refactoring.

screenshot of GUI roguelike

The original game just took place in a single dungeon, a la Rogue / Nethack etc, but then I decided that I wanted an overworld map as well, like ADOM.

I started pulling out bits of the code and sticking it in other places and found that I was writing lots of simple test programs in pure ASCII to try out features before committing to drawing graphical assets. In the end, I decided to do something that I had in mind when I first started Axes, write a back-to-basics, 80x25 terminal-based roguelike. With the option of later creating a GUI version from the same codebase.

With the constraints of writing a game that worked in both the Windows and Linux terminal, I found that I gained a lot more enthusiasm for the project. This was more like the games that got me into roguelikes in the first place. When I first fired up Nethack in 2002 and discovered what it was like to play a game that didn't give a damn whether you lived or died. Then I moved onto ADOM and found a game with a more cohesive story that took itself a little more seriously.

I don't play games as often as I used to now that I have kids, but a turn-based roguelike is easy to pick up and put down between episodes of Paw Patrol and visits to the local playground.

Screenshot of ASCII version

Once I was confronted with the text version of my unfinished game, it struck me that writing roguelikes is a damn strange hobby. Eschewing graphics, sound or really any advances made in game theory over the last few decades, to craft a form of entertainment that owes more to table-top role playing games and Choose Your Own Adventure books than a regular computer game. I regularly read peoples posts on r/roguelikedev  and see the vastly different approaches that people have to this genre. My approach is closer to the classic roguelikes already mentioned above.

After 2 previous attempts at writing a roguelike by following a tutorial (one in Java, and one using the Godot game engine) I'm winging it this time, with no tutorials to refer to. I've set myself some limitations, after writing one game using OOP and one using ECS, this one will be purely functional programming. I also want a native binary that doesn't require any external libraries in order to run.

I've decided to write it in the awesome Free Pascal, whilst totally ignoring its object-oriented features. Now that I write code for fun rather than for a living, I don't have to force every type of program into an OOP structure.

At the moment I've only gotten as far as organising the user interface and the units that I'll use to write to the terminal, so it's slow going and there isn't much to show yet. But I already have a scrolling map that scrolls a lot smoother than the graphical version does.

0 comments:

Post a Comment

Search This Blog

Powered by Blogger.

Using the Free Pascal IDE for a week

Code can really be written with any text editor that you're comfortable with. I tend to use Vim for quick edits and writing notes, and ...