Bringing more power to gamebook mode in Quest 5.4

27 February 2013

Quest started out as a text adventure system. Many people call text adventures “interactive fiction”, but to me this is a fairly broad term, encompassing kinds of games that are not text adventures in the traditional sense. The “Choose Your Own Adventure” books are also a type of interactive fiction, but they are not text adventures - to me, anyway.

Systems like Twine and Inkle are starting to become more popular, bringing interactive fiction to a wider audience. These games follow the “Choose Your Own Adventure” model of branching narratives, so they are “interactive fiction” but not “text adventures” by my definition, as there is no simulation of the objects in the game world in the background. However, some people do refer to these games as text adventures, so it seems pretty hard to pin down the terminology.

It was the rising popularity of Twine, Inkle etc., which inspired me about a year ago to add gamebook mode to Quest 5.2. My vision is for Quest to be a platform for all kinds of interactive fiction - whether that’s the rich world model of a text adventure, or the simpler multiple choice of the CYOA style gamebook. And, indeed, why shouldn’t one game be able to combine the two approaches?

The initial implementation of gamebook mode was really simple - multiple choice games were all it could handle. You could create pages, with links between the pages. That was it - nothing dynamically generated, no scripts, no game state of any kind except the page the player is currently on. This is fine if you want to create pure CYOA, but it’s a bit limiting if you want to do anything more complicated, like emulate dice rolls within a game, or make small changes to a page’s text depending on the path the player has taken to get there.

But it was fine for an initial attempt, to see if people would even use gamebook mode in the first place. Happily, they are - which makes sense, as it’s a much simpler way to flesh out a quick interactive story than creating the world for a text adventure.

So, in Quest 5.4, I have made a number of improvements to the capabilities of gamebook mode. These have actually been pretty straightforward to implement, as gamebook mode always sat on top of the same platform as the text adventure mode - it was still using Quest’s scripting engine underneath. The changes I have made simply expose some more of that power.

Gamebook Scripts

There is a new page type, “Script”. When the player visits a script page, the script runs. The script can do anything - it may dynamically print out some text with some hyperlinks, or it might just send the player immediately to another text page, chosen according to some condition.

It can also run a “get input” command to get the player to type something, then maybe store that in an attribute, or send the player to a page based on what they typed in.

The Script Editor is the same as in text adventure mode, although the commands that can be added are slightly different. Many text adventure script commands relate to objects, and these are not relevant in gamebook mode and so are not displayed. This means that the Script Editor is a bit simpler in gamebook mode, though it still has access to “if”, calling functions, running JavaScript and so on.

Text Processor

The new Text Processor I described in an earlier blog post is also available in gamebook mode. A similar set of codes is available, so you can conditionally print text even without using a script page.

For example, you can take advantage of the fact that pages have attributes like “visited”, to write some text only if the user has visited a particular page. If you have a page called “cake” which the player may visit if they choose to eat a cake, you could write this on a later page:

Your mother stares at you. {if cake.visited:"You have chocolate all over your face," she says.}

You can also include links to other pages directly within the page text (instead of having them underneath), and it’s also finally easy to add images wherever you want them in the text using the {img} code.


This release brings gamebook mode closer to text adventure mode, by opening up a lot of functionality to both. Now in gamebook mode, things can happen “behind the scenes” with richer state tracking, instead of the game being forced to have a pure branching structure.

For a future release I would like to further bring the two together, with the ability to add gamebook pages to a text adventure game. This will be useful for conversation trees for example, or maybe you just want to have a game that features both kinds of interaction in different sections. You could do this already to some extent - in the text adventure mode you can add custom commands, custom hyperlinks, and turn the command bar on and off as required, but it’s my job to make it easy for you to create the kinds of interactive fiction you want to write. So please do let me know what you’re up to with Quest and how I can help you!

I’ve only got a few more things to do before the beta version of Quest 5.4 is ready, so this should be available for you to play with in the next few days. Or as always, the nightly build is available for the brave and impatient.

Quest 5.4 Text Processor - easier adaptive text and links

27 February 2013

It is very easy to generate and manipulate text with software, which is why text adventures were some of the very first computer games ever to be created. Furthermore, the manipulation of words can make it easier for a text-based game to feel as if it is genuinely responding to the player’s actions - it is far simpler for software to tweak a paragraph of text than it is to tweak a graphical environment.

As the player interacts with a game, they can of course make choices which affect the outcome of the story - choosing which branch of a narrative to follow - but it is also possible to construct a game where the player is not so much directing the action as simply telling the game a bit more about themselves. An interactive game doesn’t necessarily mean that the player decides on the outcome - the effects could be more subtle than that. A character may say slightly different things to the player depending on what happened earlier in the game, for example, but this may not have any effect on anything else that happens.

So, it’s important for a text game engine to make it easy to generate adaptive text. Quest does a lot of this already without an author having to do anything - it will automatically generate a list of objects that are in the current room, for example. But anything more advanced than that generally has required the use of scripts. If you want to show a particular sentence only if the player has performed some action, you have to run an “if” script to print that sentence. The sentence will stand on its own, with a line break before and after, so this is more of a mechanism for complete paragraphs than it is for minor details within text.

It’s also harder than it should be to display object hyperlinks. These hyperlinks are a key way that players interact with games, and get displayed automatically as part of the room description, but it’s hard to easily “linkify” an object that you make a passing reference to in a paragraph. That’s because you have to be running a script again, and use the ObjectLink function in an expression.

Quest 5.4 addresses these issues with a new feature, the text processor. This is a core library function, so it’s implemented entirely in Quest’s own ASL programming language, and it steps in at the last moment, just before text is written to the screen. This means you can include text processor codes anywhere in your game - you can use the codes inside a “print message” script command, but you can also use them inside a plain-text object description. This makes it much easier to have dynamically generated text without having to create a script.

For example, here’s how we might write a description of a hungry mouse:

Text Processor - editing

We’re just using a text description here, not a script. The editor provides some helpful buttons so we don’t have to remember the available codes, and we can also easily add object links by clicking the “Object link” button - we can choose an object from the list that appears.

When we run the game, here’s what we see. The “Aaargh, a mouse!” text only appears the first time:

Text Processor - output

We can easily include conditional text using the {if} code, which allows us to check the value of game or object attributes. For example, if we’re looking at an apple and the player’s health is low, we might write:

That looks like a tasty apple. {if<10:It would be a very good idea to eat it.}

Using the {command} code, we could actually improve this and give the player an “eat apple” link. You can nest codes inside each other, so the link will only appear if the player’s health is low:

That looks like a tasty apple. {if<10:It would be a very good idea to {command:eat apple:eat it}.}

There is also the {random} code which allows you to choose text at random, and {img} lets you include images in-line with text.

The Quest 5.4 Beta release is very close now, but if you just can’t wait you can try out the nightly build.

Quest 5.4 Script Editor - showing you teh codez

25 February 2013

Scripts are everywhere in Quest. Want to play a sound when the user looks at an object? Choose “Run script” and then you can. Want to let the player pick up an object only if they are already carrying another? Choose “Run script” and you can.

Quest’s script editor is easy to use even if you’ve done no programming before, because you can simply choose from a categorised list of commands. In Quest 5.4, this has been enhanced so that commonly used script commands are quickly available using buttons at the top.

Script Adder

As before, after choosing a command, it appears in the script editor, where depending on the command you chose, you can fill in text, choose the image, etc.

Editing a script

More complex script commands have more things to choose from, and may themselves have places where you can add more script commands inside - as with the “if” command:

Editing a more complex script

This design works well for short scripts, but can become cumbersome if you’re trying to code anything more complicated.

The Quest 5 editor has always offered a “Code View” of an entire project, but once your game gets large, it can be a pain to switch back and forth - once you’re in Code View, you no longer have the tree view of your game’s objects, and the editor has to reload your entire game if you make changes and want to switch back to the normal editor. Also, Code View is only currently available in the Windows desktop version - it is not yet available in the web version.

Code view for a whole project

These limitations are addressed by a new feature coming to Quest 5.4, in both Windows and web versions - Script Editor Code View.

This lets you easily toggle between the friendly English language user interface, and the underlying code. The new button is highlighted below, and appears if you have Simple Mode switched off.

Code View button

This is the effect of turning on Code View for the whole script:

Script Editor Code View - whole script

You can also turn on Code View just for any nested script section:

Script Editor Code View - nested script section

You can make changes in the Code View without having to reload the entire game.

Making changes in Code View

If you switch back to the English language UI, your changes are immediately reflected in the friendlier version.

Making changes in Code View

What if you make a mistake? The advantage of the friendly English UI is you can’t make syntax errors. No such protection in Code View though, so what if you miss off a bracket?

Making a mistake

Switching out of Code View shows us we made an error, but the rest of the script loads properly. We can easily correct the mistake.

Showing the mistake

All of this works in a very similar way in the web version. The Script Editor now has Code View buttons, allowing you to view the code for a whole script, or any nested section.

Web Editor Script Code View

The Code View button pops up an editor allowing us to view or change the underlying script code.

Web Editor Code View

I hope these changes will be very useful for people on the forums - you’ll now be able to easily copy and paste little script sections, which will be great for people seeking help with a game. When a script has been pasted in, you can toggle back to the normal English view and carry on working as normal. The script you’ve just pasted in will be displayed in English so will hopefully make more sense! You’ll also get a feel for how scripts work in the first place, which I think fits very nicely with Quest’s aim to provide a gentle introduction to programming.

A beta version of Quest 5.4 should be available soon, but if you’re feeling brave you can download the nightly build of the Windows desktop version at CodePlex.

Hashtag self indulgence

23 February 2013

What is bothering me about Twitter? And why do I imagine that anybody cares about the answer to that question?

I’ve been working from home, for myself again for the last couple of months. I quickly settled into my usual home-based daily work routine - get out of bed, stumble over to the computer, open three browser tabs: Gmail, Google Reader, TweetDeck.

But I began to wonder where my mornings were going, and why I was getting annoyed when I glanced over to that TweetDeck tab, sat there keeping me company on a secondary monitor. It wasn’t the replacement for the office banter that I was hoping for.


I felt frustrated and bitter that I wasn’t “succeeding” at Twitter very much. Why don’t more people follow me, interact with me, pay attention, listen to what I have to say, like me! Love me!

Maybe it’s because I’m a software developer so I don’t understand those squidgy lumps of flesh that actually use software. Humans are interesting, complex and confusing. I find this the case both online and offline, and have done all my life. I’m not gregarious and I’m not the life and soul of the party, although it seems like that would be nice. I don’t have vast numbers of casual acquaintances in the world of atoms, so why should it be any different in the world of bits?

Most people seem to have more success on Twitter than me, in a similar way that most people appear to have more successful social lives than I do. But this can actually be explained with maths! The average person’s friends will, on average, have more friends than them, because you’re more likely to be friends with somebody who has a lot of friends. It’s called the Friendship Paradox.

(There is also the Friendship Paradox Paradox, which is a term I’ve just invented for where you find yourself with even fewer friends after explaining the Friendship Paradox to them).

It’s similar reasoning which explains why everybody you see in the gym is fitter than you - it’s because they’re the ones that go to the gym more often, so they’re just more likely to be there in the first place (I don’t actually go the gym. I’m not mental).

Likewise the people you see posting on Twitter all the time are the people who post on Twitter all the time. The fact that I’m following them means it’s more likely that they are somebody that people follow. So it makes sense that the people I see on Twitter are the more successful users. The people who are shit at Twitter just don’t feature heavily on my timeline in the first place.

This certainly appeals to my rational brain, so I should therefore have no logical reason to feel bitter. That won’t stop me, of course. I’m sure I’d have more friends and followers if I understood humans better, but being less of a curmudgeon may also help - I would also have to actually like people’s tweets more.


It quickly became a cliché to say that Twitter was all about people posting pictures of their lunch, but the reality seems no less self-involved, or maybe I was just following all the wrong people. It may not be their meals but it will be minutiae of their everyday lives, exhortations to watch their films, come to their events or download their apps, their attempts at jokes, their grasping interactions with celebrity Twitterers, meta-tweets about how many followers or retweets they’ve got, and pictures of their fucking cats.

I’m not any better. My tweets are no different to anything I’ve just listed above. I make attempts at humour and I post my half-baked opinions just like everybody else. I want people to download the software that I’ve written. And I want people to read my blog posts, just like this one.

I just don’t see what good this is ultimately doing.

The Game

You can be winning the game of Twitter but you’re not actually achieving much. You can think you’re building connections, but connections based on what? Collecting all of these contacts to do… what, exactly? Connections don’t build things. Are your followers going to become people who will work with you because of your Twitter connection? Are you building up a fan base of people who are going to buy your products? Or is it simply a narcissistic need to keep reminding people that you exist?

Remember that the majority of internet users don’t use Twitter at all. This may not matter if Twitter users are more influential than non-users - maybe it’s worth spending some time to try to get these people excited about your stuff. Of course Twitter users want you to believe that Twitter users are influential, even though they’re a small portion of the population. But I think it’s easy to forget that there are other people, people who are not spending all their time on Twitter, that it may be more valuable to try and reach.

You could spend ages building your Twitter “brand” instead of actually getting some work done. It may feel like work and you will feel very satisfied when you see your stats increasing. Twitter has gamification built right in - all social media does. Your reply, retweet and follower counts are all points in the game of Twitter. But it is just a game.


Most of the time you can’t distill the value of something down to a number. What metric can I use to decide if some software I write is good, or a blog post is valuable? You could get a lot of comments on a blog post, but maybe only because you were being stupid or controversial. Somebody might read your blog post and it could completely change the way they think about the world, but will they necessarily write a comment or retweet it? You can only expect comments from the kind of people who feel the need to comment on blog posts, which is only a small fraction of the population. Likewise, who retweets things? Retweets are like laughter - people don’t laugh just because they find something funny. Most people don’t laugh when they watch sitcoms at home on their own. It’s a social signal - you want people to know you find something funny (this is not a conscious process of course). Similarly people don’t just retweet something because they like it - they want people to know that they like it. It’s part of a statement about who you are. Even if nobody actually reads stuff that people retweet (I skim people’s RTs quicker than their original tweets, and I can’t be alone in this). So it seems pointless - a quick click to make another few sketched lines on the self-portrait we create on Twitter, which makes us feel as though we’re expressing ourselves, that we’re a valuable conduit of information, even if ultimately nobody gives a fuck.

You can spend ages reading tweets and learn absolutely nothing. Nothing in your timeline is going to help you become a better person or actually get some shit done. You can work for ages, posting, retweeting, mentioning, growing your followers, following the right people and hoping they follow back, building up an illusion of your own significance, but what if it doesn’t amount to anything real?

You can be followed by thousands but many of those people will never even see your tweets anyway. Different people use Twitter in hugely different ways. Some people follow tens of thousands of accounts. Even if they check Twitter all the time, they may only be paying major attention to their @ mentions, maybe not checking their main timelines at all or only skimming for those gems of information that are directly relevant to them, if they happen to glance over at the right time as they scroll past. And for people who follow a small number of accounts, the ones who don’t spend all day with TweetDeck open, because they’re actually doing useful things, it’s easy for them to miss your tweet entirely.

Changing my behaviour

I used to have TweetDeck open constantly. But I don’t need to be at the water cooler or bar all day, talking about myself and imagining that other people give a damn about what I think. So now I try to ration my usage. I check it a few times a day, perhaps. I don’t follow as many people as I used to - I “culled” maybe half of the people I followed. I don’t need to see what famous comedians or journalists or other people with tens of thousands of followers or more are saying. If it’s important, I’ll see it eventually anyway. The power of Twitter should be in maintaining genuine personal connections, which takes a lot more work and can only be done one at a time, and requires a slower drip-feed of information than the firehose of irrelevant crap you get when you follow loads of people you hardly know.

So I should be satisfied with my relatively low number of followers and people I follow, in the hope that there’s a more meaningful connection there.

Of course, I’m a complete hypocrite. Which is why I’m posting this. Why on earth do I imagine that anything I’ve said above is in any way novel or interesting? Why do I think anybody would care in the first place? I cannot complain about the quality of posts on Twitter. I am just as bad, if not far worse - look, this is 1658 words of unexpurgated moaning crap. I could have spent today doing something useful, but I wrote this instead. At least it doesn’t matter too much because it’s a Saturday. So, anyway, if you want to give me some metrics to massage my ego, you can express your displeasure or otherwise in the comments below, or follow me @alexwarren. Sorry, I’m a wanker. #hopethatdoesntinvalidateeverythingijustsaid #offtowritesomemoresoftwarenow

Spanish adaptation of Scott Adams text adventure for iPhone, iPad, Android

6 February 2013

The latest Quest-powered app “Aventura Pirata” is now available from the App Store and Google Play, for smartphones and tablets.

Aventura Pirata is a version of Scott Adams’s 1978 game Pirate Adventure, translated into Spanish and adapted for the Quest platform by Mauricio Díaz García.


The game supports the usual hyperlinks and tabs to reduce typing. Selecting an object produces a list of verbs, and exits are visible on the Exits tab (Salidas).


I think this game would be a useful and fun aid for anybody teaching or learning Spanish - it would be great to hear from anybody using it in this way.


In other news, Escape From Byron Bay is now available for Android as well as iOS.

If you’re interested in writing your own text adventure app, please take a look at the Apps page on the site. Any Quest game can be converted into an app, and it’s great to start making a range of different titles available. More are coming soon, but more are needed, so please get in touch!

Apple have recently introduced a new domain, which makes it very easy to find all the Quest text adventure apps for iOS: The equivalent page for Android is here.

All Posts