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 player.health<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 player.health<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.

Success

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.

#lunch

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.

Value

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.

Screenshot

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).

Screenshot

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.

Screenshot

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 appstore.com domain, which makes it very easy to find all the Quest text adventure apps for iOS: appstore.com/textadventures. The equivalent page for Android is here.


Text adventure games are still new

29 January 2013

Cross-posted to Gamasutra. This blog post is based on part of my AdventureX talk from December - hopefully a video of that will be available soon.

Every couple of weeks, it seems, another games journalist writes an article about how they’ve rediscovered the long lost art of the text adventure game. After a few minutes looking through Wikipedia, they write an article which will inevitably talk about green screens, clattering keyboards, and grues. Then they will talk about a somehow thriving yet hidden “scene” of people who are still creating and sharing these games like some kind of long-forgotten tribe that had been cut off from the rest of the civilised world.

As the creator of a text adventure engine, Quest, these pop up in my Google alerts with tedious regularity. They are so boring and predictable. And more importantly, they are utterly short-sighted.

Many people think of text adventures as an old-fashioned game form, something that was maybe acceptable in the 80s but which we have now outgrown and left behind. But I think the opposite is true. Right now, we are early in the history of text adventure games. Their time to shine is just beginning.

Le Voyage Dans La Lune

The image above is from the film Le Voyage Dans La Lune (A Trip To The Moon), a French science-fiction film from 1902. For me, it’s the image that immediately springs to mind when I imagine the very early days of cinema. You can watch it on YouTube if you have a spare 10 minutes. If you do, I want you to notice one thing…

It doesn’t look very much like a modern film, does it?

That’s because it’s over 110 years old, of course.

Nearly 40 years later, Orson Welles released his first film, Citizen Kane. You can watch various scenes on YouTube too. This film pioneered many aspects of modern film-making.

It took 40 years to get from Le Voyage Dans La Lune to Citizen Kane.

Forty. Years.

40 years from the early days of film-making to get to something that even starts to look like a modern film. And this wasn’t forty years of hobbyists dabbling with making little movies in their spare time, to be enjoyed only by other hobbyist film fans. This was 40 years during which films were a mainstream entertainment format.

And of course film continues to develop today. Citizen Kane looks somewhat different to Inception, for example (yet I wonder if it’s closer to that than Le Voyage Dans La Lune?)

The first text adventure was written in about 1975, which makes text adventures only 38 years old. Text adventures have never really been a mainstream entertainment format. IFDB attempts to list every work of interactive fiction, and it currently lists 4,444 games. As a comparison, IMDB currently lists 48,525 films created during the period between Le Voyage Dans La Lune and Citizen Kane.

So, there are hardly any text adventure games, really. In that light, it seems completely ridiculous to think of text adventures as some kind of ancient game form. We have barely even begun.

We cannot possibly argue that text adventures have matured. We cannot reasonably declare that we know how a text-based interactive story should work. We will need a lot more games to be written, and a lot more experimental works to be created, before we will be able to see which direction this particular art form is taking.

Therefore when thinking about the future of text adventure games, I like to pretty much ignore the 1980s entirely. Those games have interesting historical value, but will look pretty quaint when we put them next to the text adventure games that will be created over the next few decades.

Citizen Kane

There is a quote from an interview with Orson Welles which I find particularly inspirational:

Interviewer: What I’d like to know is, seeing that you’d never in all your life, ever made a film before Kane, and had never so far as I’m aware been in a studio before Kane … where did you get the confidence from to make a film with such -

Welles: Ignorance. Sheer ignorance, there’s no confidence to equal it. It’s only when you know something about a profession, I think, that you’re timid, or careful.

What I take from this is that it doesn’t matter if you don’t know much about the existing text adventure games - just the vision and desire to create an interactive story will be enough. Don’t be afraid to try something new.

And right now is a great time to start reimagining what a text adventure is. Why?

Because this never happened:

Playing text adventures in bed

And this never happened:

Playing text adventures on the tube

(My Photoshop Masterclass was, coincidentally, another thing that never happened - but you get the idea).

Desktop computers, terminals and laptops were never really the right devices for playing book-like games. Tablets and smartphones are the natural home for interactive fiction - and it’s only in the last few years that these devices are in everybody’s pockets. People are used to taking their phone out of their pockets to play with something for a few minutes, and text adventures can perfectly fill that need. Apps can bring text adventures where they belong - in front of people who want to read, wherever they are.

Unlike early film, the tools are available to everyone. My own engine, Quest, is free and open source. You don’t need any programming experience to get started with it, and it can run entirely in a web browser so you don’t even need to download anything. The system is open and hackable, with a core library written in Quest itself which defines the default behaviour - so you can change fundamental things about how the system works, even without going into the source code.

Quest is built upon web technologies, so games can run anywhere, or be packaged with Phonegap and be turned into offline apps. Hyperlinks mean that “guess the verb” is a thing of the past - if you want to, that is, because authors can disable hyperlinks if they choose.

HTML5 opens up a lot of possibilities for experimenting. For example, using Canvas we can dynamically draw maps:

Game with map

Of course, HTML is designed for laying out text - so there is plenty of room for experimentation here. For example, why not split the screen in two:

Split screen text adventure

The images above are very basic protoypes, but of course you can tap into the full power of CSS and JavaScript to give games your own look, and build your own UI. Perhaps you would want to remove the command bar entirely, or add your own information panes? Maybe change the UI for each scene in the game. Have players type inside a speech bubble, or inside a newspaper column. Make text move, blur, melt away. There are so many possibilities - so many things that have not yet been tried. Some will work, some will not, some will simply inspire other authors to do better.

And even within the writing, there is much experimentation to be done. Text adventures are typically written in the form “You can see… You can go…”. Why not in first person, or third person? Why does it have to be the present tense - why not past tense? Maybe the future tense could even work. We just don’t know - yet.

What about other technologies and APIs we could get a game to tap into? How could we use geolocation within a game? The ability for players to take photos and record sounds? How can we have players interacting over the internet?

There is so much unexplored potential for text-based games. With new devices and technologies, we are really only just getting started. I think we need a new generation of authors to come along, unhindered by 1980s expectations of what a text adventure should look like, and in the spirit of sheer ignorance, create games that will excite and inspire us all.

I hope that Quest is a platform that will enable that - but I’m sure there are many ways it needs to be improved to let that happen. I’m always open to ideas so please get in touch if there’s anything I can do to help your vision become reality. You can email me at [email protected] or find me on Twitter @alexwarren.


All Posts