The Party Postmortem - Twine and Interactive Fiction

I recently built a game – The Party – using Twine, and styled it using CSS3.   The source can be found here.

The Party Start - Google Chrome_2013-04-30_11-14-38

I’ve always had an interest in interactive stories.  I loved Choose Your Own Adventure books, Lone Wolf, even MUDs and RPGs with deep conversation trees (BioWare games).

These kind of interactive experiences have always been available to make, but until Twine, were always sort of cumbersome to build and publish.

Twine lets you drag and drop passages into a connected tree.  You can then publish directly to a single HTML file.  Some built-in Javascript and CSS will render the whole thing in a nice streamlined template.  A rough scripting language lets you put in variables, conditionals, and other stuff.  Here’s the official documentation, and this blog by Anna Anthropy  is pretty useful as well.  For more advanced stuff (scripting, customizations ), glorious trainwrecks is pretty great.

My comments on building The Party can be broken down into Technical and Narrative categories:


Twine itself is still in beta, so the program itself could still use some polish.  It would crash sometimes when files/stories grew too large.

The passages in The Party
You can include CSS and javascript in their own passages (using the tag “stylesheet” or “script”).  However, it would be nice if scripts or styles could be directly accessed within passages themselves.  I was able to modify the way styles are applied, to have [custom CSS for certain passages]( (so different characters would speak in different colors), but this involved a chunk of javascript and some advanced CSS.  Would be nice if this was available out of the box.
[![The Party Dance - Google Chrome_2013-04-30_11-12-14](](
CSS3 lets you do some fun animations
Twine also supports macros.  For instance, if you want to save a variable, you can use the macro <>.  You can make custom macros as well.  Thing is, these are basically just getting translated into javascript, so the question is – why not just use javascript itself for scripting?  Ideally (perhaps an advanced mode of Twine), you could just enable scripting with an escape character ” The other problem with macros is that they render as whitespace in the final passage.  You can “escape” this by wrapping it in <><> macros, but this is cumbersome, and doesn’t work if you are trying to do advanced conditional logic (nested ifs, etc).  A better solution would be for macros to not display as whitespace at all.  In The Party, there would be random newlines in the passages that contained some of the more advanced logic.

Conditional logic in Twine
Given the limitations of macros, more advanced logic gets ugly.  It would be pretty tough to build an RPG-style combat system (though people have [tried](!topic/tweecode/W10x_8vBe7s)).  Until the integration with regular javascript is more seamless, I see this holding back Twine.

Large stories get pretty difficult to “debug”.  It would be nice to have some sort of debug mode, where you could change variables on the fly, to allow easier traversal of complex passage trees and state machines.  A WYSIWYG editor of passages would be nice (to see how styles are applied).  Simple stuff like spellcheck would be key as well.

But overall, Twine is a pretty good tool for building straightforward Choose Your Own Adventure games on the net.

Connected passages in The Party
# **Narrative:**

Once you get over the technical details, the real work comes in building an interactive story.

Lots of Twine stories are essentially linear.  The reader can click on “points of interest”, but it’s very similar to a novel or short story.  These are trivial to create in Twine.

But writing multiple paths is hard, especially when it comes to dialog with characters.  Let’s say you want to write a dialog tree with a character – Jack.  The player can either choose to cooperate and be friendly with Jack, or be snarky, mean or dismissive.  The dialog tree might start off at a neutral state, but as you get further along, Jack needs to respond to the player’s comments with friendly banter, or annoyance.  As a writer, this can feel schizophrenic.

It’s much harder to write breadth first, enumerating all the paths at once.  I found this out the hard way when writing Chan in The Party, having him respond directly to each band the player brought up.

[![The Party Chan4b - Google Chrome_2013-04-30_11-12-47](](
Chan dialog tree
It’s easier to write depth first, in fact, write a single “quest line” for each character, in effect making the story linear.  Then branch out on tangents and false leads.

The other creative decision is how open you want your narrative to be. There are two ways you can do this:

One is like a video game, where the player can move around various locations and talk to people multiple times (RPG video games).

The other is linear, even if there are multiple paths (Choose your Own Adventure).  The latter is easier to implement, and can potentially lead to more literary narratives, but the player is robbed of choice.  There’s very little puzzle-solving since the narrative path is a straight line (whether the ending is good or bad).

The former is sort of what I ended up doing in The Party, but this is tough, since you end up with these complicated state machines for NPCs.  Say you start talking to an NPC and then leave the conversation before an important point was reached.  When you talk to them again, do you replay the entire conversation?  Have some sort of “save point” in the conversation?  Or possibly just have NPCs with canned responses that they say every time (“Arrow to the Knee”).

[![The Party Samantha9 - Google Chrome_2013-04-30_11-11-41](](
Samantha dialog tree
Most of the acclaimed RPGs (BioWare) have deep conversational trees with villains or whatever, but you can only access them during linear gameplay events (prior to a big battle, or the end of a chapter, etc).  Until we reach true natural language processing, I think really rich NPC interactions are just going to require super complex state machine logic, which is very time consuming (and is pretty painful to implement in Twine).

The other question is one of motivation.  This brings up the concept of a quest.

When you read a novel, there’s an interest in reading the pages for the content itself, but also the feeling of progression as you turn the pages.  You know how far you’ve come, and how far you have to go.

With interactive narratives, especially more open-ended ones, the “story” could possibly be infinite, and you could simply retread the same ground again and again.  How to communicate to the player the progress they are making, and lead them in the right direction?

A quest is one way.  The quest doesn’t have be something as direct that would show up in RPGs (“slay 5 skeletons”).  It could simply be: hey, talk to this person, or do you know this?  Giving the players a quest (and including signposting techniques, like having a character stop talking until you advance) can give the player a feeling of advancement.  You could also include meta-textual indicators (progress bars, percent complete, score), which could be useful.

The Party:

When I first envisioned The Party, I thought about what it would be like if you could “do anything” in a game.  You could talk to people, get drinks, dance, have moments of introspection or angst, even jump off the balcony.

Twine was good enough to save the number of drinks, or the dialog tree of a character.  But how to code the nuance of conversation, depending on if the player was a drunk female, or a sober male?  What about hooking up with characters?  Should I give the NPCs sexual orientations, hardcoded with a binary value?  Should you only be able to dance naked if you’d had 8 drinks, or 6?


This is where the vast differences between the literary and video game worlds started to present themselves.  In novels, the universe is open.  Anything that can be transcribed into language can “occur” in the book.  The path of the story is as free as the writer’s imagination.

But once you start building systems that are codified with variables (quests, items, rooms, etc) you are bound by the logic of those variables.  If I code orientation as binary, it’s impossible in the game world to play as asexual, or bisexual.  If I code a quest to only complete once you are at a certain level of drunkenness, any sober player is cut off from the end.


The irony: just as you are creating the illusion of choice, you are actually narrowing the world of possibility in the story.

Literary writing has been around for thousands of years.  The tropes and techniques of stories have been given time to evolve over hundreds of generations.

Interactive writing is still very new, and these are the kinds of things that need to be worked out.  I’m interested to see what we do with it, and where it can go.

Show Comments