Writing Interactive Stories with Twine

The latest story in my 52 Murders project is a branching narrative called Breakdown. It’s my first proper attempt at interactive fiction, which is an area I have a sort of love/hate relationship with. On the one hand, I think it’s an interesting idea to introduce choice into stories, offering the reader different ways of experiencing a story. On the other hand, I find old-school text adventures to be impossibly frustrating and a horrible waste of time. I’ve watched Get Lamp, which details the rise and fall of the text adventure, and I came away with two main points.

  1. The idea of interactivity in fiction isn’t a new idea, but it is one that still hasn’t been done well (as far as I’m concerned).
  2. I never want to be like the people who write, program or enjoy text adventures.

Their enthusiasm is commendable, but I wouldn't want to be locked in a classroom with any of them, you know what I mean?

While I’ve always liked the idea of adventure games, I’ve come to the conclusion that I’m not really the sort of person they’re aimed at. I’ve completed The Secret of Monkey Island, got a reasonable amount of the way through the Indiana Jones Adventures and a fair way through most of the Broken Sword games, but I don’t think I’ve ever got past the first room of a text adventure. Why is this? I think there are a couple of reasons.

The first is that my primary interest is making stories. I’m used to writing them and I enjoy being told them. What I don’t like doing is writing other people’s stories for them and that, for better or worse, is what text adventures feel like to me. I don’t want to work out what you think the right thing to say to the gatekeeper is. I either want to decide for myself or have it told for me. Text adventures feel too much like work, and not work that I enjoy.

The other reason is that I don’t like puzzles. Some people love being stumped. I’m not one of them. I don’t mind working things out, but I don’t enjoy the obtuse leaps of logic that are the main selling points of some of these games. I’ll freely admit that part of it’s laziness. I just can’t be bothered to devote the mental energies. Also, there’s the problem that games tend to be made by programmers. While I’m not disputing the writing quality of many text adventures, the inherent skills required for making such a thing depends on a logical understanding of locations, variables, logic, strings, integers and conditional loops. As a result, the thinking needed to progress tends to stem from this kind of thinking and it’s not something that I’m interested in, nor am I willing to relearn the skills needed to do so.

This is also why I’ve had so much trouble trying to make my own forays into interactive storytelling. Whether it’s games, branching stories, interactive fiction or even simple experiments with Javascript, there’s some part of my brain that just doesn’t grasp the fundamental aspects of programming. I read books and run through the courses and my brain says “yes, that makes sense, yes, I understand this” but when it comes to applying that knowledge to something I want to do, I just end up staring at the screen going “duh… I don’t know.” Which means I hate myself, because I know there are all sorts of interesting things that I’d like to try, but don’t have the grammar and syntax to make them happen. I’ve tried Processing. I’ve tried Javascript. I’ve tried Actionscript and Python. I’ve even tried Inform 7, the natural-language text adventure programming kit, and found it even more confusing than any other programming language I’ve ever tried. Somehow, it being closer to real text makes the fact that it doesn’t work even more annoying.

Truth be told, I’m a child of the GUI. Yes, I had an Amstrad CPC, but I didn’t program it. (I tried to learn by typing in the program listings from Amstrad Action, but would arbitrarily change variable names to ones I liked better. It was no surprise, therefore, that these programs never worked for me.) My only uses were playing games and writing stories. A few years later, I got an Amiga. Again, it was mainly games and stories, but I would also use coverdiscs to explore graphics, music and other things. This was all done with a mouse. The keyboard was for typing, triggering samples or quick-selecting tools in Deluxe Paint. When I inherited a friend’s 486 PC, it had Windows 95 on it. I never had to tangle with DOS. What I learned about HTML, I learned from Dreamweaver. What I learned about motion graphics, I learned from Flash. I’ve never been a hacker. I don’t even like games that involve hacking. I prefer kicking in the door and shooting everyone with a bazooka.

But I keep coming back to the idea of interactive stories, because I feel there’s something there that appeals to me. Having admitted to myself that a blank screen and a command prompt isn’t the way for me to start, I’ve been seeking out alternative ways of making these things – something with buttons that I can click. I use a brainstorming program called xMind quite extensively for story ideas and it occured to me that there should be something similar for mapping out branching narratives.

Twine is a cross-platform toolbox for creating interactive stories and is simple enough for someone like me to use. You have a start point and you add branches from there by adding boxes and linking them together. There’s some other stuff under the hood for setting conditions, but these are so simple that even I could get my head around them. In short, it’s the tool I’ve been looking for, at least in the short term. Rather than have to sit down and learn syntax and structure, you just write and string things together. I wasn’t really looking for sophistication, I just wanted something that I can use. Twine fit that bill perfectly. The overview lets you see how sections of the story (“Passages” in Twine’s parlance) interconnect. Links are created by enclosing options in [[double square brackets]] and the whole process is amazingly quick.

My first effort with Twine was a story called Breakdown. I’ll freely admit that it’s not amazing. The setting is a cliche in itself and the options presented aren’t particularly interesting. As it’s been created in the context of 52 Murders, virtually all options lead to a death, which would probably be hugely frustrating and unfair if it were a game, but that’s not the intent of the piece. The aim isn’t to win, but to explore the options laid out before you, hopefully in a manner that’s accessible as possible. The choices tend to be either/or and I don’t think there’s any backtracking or loops in the story (apart from one obvious one, which was a cheap ploy by me to excuse the fact that I didn’t know what else to do).

If nothing else, Twine made me feel as if I could just jump in and start writing, which tends to be the way I like to work, even if it’s just outlining the barebones and then going back and filling in the details. In this case, I laid out the choices and plot points as I went. This is probably the wrong approach to take, as I sometimes found myself painted into a corner, faced with logistical problems of how to link up various passages so that the overall plot made sense, no matter which way you went through it. I didn’t mind, though, because it was the sort of thing that I like to do. Making the pieces of the various plots work was my puzzle and one that I enjoyed working out. (This may mean that Breakdown was more fun to make than it was to play, but that doesn’t bother me too much. Experimentation is about failure as much as success.)As much as anything. I hope that Breakdown will have allowed me to get some of the more hoary cliches out of my system. It’s a really straightforward adventure-style story in the second person. I think I’d like to try some more interesting things with it.

The good thing is, I’m not afraid to try.

Addendum – Technical Problems

The main problems I had with Twine were technical. I couldn’t get it to install on my Windows XP netbook and the Mac OS version crashed a few times on me, usually at the point when I thought “I should probably save soon”. Hit “Save” after doing anything. Seriously. It’s not that bad, but the immutable law of crashes is that they’ll happen at the worst possible time.

Stories get exported as a single HTML file with embedded Javascript and CSS. I found I needed to tweak a couple of things in order to get the story working the way that I wanted. I used the “Jonah” template, which shows each passage in a continual sequence, rather than clearing the screen after every choice. In order to prevent the system getting confused, I had to change all story links from the usual format:

* [[Option A]]
* [[Option B]]

To this customised version, which blanks out the alternates when you choose one.

<<choice "Option A">>
<<choice "Option B">>

I thought I was being clever by laying out my story in the normal way, then exporting the source code into a text editor and replacing the square brackets with the pointy ones. I was not. When I reimported the source code, my carefully laid plans came out like this:

Which made tracing the story impossible. Luckily, it didn’t prove to be too much of a problem, as it was at the very end, but if it had been mid-way through a large project it could have been a real nightmare.

I also found that some of the under the hood programming I had done seemed to be messing up repeated read-throughs of the story. Stripping out the “Rewind to here” options was accomplished by changing the “visibility” tag of the “.passage .toolbar” CSS. This was done with a simple find-and-replace in TextEdit. I also changed the default “restart story” button in the HTML to a Javascript button that actually refreshed the page, using this:

<input type="button" value="Reload Page" onClick="window.location.reload()">

By actually refreshing the page, all the data and variables are cleared and the story restarts properly from scratch.

(I mention this stuff, just in case anyone else is having similar difficulties. The answers are probably on the Google Groups for Twee, but I always find discussion groups fairly impenetrable).


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s