For the recent IF Demo Fair I submitted a piece, called “The Table,” which used procedurally generated text to produce some stream-of-consciousness text. It was based on an earlier exercise I’d done based on Experiment 1 by Aaron Reed. I think “The Table” probably was less successful than the exercise, but it might be interesting to think about why. More discussion below the fold, but before that you can:
And if you want to see some interesting things other folks did around the same time, you can scroll to the very bottom of the post (or go here for Jason Dyer’s “Renga in Four Parts” or here for Scott Rettberg’s “After Parthenope.”
These originated from Aaron Reed’s Experiment One, designed to procedurally generate associations between objects and ideas in interactive fiction. As Ron Newcomb observes in comments here, Aaron’s textual output is pretty shaky (and probably not designed for anything more), often along the lines of:
Ah, yourself. You remind you of nothing in particular.
or in happier cases
Ah, the stars. They remind you of astronomy, then what’s really important, then the wild, then being lost.
I thought it might be interesting to associate each idea with some prose that was a little more flavorful than “they remind you of” try to string together bits of prose for the different ideas and see if it read a bit more smoothly. And my new version yields responses like this:
The stars here are as rich and full as on the mountain peaks. The stars burn down from the sky, their secrets locked away. Have you been devoting your life to the right things? You’re far from civilization. You wonder whether anyone will ever find you.
Which is nicer, I think, although the joins show a bit even in one turn (the second sentence would begin with “they” if the paragraph had been constructed by a human being). And if you play for more than one turn, you can really tell that the same few phrases keep getting recycled. Also, I wanted to write my own story.
Hence “The Table.” The first thing I wanted to do was to keep cycling through bits of prose so the same bit didn’t appear over and over again. Then I decided not to try to turn the procedurally generated combination of prose bits into smoothly flowing prose, but to use a deliberately fragmented style — cod late Beckett — where the jumps and repetitions would fit in. That was probably a mistake. Anyway, my description of it for the Demo Fair:
“The Table” is an experiment in interactive stream-of-consciousness writing, using procedural recombination of fragments of text.
I wanted to build a framework in which the player and the program can interact with a character in unpredictable ways; the character would react not only to the things that the player types, but to things suggested by what the player types, and things suggested by those things, and so forth. The number of different things that might be output is nearly limitless.
“The Table” is organized around eight themes: the table that the protagonist is writing at, the notebook he (or she) writes in, his house, age (or time), light, the world outside the house, his memory (and family), and writing itself. Each of these themes has a series of associated fragments, which combine to form the story’s output on any given turn. Each fragment suggests certain other themes. The player inputs an individual word from the outputted text — the command might be understood as “think about this” — which is translated into an associated theme, and the game then tries to reach that theme by free association from the last theme thought about: It prints a fragment associated with the original theme, moves to a theme suggested by that fragment, prints a fragment associated with that theme, and so on until it has reached the target theme. The strung-together fragments, with luck, form a map of the protagonist’s stream of consciousness.
Procedurally generated text can be artificial and show the seams where the different fragments are joined. In “The Table” I decided to confront this problem directly, using extremely stylized and intentionally fragmentary prose (inspired by late Beckett). Each individual fragment in “The Table” is unvarying; to produce more sophisticated and naturalistic prose, one would have to write more restrictive rules about which fragments can combine with which fragments, and probably customize the fragments a little (at least at their beginnings and ends) to make sure they flow together more smoothly. Perhaps a system like this could be used for dialogue with a slightly mad or rambling NPC.
We could also explore associations other than those from fragment to theme; a fragment could suggest specific other fragments, or sets of fragments associated with themes, or a theme could always suggest other themes. Another area for exploration would be modifying the associations as the story progressed, so that a certain fragment only suggests a certain theme if another fragment has been revealed. Or we could modify the path-finding algorithm, so that certain associations were strengthened or weakened. (“The Table” uses fairly crude pathfinding; in a given turn it first wanders randomly through the associations, then goes straight to the target theme if it can do so in one step, and past a certain point jumps forcibly to the target theme.)
Aaron Reed’s “Experiment One” suggested the free-association framework, and Andrew Plotkin’s “The Space Under the Window” suggested this particular keyword system.
If I do more with similar systems (and I think I’d like to), I think I’d go for a more natural prose style, perhaps still one that allows for a lot of repetition; and I think it might be a good idea to have the association go from prose fragment to prose fragment rather than from theme to theme (perhaps still using the themes to determine which prose fragment winds up at the end of the association).
Recently I found two other pieces that do some similar things to “The Table.” Jason Dyer’s Renga in Four Parts, another IF Demo Fair entry, seems like it has a very similar input system; you enter single words in or suggested by the text, and it responds with an associative output whose relation to your input is less than predictable. I’m not sure how Jason generates the individual responses; I think each of them was written as a whole, except that some of them will reuse some of your input, but I’m not sure. In any case, both “Renga in Four Parts” and “The Table” are “high freedom of input, user does not control a character in the story” pieces. (Though in “The Table” you might see yourself as directing the character’s thoughts.)
Scott Rettberg’s “After Parthenope” isn’t interactive at all. (This is a link to a video description; the work can be found here, requiring Java I think, and the Processing source code here.) After an introduction (the first part somewhat random, the second not), it produces a sequence of fragmentary thoughts, often seeming as though they might come from a phrase book — which would be thematically appropriate. There are an amazing number of different possible sentences that it can generate, and it looks to me as though its algorithms might be useful for making flowing prose out of a program with a structure like “The Table.” There’d still be something alien about it, but that’s part of the point.