One book, many readings

As a child of the 80s, the Choose Your Own Adventure books were a fixture of my rainy afternoons. My elementary school library kept a low, fairly unmaintained-looking shelf of them hidden in one of its back corners. Whether this non-marquee placement was an attempt by the librarians to deemphasize the books in favor of ‘serious’ (children’s) literature or was simply my good luck I still haven’t worked out. But it meant there was a place that I could retreat to and dive into unfamiliar worlds without distraction.

A lot of what I read in those days served a similar purpose. A narrative was all well and good, but more interesting to me were the books that laid out a set of places and situations that could outlive their attendant plots — stories that provided scaffolding for my own imagining.

In practice this meant a lot of genre fiction, books where the author spends as much time explaining the rules of the form’s world (be it film noir, sci-fi, etc.) as documenting the characters’ progress through it. Neuromancer’s writing was not what made it memorable. It was the fact that after reading it you understood the logic of Gibson’s world. And that logic was portable to any new scenario you could dream up.

Imagination is a wonderful thing, but it’s a decidedly one-sided affair. Especially when your source material is plot arcs from books, it’s difficult to be surprised at any of the twists and turns when you’re both actor and author of your own story. And this was the seductive quality of the cyoa books: though your actions were limited to the often vexing choices offered to you, there was actual uncertainty as to how things would play out, and direct feedback based on your decisions. Even down to their use of the second person, the books were clearly speaking to you, not just an outside-the-fourth-wall audience experiencing the book passively.

It is less surprising that this kind of interactive, hypertextual book happened at all than that it happened so late in the life of the book as a medium. One of the fundamental properties of books as objects is their ability to be dealt with in a random access fashion. All those loose paper edges let you jump to a page more or less directly, without having to go through all the intervening material as you would with an ancient scroll (or ancient audiotape).

Historically, reference books have made use of this aspect most directly. Dictionaries cut indentations into the pages to help you find the neighborhood of your entry then let you flip along glancing at guide words to finish your search. Likewise encyclopedias use their alphabetical organization (itself a fairly recent innovation) to allow for a kind of hyperlinking as one entry typically references several others.

Outside of the realm of task-oriented books, this sort of hopscotch across the contents is a rarity. And the cyoa books are actually not exceptions in this respect, for they too are books that perform a task. But rather than being a definition retrieval system or associative datastore, their interactive function is to create a gameworld for the reader. This is part of the wonder of these books – they took a pre-existing set of interface conventions designed for utilitarian search tasks and mapped a new activity onto it. They were effectively a new kind of software application for the oldest information-display platform we have.

I suspect this similarity to software-style interaction also points to why this kind of book came about when it did. Interactive gamebooks started to appear in the late 70s, around the same time that Interactive Fiction popped into existence with Colossal Cave Adventure (which begat Zork and, in turn, Infocom). Whether in paper or electronic form, these games all hinge upon movement through a set of static locations: pages in the book, or ‘rooms’ in the text adventure. And from any one of these locations you can move to a new one based on a set of fixed rules. The book might offer you the choice of going to page 13 vs 22 while the game lets you choose rooms to the north, west, or south. This sort of locations-and-transitions structure is known in computer science jargon as a finite state machine, a branch of theory an old classmate summed up as ‘bunches of circles and arrows’.

His quip was accurate in that the analysis of these sorts of systems takes the form of drawing out diagrams of transitions between ‘states’. This is useful primarily because humans are so bad at recognizing patterns in tables of subtly coordinated data and so good at it when the information is represented spatially. So if the cyoa books are just another FSM, it should be possible to use some of the same techniques to examine their structure.

many choices

At its atomic level, a cyoa book is a collection of numbered pages of a few different types. Most pages tell a portion of the story, then finish by telling you to jump to another page. A smaller number of pages tell a conclusion to the story and represent an endpoint with no further jumps. We can subdivide these ‘narrative’ and ‘endings’ groups further based on the number of choices offered or the goodness of the ending. To visualize this, imagine color-coding every page in the book and then laying the pages out next to each other:

In this example book, page one is a ‘branching’ decision, meaning there are at least two choices offered to the reader. The second page is a ‘story’ page, meaning that it was either a text page that had a single forced choice (e.g., ‘To continue, turn to page 30’), or an illustration page outside of the stream of the story. The brightly colored pages are endings of various degrees of direness. Great endings come in the middle and at the end of this selection of pages. The first ending in the book is an unfortunate one — a common trope in these stories.

To get a sense for the distribution of pages within the actual cyoa books, I’ve prepared a dataset of 12 books. The earliest dates from 1979 and at the later edge are a handful from 1986. They are laid out chronologically (or according to series order for books released in the same year) with the oldest at the top left and more recent books below. Each book has been arranged into rows of ten pages apiece.

In scanning over the distribution of colors in this plot, one clear pattern is a gradual decline in the number of endings. The earliest books (in the top row) are awash in reds and oranges, with a healthy number of ‘winning’ endings mixed in. Later cyoa books tended to favor a single ‘best’ ending (see CYOA 44 & 53). The most extreme case of this was actually not a Choose Your Own Adventure book at all but a gamebook offshoot of the Zork text adventure series. The Cavern of Doom (labeled WDIDN 3 above) has a virtually linear progression where endings later in the book are increasingly better than those on earlier pages. This is reflected in the nearly unbroken spectrum from red to blue when scanning down the rows.

The one outlier is the catastrophic ending seen in the third row from the bottom. This was a punishment page that could only be reached by cheating. Unlike most other endings in the book it does not offer to let you continue the story from a few pages back but instead calls you a cheater and leaves you with no choice but to start over from the beginning.

Another surprising change over time is the decline in the number of choices in the books. The mess of light grey boxes in the top row gives way to books like A New Hope (CYOASW 1) which have more pages devoted to linear narrative than to decisions and endings combined. But to address this apparent pattern with more rigor it would be best to look at the numbers of pages in each category independent of their placement in the book.

This can be done visually by rearranging the color-coded pages of the book:

Starting with all the book’s pages lined up in a single row, it’s possible to rearrange them, grouping similar pages together. Continuing with the color coding from before, this turns the reordered row of pages into a stacked bar graph with the number of decision pages in white on the left edge, endings in the middle, and expository ‘story’ pages on the right.

By representing the distribution of pages in each of the books with one of these lines, the change over time becomes even more apparent.

I’d be very curious to know the reason for this progression toward linearity. Presumably the invisible hand was guiding this development, but whether the hunger was for less difficulty in the books or simply for something with more in the way of traditional storytelling is harder to unravel. I could also imagine that this balance between interaction and exposition was peculiar to the individual writers, so this could merely reflect a changing set of practitioners.

In another way, this trend mirrors the adoption of more recent new media. In the early days of the web, people flocked to what was unique to HTML, namely links, animated gifs, and the <blink> tag. A similar cautionless exuberance marked the appearance of affordable typesetting systems – the first time people without phototypositors had access to typefaces beyond a choice of monospaced typewriter fonts.

When a world of new possibilities has just opened, it’s hard to find the will for restraint. But, in time, people scale back the more gratuitous uses of this sort of glitz, moving from what’s possible to what best suits the material.

It could be that the glut of choices in the early books reflected more a rush toward the new than a well-considered balancing of storytelling and reader-directedness. As the genre developed, the choice-based structure ceased being so novel that it was an experiential end in itself. Perhaps only then could it recede into its proper role as a gameplay mechanic – all the more potent when used judiciously.

many paths

Just as looking at a film only in terms of its individual frames would be missing the point, considering the pages of a CYOA book in isolation ignores what makes the structure of these books special. As in all hypertext systems, pages make up the body of the organism, but it is the nervous system of connections between them that allows for emergent properties to develop.

In this example book there are 8 pages that are part of the story. The choices column has an entry for every possible transition in the book. Pages that offer a decision have one A→B pair for each destination. Ending pages show their ‘grade’ using the same color-coding scheme as before. To the right is a grid representation of the pages.

Like most opening pages, the first page here doesn’t offer a choice, but presumably gives some introduction and shuttles the reader on to page 4. At this point there is a decision, and one of a particularly schrodinger’s-cat sort . Both of the possible destination pages, 8 & 15, subsequently divide again into two destinations apiece; all of them ‘endings’. Of the four possible outcomes in this story, the choice on page 4 divides the universe of possibilities in half, and the following choice narrows to the final conclusion.

Part of the fun in playing through these books (or part of the obsession) was trying to find every ending and every path. In attempting to map out the structure of the choices a similar concern arises since we don’t want to miss any of the less-traveled corners of the book. Here again computer science offers an methodology for dealing with this problem. The first step is to look at the list of all the book’s choices in a different way: by drawing a map of its branches. In doing so we transform the book into a tree-like datastructure known as a directed graph and can then use the wealth of established traversal methods to map out all the possible paths through it.

On the left is an adaptation of the list of choices, but here they are arranged spatially, so pages that are close together in the flow of the story are close together in the map. As a result the dividing path structure is more clearly apparent, as is the remoteness of outcomes on either side of the divide created by the initial decision on page 4. In the right column is an abstracted version of that same map (as laid out by a force-directed graph algorithm).

An additional bit of information is encoded in the weights of the edges connecting the page ‘nodes’. Thicker edges represent well-traveled choices in the set of all possible readings while thinner edges depict choices which occur for only a small number of readings. Looking at this sort of weighted graph we can get a sense of which parts of the book make up its central structure and which are endgames specific to only a handful of final pages.

Calculating these frequencies is simply a matter of walking the graph to find every unique path from the first page to an ending.

Once this set of all possible readings through the book has been established, we can go through and compare particular edges. In this example set the forced choice from 1 → 4 is clearly the most common, as it is shared by literally all the paths. The choice at page 4 divides the set of readers in two with half going leftward to page 8 and the rest rightward to 15. As a result both the 4 → 8 and 4 → 15 edges in the Decision Frequency graph are proportionally thinner. The faintest lines come from the tertiary decisions as each of the four readers settles on an ending page which is unique to them.

These paths can also be represented in the context of the book’s page order by drawing arcs between each choice and destination. Here the dividing sets of readers through the book can be seen in the dwindling weight of the lines.

On one level this way of visualizing the choices only serves to confuse matters since it conflates the actual tree structure with an apparently arbitrary set of page numbers. A perfectly balanced tree of decisions could be made unrecognizable in this view by shuffling the pages. But these page numbers are actually anything but arbitrary and in fact offer a peek into the construction process the authors went through as they folded their nonlinear stories into a sequential medium.

many storylines

In the post-microcomputer world, we think little of operating on long lists of information because we have so successfully offloaded the painstaking work upon our machines. It’s easy now to forget how much of a drag it was to deal with these sorts of data-shuffling problems before the mass democratization of computing in the 80s. When the first of these books were conceived, computers were at best a fringe product (sometimes requiring carpentry skills). But this is a fringe that clearly overlapped with at least some of the early authors of these books.

So it’s an open question how the ordering of pages was decided. Did they write programs in Integer BASIC? Assign page numbers pulled out of a hat? Draw a napkin sketch? Short of first-hand information I can only speculate. But this is where superimposing the choices onto the order of pages in the final book can suggest some possibilities.

There is a broad range of organizational structures in the different books, but a handful of strategies seem to recur. The openings of these three books are a some of the more prototypical:

The Cavern of Doom is resolutely single-threaded, with a spine of near-universally travelled choices seen in the thick arcs moving left to right. Notably there is only a single choice (both in this view and in the entire book) that goes back to an earlier page. This can be seen in the lone arc below the pages moving from right to left. It is either ironic or telling that this linear structure comes from the book written by a talented computer programmer. Perhaps knowing how to deal with the complicated makes you appreciate the simple.

Chimney Rock is simultaneously more varied and more regular. At any given position in the book, a choice is likely to take you forward by a more or less fixed number of pages. This is reflected in the grid-like pattern created by the overlapping arcs. In addition, choices frequently go to sequences of pages (e.g., choices A, B, and C going to pages 12, 13, and 14), thus the number of arcs that seem to divide into halves or thirds just as they land.

This kind of ordering suggest a possible algorithm for the page layout:

Place all the pages (loose) in a mess on the floor. Pick up the first page and put it face down on a table or something. Pick up all the pages referred to in the first page, and stack them (face down) on top of the first page. Pick up all the pages that those pages you just added to the stack refer to, and add them to the stack. Repeat step 4 until there are no more pages on the floor.

An interesting implication of this is that the book ends up being sequenced in terms of the number of choices that have been taken so far. This is to say that all the pages reachable after 2 choices are neighboring pages in the book. As are all those reachable after 3, 4, or 5 decisions. For a more dramatic example of this phenomenon, compare the groupings that arise when looking at pages in terms of the number of decisions required to reach them.

House of Danger has a form typical of books from later in the series. There is a dense section of activity on the early pages, but paths quickly begin jumping to quite distant pages. In addition there is an almost even balance between forward and backward jumps. These traits suggest a more-or-less random ordering of pages after the writing was complete. What is odd is that in a number of books with patterns similar to this, there is still a bias in favor of forward jumps. So clearly the process wasn’t purely stochastic, but all the same the method remains lost in the noise.

many conclusions

Though the fun of these books came from working your way through the story choice-by-choice, the challenge which prompted endless rereading was in finding the ‘best’ ending. Perhaps this stems from a desire for narrative closure, wanting the gamebook to behave like a normal one with a ‘real’ ending that can be reached after learning to avoid the suboptimal ones. Just as likely it is the game aspect of the books coming to the fore: games exist to be played and won.

The early CYOA books were set up to discourage this kind of play-via-obsessive-optimization. It was rare for there to be a single ending that was unequivocally better than all the others. In addition, the set of best endings was distributed fairly evenly throughout the branches of the decision tree, so early choices don’t necessarily take you out of the running for a good ending. Stories that built toward a single, ideal ending were more the province of non-CYOA gamebooks, particularly the Time Machine series and the Zork books.

The way The Cavern of Doom handles this progression toward the ‘you win’ ending is particularly ingenious (and in keeping with the gameplay style of the text adventures). Over the course of the book, choices take you slowly forward and the endings get progressively better as you go. The ending on page 119 is unambiguously the goal both through its placement at the very end of the book and, more explicitly, by awarding you 10 out of 10 points in the final sentence.

The story follows the same arc on each rereading but allows the reader to diverge from the main thread for a page or two in search of items that are key to solving puzzles later in the book. These kinds of fetch quests are a staple of computer games, and adventure games in particular. What these special items add to a game is a kind of persistent state in addition to the player or reader’s current location (e.g., you are on the page with a locked door and you either have the key or do not).

The book pulls this off through a series of sieves and funnels in which choices split off to certain pages where you find an item and others where you avoid the spooky hut or dark cave. A typical example of this structure is the division that occurs on page 7 (the faire in the castle court) followed by the reunification on 21 (Syovar telling his story).

In a computer game, tracking this kind of inventory state is a simple matter. By flipping bits in memory, the program itself can keep a running tally of items you’ve encountered and possibly picked up. In a book this responsibility falls to the reader, and with it an expectation of honesty. To encourage a degree of fair play, the Cavern of Doom engages in a form of entrapment by asking the reader, in the midst of a dicy situation, whether they have a magic item that would clearly save the day. What the book knows and the reader may not is that this item does not even exist. Woe upon the adventurer who angers the gamebook in this way.

This kind of trust-but-verify behavior is one way to deal with the ease of ‘cheating’ in these books. But this presumes that the only way for them to be enjoyed is through following the prescribed directions on each page. Inside UFO 54-40 neatly turns this idea on its head by instead rewarding this sort of creative interpretation of the rules.

In the story, your concord flight is interrupted when you are beamed aboard a nearby spacecraft trolling the universe for intelligent life. Once aboard you discover your new captors, the U-TY, are interested in keeping you around only to the extent that you can help them find Ultima, the ‘planet of paradise’. The planet’s location is cloaked in mystery and you are only told that it’s a place that cannot be reached ‘by making a choice or following directions’. However this is all foreshadowing for when the reader finally becomes frustrated in the apparently impossible quest and begins flipping through the book hunting for that ending. In fact not choosing is the only way to reach Ultima.

The branch diagram for UFO 54-40 is unique in that it has one ending – the Ultima ending – which is completely disconnected from the rest of the story. It exists as an island, unreachable through choices but discoverable thanks to the random access nature of the book.

This ending was not just an easter egg for the obsessive reader who didn’t mind skimming every page looking for telltale words. Instead it’s hard to miss in even a casual riffling. A two-page illustration showing what could only be paradise (or perhaps a theme park) leaps out as the only spread in the book without any text. Flipping to the page before brings you to 101, where you discover that your curiosity has been rewarded. You have found the planet, not by following the constraints of the system, but by going outside of them – a fitting moral to the story and an encouraging reminder that any game should be a starting point for the imagination, not the end.