Side Project: Text Game

So I've finally got around to making a text game! Sort of. Instead of running in a text-based environment like a console and accepting English-language commands as input, I made the decision to go the way of Fallen London, A Dark Room and probably a bunch of others and make choosable text options. The game's main focus is still on the writing, but after reading a Natural Language Processing module in my second year at university I needed a break.

I wanted an interface almost -- but not quite -- as minimalist as A Dark Room. So I chose to avoid the larger frameworks like Bootstrap and stick to the tiny Skeleton CSS framework. I also didn't think I'd need much in the way of animation, so I thought DOM elements and jQuery animation would do just fine.

Something you may not notice immediately while playing the game is the system of qualities.

As with every interactive fiction project I ever work on, I initially had some pretty crazy and implausible ideas about the levels of complexity I'd be able to work in. But this time, with some refinement, I've actually got a pretty flexible system that doesn't rely on any nasty metaprogramming. Mainly because I don't yet know how to do that in ES6, I suppose.

The basic idea is that players, locations, and items can all posess Qualities. A Quality is just like it sounds: a fact about the "thing" in question. For instance, a player might have the Quality of "Knows about the Secret Railroads". It's a pretty thin wrapper around what's essentially a set of strings, but along with some helper methods like hasQualityWithName it allows for some really expressive code.

Qualities wouldn't be much use if they couldn't influence anything, and so I've included a demonstration of how buying/using a Whispered Hint from the Strip market can inform the player that a certain shady character waits for them west of the tracks. If the player was to travel west of the tracks before this knowledge were acquired, they wouldn't have the appropriate quality to know about the smuggler, and so wouldn't see or be able to interact with him.

Note that Qualities are a separate idea to Items: the game also has an Inventory which has all the same checks! So if you want a player to be unable to craft a potion without having both the requisite knowledge and the potion's ingredients, that's easy as pie: just check both the player's inventory and their qualities.

It's still in progress (obviously...), but I think it's at the stage where it'd benefit from the input of a real writer!