Dave McKay

Linux and programming geek; freelance technology journalist and data protection and privacy consultant. Not afraid of a side-hustle.

A Meaningful Metric?

I'm toying with the idea of making the score at the end of the game more meaningful.

Currently it gives you a figure based on the completion of puzzles, the places within the game that have been visited, and so on. It's all to do with the things that you've done in the game.

I'm thinking whether there is a way to take the way you've played into account. How many wrong guesses, how long you paused between moves, and so on. Perhaps something that can take into account the hesitancy with which a game is played.

I've got some research to do :)

A Test Drive In More Ways Than One - Part Two

The test drive of TAF with a captive audience of family members didn't go according to plan. In fact, it didn't go to any plan. It didn't happen at all.

My mother-in-law tested positive with COVID-19 on Monday. We'd already spent Saturday and Sunday in her company. It wasn't long before we all fell like flies. My wife, myself, my sister-in-law, brother-in-law, their son, etc. etc. We all contracted COVID-19.

Instead of a pleasant week on the beautiful Island of Lewis and Harris, we self-isolated in a hotel room. And that was even less fun than it sounds.

At least in your own home you can move from room to room, and you have all of your facilities and possessions around you. Five hundred miles from home in a comfortable but quickly boring hotel room, feeling under the weather is a no-fun pastime.

One thing we did manage to do before we had to go into isolation, was to visit the Clach an Trushal stone, Scotland's tallest standing stone.

Clach an Trushal stone

That almost makes up for everything.

A Test Drive In More Ways Than One

After a long haul from North Wales to an overnight stop in Perth, then onward travel to Ullapool and a two and a half hour ferry crossing we're finally here: back on the Isle of Lewis and Harris, to see family.

It was a test drive for the new (to me) car, a 12-month old Kia Rio 2 ISG, navigating by means of Waze on my phone linked via Android Auto to the 7" head unit in the car. The car was perfect, Waze was amazing.

Also astonishing was the drive from Perth to Aviemore. Once we cleared Perth's gravitational field there was no other vehicle in front of us or behind us all the way to Aviemore.

Final part of the test drive triumvirate is going to be an inaugural flight of TAF with some family members while we're here.

Why Virtual Escape Rooms Are Better

There's a whole bunch of reasons that virtual escape rooms are a better team building exercise than physical escape rooms.

  1. They're moderator-led sessions, so you get feedback on the team's interactions and a transcript of the team's game play.
  2. Because a virtual escape room can involve activities that you can't do in real life, the team really needs to think outside of the box.
  3. They're the most cost-effective way to conduct enough sessions to put all of your staff through a session.
  4. We come to you, so there's no dead time spent in travelling.
  5. Our game play can take place outside, in the virtual landscape. You're not limited to the classic escape room setting of a single room, with a secret adjoining room.
  6. Players can be do dangerous things that you couldn't allow in real life. For example:

    a) Mix powder and water to make a powerful acid, and then drip it into a lock.
    b) Use fire to boil water, or burn through a wall, or send a smoke signal ...
    c) Run along the roof of a train!
    d) Climb a rope into an attic room.
    e) Shoot an arrow trailing a cord and then zip wire between two buildings.
    f) Swim through flooded tunnels.
    g) I could go on all day ...

  7. Do impossible things like travel by teleportation, kill zombies, use invisibility cloaks...

All of this makes our interactive fiction sessions engaging, compelling, and genuinely immersive.

And all accomplished through the power of the written word.

TAF-Specific Web Page on dpocompliance.co.uk

I added a page to the dpocompliance.co.uk website dedicated to the text adventure framework, TAF.

More accurately, i added a web page talking about how using TAF for team building exercises could benefit businesses.

For example, because they'd be person-led, moderated sessions and TAF can produce a transcript of an entire session, I can give feedback that isn't available in other team building exercises.

Lean, Mean, Gaming Machine

I compiled TAF today without any of the debug information. Basically that just means removing the -g option from the CFLAGS line of the makefile:

CFLAGS = -Wall -g `pkg-config --cflags gtk+-3.0`

TAF compiled to an executable binary of just 130 KB!

Yes, that's kilobytes. Sometimes I amaze myself :)

Actually, sometimes the gcc compiler amazes me. Even after all these years.

TAF is on the Main DPO Compliance Website

I updated the website for my business today, and added two brief references to TAF, as a service that I can provide to businesses.

What I'm offering is in-person moderated virtual escape rooms and other interactive fiction-based team building sessions.

To do: I need to improve carousel banner image of TAF, and add a more detailed blog post.

Mutable Set Dressings

I was play-testing a game today and realised there was a need for some more functionality in the TAF program.

Set Dressings are items within a game that don't really affect the game play in the way that problems and objects do.

Instead, set dressings provide texture and atmosphere to a game, and add layers of detail to locations. They may hold clues or information that let the player deduce something, but's as far as they go in terms of game play. Their main purpose is to provide background detail and colour to a location.

Because a set dressing has an associated detailed description the player can ask for more information about a set dresing item, just like they can for a problem, a location, or an object. When the play uses the describe or examine commands on a set dressing, they are shown the detailed description.

What occurred to me today is that a set dressing isn't immutable. It could be modified or altered in some way when a problem is solved. A problem has an unsolved and a solved description. There may be an unsolved and a solved image too. It's perfectly feasible that a set dressing may be changed in some way that means a single detailed description isn't sufficient - there must be an unsolved and a solved detailed description for set dressings too.

This required creating a new GDL attribute called .prob_affects. This attribue is used to create an affects structure that defines a relationship between a set dressing and a problem. When the problem is solved it checks the list of affects structures and looks for set dressings that are affected by the solving of that problem. If it finds any, it sets a boolean bChanged flag in the associated set dressing structure to true.

If the player uses the describe or examine commands on a set dressing it checks the bChanged flag to see whether it should display the unsolved or solved version of the detailed description.

It's a neat way of adding more realism to games.

Let's say there was a problem that had a large balloon full of paint hanging on a string. The player must burst the balloon to get to a hidden key. Obviously, bursting the balloon releases the paint. If the paint falls on a rug below, and the rug is a set dressing, there needs to be a before and after version of the detailed description of that rug.

The Numeric Keypad

The numeric keypad acts as a controller for a subset of the commands. It makes entering movement commands and some other common commands very simple.

Key Command
/ Carrying
* Peek
- Close Trace window
+ Open Trace window
8 North
2 South
4 West
6 East
7 Northwest
9 Northeast
1 Southwest
3 Southeast
5 Up
0 Down
. .time



You'll find that these map onto the numeric keypad in such a way that the number keys 'point' in the direction of the movement command they're mapped to.

It becomes a bit more obvious when you have a numeric keypad in front of you.

Key Pad Function Map
NmLck Carrying Peek Close Trace
NW N NE Open Trace
W Up E Open Trace
SW S SE Enter
Down Down .time Enter

Mindmap of the Main TAF Game Elements

This is a mindmap of the major elements of a TAF game. It was created with the free and open source minder application.

TAF GDL cheat sheet

User Interface - The Three Windows

TAF uses a very simple user interface. It doesn't require anything overly-complicated. Anything too sophisticated will get in the way of the intended look, feel , and atmosphere I'm trying to achieve.

Main Window

The main action takes place in one window. The aesthetic is a throw-back or homage to the era of green screen visual display units that were in vogue when the first text-based adventure games were created.

TAF Main Window

The text is coloured as close as possible to the actual shade of green that was used in the early cathode-ray tube VDUs. The colour is #33F33F, or 51,243,63 in RGB notation.

A text entry field is located at the bottom of the window.

Trace Window

The diagnostic trace window displays information that is only of interest to the developers of the software. It is not intended for player consumption. In normal game-playing circumstances the trace window is hidden.

TAF Trace Window

The text colour is an arbitrary shade of yellow.

Timer Window

This is a digital clock that counts down to zero. The starting value is either a default value of 60 minutes, or a value defined within the current game. The game author can set whatever time limit for the game that they choose.

TAF Timer Window

Having the timer window visible lets the players know exactly how much time they've got left. If they don;t want the aded tension of seeing time tick away the timer window can be hidden. It keeps time whether it is visible or not.

Game Files and the GDL

Games are defined using the Game Definition Language, GDL. Each game is held in a plain text file.

The "keywords" of the GDL language are called attributes. There are over 50 different attributes. They either define something within the game, or define a characteristic of something that has already been defined.

There are ten groups of attributes:

  1. General Game Details Attributes
  2. Place Attributes
  3. Object Attributes
  4. Problem Attributes
  5. Alias Attributes
  6. Clue Attributes
  7. Set Dressing Attributes
  8. Detailed Description Attributes
  9. Sound Effect Attributes
  10. Image Attributes

Game Architecture

TAF is developed in, and runs on, Linux. It is programmed in C, and is compiled with the gcc compiler. It is a lean, fast program. The compiled binary is under 200 KB in size!

TAF is a GTK+ application, making use of the GTK toolkit for its windowing capabilities.

The colours and fonts for the program windows are defined in a CSS file called themes.css.

/* set the font and colour for the text view in the main window */
#game_view {
  font: 24px "DejaVu Sans Mono";
  color: #33F33F;
}

/* set the font and colour for the text view in the trace window */
#trace_view {
  font: 18px "Andale Mono";
  color: #FFFF00;
}

/* set the font and colour for the text entry field */
#text_entry {
  font: 20px "DejaVu Sans";
  color: #33F3FF;
}

/* set the font and colour for the digital countdown timer */
#timer_label {
   font: 140px "Deja Vu Sans Mono";
   color: #33F3FF;
   background-color: #000000;
}

/* set the background colour for text to black */
text {
  background-color: #000000;
}

Other settings are contained within the taf.conf file. This contains a hashed value that acts as a key to allow TAF to run on an approved computer. The other settings define the sound effects files that should be played for three different game events.

  • When a timed event is triggered.
  • When the timer is decremented because the player has received a clue.
  • If the game duration time has expired but the player has not completed the game. This is the "times up" sound.
# hash
.hash_value be933f64

# timed event triggered
.timed_event simple-game-countdown.wav

# decrement timer - clue given out
.decrement_timer arcade-retro-game-over.wav

# run out of game time
.timed_out timer-reached-zero.wav

## end ##

Giving Commands to TAF - Aliases

Game authors are free to use any words in the solution string for a problem. This provides a creative freedom to the authors. They can use any command that makes sense to the internal logic of their game. They’re not restricted to using the built-in commands that come with the TAF software. This game-specific set of commands is known as the game vocabulary.

Perhaps a game calls for “magical” or archaic command words, or perhaps a game strives to use as close to modern, natural language as possible. The choice is entirely down to the game author. Even more flexibility can be provided through the use of aliases.

Aliases are alternative words that can be used instead of game-specific vocabulary words. Suppose a problem in a game requires the player to put the correct combination into a combination lock. In the case where the combination happens to be 3653, what should the solution string be?

  • enter 3653
  • turn 3653
  • dial 3653
  • combination 3653

Or something completely different?

It might sound odd to someone to say “dial 3653”, but sound natural for them to use “try 3653”. Aliases allow both of these terms — and others — to work as valid, acceptable solution strings.

Solution Strings

The action that solves a puzzle is called its solution, and it is entered into TAF as a solution string.

The use of those words is flexible too. Words can be defined as aliases of other words. For example if the phrase to solve a particular puzzle was “put on the head torch”, the game author may define “turn” and “switch” as aliases for “put”.

That means the player could solve the problem by typing any of:

  • put on the head torch
  • turn on the head torch
  • switch on the head torch

Giving Commands to TAF - System Commands

System commands are commands that usually—but not entirely exclusively—control TAF itself, rather than the game play. Loading a game, closing TAF down, or turning sound effects off and on are the types of things you can do with system commands.

In moderator-led sessions, such as virtual escape rooms, the moderator will fInd some system commands make hosting and controlling the event easier. In turn, that improves the experience for the team of “captives”.

System Commands begin with a full stop "." which differentiates them from regular user commands. It also helps prevent you issuing a system command by mistake.

Command Abbreviation Behaviour
.quit .q Closes TAF. If there are unsaved changes, you're prompted to make sure you really want to close down.
.exit .x Exactly the same as the .quit system command.
.autocls .ac Toggles the automatic screen clears in the Main window. With auto screen clears on, whenever the player moves to a new location the screen is cleared before the location is described. autocls is ON by default.
.sound .sfx Toggles sound effects on and off. Solving problems, timed event messages, and timer decrements due to clue penalties can be accompanied by sound effects. Sound effects are ON by default.
.dump .dp Writes (dumps) the contents of the Trace window to a log file. The log file name is created automatically. It is a timestamp, of the form TAF_2022-01-01_13-45-14.log. Note that this doesn't turn on saving to a file. It saves a snapshot of the contents of the Trace window to the file, then closes the file.
.tron .trn Opens the Trace window if it is not visible.
.troff .trf Close the Trace window. Logging messages are still sent to the Trace window even when it is not open.
.showtimer .st Displays the Timer window if it is not open.
.hidetimer .ht Closes the Timer window. The timer countdown continues even if the timer is Timer window is hidden.
.duration .dur Sets a new duration for the timer. The time can be specified in seconds or minutes and seconds. Both .duration 3600 and .duration 60:00 set the timer value to 60 minutes. Setting a new duration stops the timer. When you are ready to start (or restart) your game, click the start button in the Timer window, or use the .timerrun system command.
.timerrun .tr Starts the timer running. Has no effect if the timer is already running. It's the same as clicking the Start button in the Timer window.
.timerstop .ts Stops the timer running. Has no effect if the timer is already stopped. It does not reset the timer. This allows you to stop the timer, do something elkse, then come back to the game, restart the timer, and carry on. That means the timer displays your actual game time, not the real-world elapsed time. It's the same as clicking the Stop button in the Timer window.
.timerreset .trx Resets the timer to the last specified duration. This only works if the timer is stopped. The last specified duration might be the TAF default timer value of 45:00, a game target completion time which is set by the game author, or a value that has been set using the .duration system command. It's the same as clicking the Reset button in the Timer window.
.time .tm Displays the elapsed and remaining game time. Useful if you've hidden the Timer window.
.clue .cl Requests a clue about a problem, set dressing, or location. If there are clues available for the item and they haven't been previously displayed and in the case of problems, the problem hasn't been solved, a clue will be displayed in the Main window. Whether clues are available at all, is a choice made by the game author.
.version .ver Displays a paragraph of data about the version of TAF you're running, and some details about the current game, if any.
.system .sys Lists all of the system commands in the Main window. Note that they are shown without their leading full stops. Regardless, make sure you preced each one with an initial full stop.
.score .sc Displays the score. Points are awarded for visiting locations, interacting with objects, and solving problems. A bonus is applied if you score the maximum points in each of those categories. Points are deducted each time you recieve a clue.
.manifest .man Lists the manjor items defined in a game in the Trace window. The game title, locations, objects, problems, clues, and set dressings are listed. The current location is also displayed.
.aliases .al Lists all of the alias definitions for the current game.
.docs .docs Opens the (local) TAF documentation website on http://localhost:8080. This must already be running.
.touches .to Lists all locations, objects, problems, aliases, and set dressings that directly link back to the named location. If no location name is provided in the command the current location is used.
.load .lo Loads a GDL file into TAF, and starts the game from the start.
.save .sa Saves the current game state as a TAF file. To reload and start the saved game from where you left off, use the .restore system command.
.abandon .ab Purges the current game from memory.
.restore .res Loads a TAF saved game file.
.restart .rx Reloads the current game. This is the same as using the .abandon and .load system commands one after the other, and loading in the same game.

Giving Commands to TAF - User Commands

Game play is achieved by entering commands. These tell TAF what you're trying to do. If the command makes sense for the situation you're in, TAF will carry out that command in the game, and tell you the results of your actions.

These are the built in user commands. Games authors can add their own commands, and as many of them as they need, when they write their games.

Commands can be entered in full, or the abbreviation for each command can be used.

Command Abbreviation Behaviour
north n Moves you to the destination immediately to the north of your current location.
south s Moves you to the destination immediately to the south of your current location.
east e Moves you to the destination immediately to the east of your current location.
west w Moves you to the destination immediately to the west of your current location.
northeast ne Moves you to the destination immediately to the northeast of your current location.
northwest nw Moves you to the destination immediately to the northwest of your current location.
southeast se Moves you to the destination immediately to the southeast of your current location.
southwest sw Moves you to the destination immediately to the southwest of your current location.
up u Moves you to the destination immediately up from your current location. This is the command you'd use to climb a ladder, ascend stairs, or climb a rope.
down d Moves you to the destination immediately down from your current location. This is the command you'd use to descend a ladder or a set of stairs, or go down a slide or a fireman's pole.
about ?? Displays the TAF About box.
directions dir Displays a list of the valid directions of travel from the current location. This is displayed automatically when you arrive in a location, but it can quickly scroll off the screen if you examine a lot of things or solve a couple of problems in that location.
peek pk Displays a list of the valid directions of travel from the current location, together with the names of the locations you'll arrive at, if you travel in each of the directions.
where wh Gives a description of the current location. This is the same description you get when you first arrive at a location. You also get the list of valid directions, too. See the zap command, below.
carrying ca Lists the items that you've picked up on your travels and are currently carrying, or wearing if they're items of clothing.
examine ex The examine command gives a detailed description of a single item. Whether a detailed description exists for an item or not is entirely down to the game author of course. Detailed descriptions may be available for the current location, objects, problems, or set dressings.
describe dx Exactly the same as examine.
show sh Displays an image of an item. Images can be displayed for objects, problems, or set dressings.. That is, if they've been configured within the game by the game author. And that's going be doubtful, because I don't like this functionality!
commands co Displays a list of the user commands available to the player. This list is the combination of the TAF built-in commands, plus any command words that have been added to TAF vocabulary by the game author.
vocab voc Displays a list of the command words that have been added to the TAF vocabulary by the game author, in the current game.
quick ? Displays a quick one-line description of the built-in TAF user command or system command. Note that you can't get a definition of the command words that have been added to TAF vocabulary by the game author.
cls cls Clears the TAF Main window.
zap z Like using the cls command immediately followed by the where command. This command is useful as the very first command to use in a game. It'll clear the scene-setting preamble off the screen and to reveal the details of the starting location all by typing z and hitting Enter.
take ta Takes an object from the current location.
drop dr Drops an object in the current location.
carrying ca Lists the items that you've picked up on your travels and are currently carrying, or wearing if they're items of clothing.
commands co Displays a list of the user commands available to the player. This list is the combination of the TAF built-in commands, plus any command words that have been added to TAF vocabulary by the game author.
vocab voc Displays a list of the command words that have been added to the TAF vocabulary by the game author, in the current game.