Passing the test

This post originally appeared on my Patreon.

After what seemed like an eternity, I’ve converted the Twine 2 test suite to a pure JS-driven one… and more interestingly, the refactor into Browserify modules passes those tests. That gives me confidence that we can merge this branch into the main development branch, or trunk. We’ve made significant progress toward 2.0.9.

(My girlfriend asked: “Does this mean Twine is better now?” My war-weary reply: “It means it hasn’t gotten any worse.”)

Some quick lessons I’ve learned along the way:

  • Testing is still crucial.
  • Tests are still painstaking to write.
  • Moving from Selenium IDE-based tests to pure JS did not speed up the tests, but that’s mainly because each test now sets up an entirely new browser session.
  • You want your tests to run in separate browser sessions, because otherwise they can trample all over each other.
  • There’s a Selenium adaptor for PhantomJS, a platform specifically designed for automation, that should speed up the tests. But if I try it right now, some tests fail, probably because I’m not inserting enough “wait until this element exists” checks — it’s going too fast.
  • You can learn something by reading API documentation alone, but you’re not going to enjoy it.

My process

This post was originally written for

One maddening thing about reading a recent interview with Shannon Gilligan, one of the original CYOA authors, was how vague she was about her writing process. (To skip to that part, search for “every writer develops” on the page.) Basically, for her it seemed to amount to keeping a map. But… then what? How did she decide what branches to prune? Did she think about trying to keep characters consistent between branches? Lots of questions. Granted, all this happened more than twenty years ago, and memory often fails. But it’s this kind of inquiry that really piques my curiosity. There are tons of manuals on how to write — some of them are even good. There are almost none on how to write nonlinear text. (If you can think of exceptions or recommendations, please please please leave a comment.)

So to try to remedy it a little, I’m going to try documenting my own process, as I work. It’s a little scary because a) it feels awfully narcissistic — but then this is the Internet b) what if I fail? What if I give up? How embarrassing would that be? But Susan Gibb’s recent foray into writing a complete hypertext story every day… for 100 days… has inspired me to suck it up a bit.

So, let me tell you about this story. For now it is called mountain.tws, because that’s the filename and I haven’t thought of a real title yet and won’t for a long time. Here’s the story map; if you click on it, it’ll show you an exact word count. I have the story map zoomed out to where the text is greeked out because I’m kinda modest about it for now. The orange exclamation-point emblems show where I have unfinished business — e.g. links that don’t go anywhere yet. The box hanging out in the upper-right is a custom CSS style I wrote, because I want to stack my choices vertically on top of each other, whereas normally they get shown side-by-side.

Right now it is really linear — you can see the branches keep folding into each other. I am hoping that it will eventually become deceptively linear, because later on, the story paths will explode, and I feel like I need to give the reader a little grounding at first before throwing them into the deep end. Deceptive is actually a good word for this part of the story — on its face I think it will look like straight-up exposition to the reader, but I’m trying to embed lots of clues in the text for later on.

I am thinking of the piece as kind of a riddle (though not a puzzle). I see four endings right now, none really superior to the other, just different. I imagine that the first time through, the reader will hit an ending without really meaning to, and then see the message: You have found one of four endings so far. Restart? And then hopefully this will inspire them to go back and try to influence the story more consciously. That’s the ideal case for now. Maybe more careful readers will figure it out right away.

Things I’m worried about:

  • My first passage is kind of long. I worry the rhythm of the story and click will be off. But I really like all the text, and again I think it helps root the reader. We shall see.
  • Is Alice, one of the main characters, too nondescript at this point? I have to leave her ambiguous right now for an important structural reason (that I don’t want to talk about yet) but I need to give her some character. Female ciphers are lazy writing.
  • Are my choices well-motivated? I have to cheat a little to keep the storyline braided the way it is, so things are not super-permanent in that a choice doesn’t cause a totally different thread of the story to occur. But I have to keep that as hidden from the reader as I can, to maintain the illusion. I’m tweaking things by having dialogue lines change based on choices, though the main line of narrative stays the same, which is cool — but I have to keep the characters in line without making them seem like they’re bumping up against invisible walls.

Things I’m thinking about:

  • I have a thought about how to render one character’s dialogue that will make it stand out from everyone else’s. I’m going to mock this up in a separate HTML page and then move the JavaScript into my story once I’m happy with it.
  • I have a pair of sentences I’m working towards: “You had been told that everyone has strange dreams the night before they walk the Pass, but you have none at all. You have never been a dreamer.” It’s like a tiny milestone to reach.

The calculus of true love

This post was originally written for

I have to admit I got all a-twitter when I started listening to WRT’s interview with Chris Crawford and I got a little shout-out at the beginning. It’s tiny-tiny but still, it’s kind of cool to be on the same, er, stage.

So it turns out Chris Crawford’s up to his old tricks. He’s “commercializing” his old work with the Erasmatron with a new doodad called Storytronics. Now before I write anything else, I should warn you that Chris thinks that Gimcrack’d is obsolete, and as such I am very inclined to go all Linus vs. Andy on him:

There have been three main approaches to creating interactive storytelling technology: the unsuccessful “Branching Narrative” and “Narrative Game”, and Storytronics…

… Many of the choices offered to the reader lead to an uninteresting story; one that was cut too short, ran too long, repeated itself or made no sense. Second, this method imposed severe restrictions on the player’s freedom of choice. There is no practical way to construct a flow chart large enough to give the reader true control – such a flowchart would require literally billions of nodes, linked together in an astoundingly complex logical structure.

Instead, Branching Narratives usually give one the feeling of choosing “the lesser of two evils” between two options, because one is not allowed to do what one really wants to. Furthermore, many such narratives employ a technique called “foldback”, where two or more options lead to the same practical result.

Basically, Chris postulates that a human being can’t begin to try to create a truly interactive story because there are too many possibilities to consider. I think that’s true. He then proposes that the way to solve this problem is to generate your storylines programmatically — you set up some initial conditions that predispose the characters of the story toward conflict (hopefully), and then let ‘er rip. The reader gets to be a character who can screw around with things and lead the story toward a particular outcome.

I have two criticisms: first, I think he’s got the cart before the horse. Basically, these initial conditions boil down to working with theme. You make a story generator that deals with betrayal by making the characters more or less willing to screw each other over, depending on how much they trust the other person. You make a story generator about love by… well, I don’t know. How would you calculate your attraction to someone else?

But my main point is that theme is something that floats in the background as I write, but it’s never what drives my creative process. I have a vague idea about what a story I’m working on is about, but that changes as I write. I think in my best writing, I may be able to see the end of the story as I work but only just; I’m not sure where I’m going on a conscious level, but there is something working itself out deep down.

Secondly, I think Chris puts a little too much stock in interactivity. — Which may be a weird thing for someone allegedly writing interactive stories to write. But I don’t think people really want a storyworld where anything is possible. For one, we already have real life. But it’s not the range of choices that really makes an interactive story compelling; it’s their significance. And I think that’s where human intelligence and gasp craft comes into play. Deciding what choices to offer the reader, what outcomes to write, is an artistic decision.

Anyway, here are some interesting notes from Laura Mixon, who wrote the only story I know of with Chris’ system: An E-Pilgrim’s ProgressShattertown Sky: A Post-Partum, and I Can’t Believe I Did That.