In the Labyrinth of Eros: A Text Adventure Poem
This morning as I transitioned from somnolence to hypnagogia to wakefulness, it suddenly occurred to me to make my “14-unit love psyberpoem” a semi-recombinatory text-adventure game.
And here it is! Download the python script (v. 1.0)(rename it to .py…thanks for nothing, WordPress), or clone it from the git repo. If you have python installed (OS X and Unix users already do), just jump into a shell and type
…in the directory you downloaded the script and enjoy! Otherwise… install python 😉 I will try to find a way to implement the script interactively in a web browser.
I discovered much to my delight that a rudimentary text-adventure parser could be accomplished in one class and only a few dozen lines of code! This script should be an excellent learning example of an object-oriented approach and is very easily extensible. Feel free to modify away, but try to credit my writing!
A room-based text adventure like this one has some interesting mathematical properties, since the network of rooms is essentially an acyclic directed graph. The poem/game is in sonnet form: three quatrains and a couplet. Each quatrain contains two pairs of rhymes, and the couplet rhymes. This form is clear in the network diagram.
Traditionally, entering a room in a text-adventure game would display a prose description of the room. Here, each room is a line of the poem. Ideally each line in the poem would only be read once, but there’s no simple way to achieve this with the spatial, room-oriented metaphor of the adventure game. It would have to involve some kind of key object game mechanic, such as requiring the two keys before being able to proceed past a locked door, but then you’d still be repeating lines if you have to backtrack. A better, but less interactive (and probably less interesting) approach would be to have doors magically lock and unlock so as to constrain exactly the procession of the lines of the poem. But I’m not very concerned about that, I very much like the idea of literally exploring the poem and playing and replaying the game until one finds “just the right” order they like.
I consider the game experience as a whole the actual poem. For reference, however, here are the lines in an arbitrary (but still constrained to the game graph) order:
rooms.line = "When we had opened all the doors" rooms.line = "When we had broken every window" rooms.line = "The vesper-bells had rattled like the floors" rooms.line = "And the dust had settled on the lintel" rooms.line = "When we first met the image of the other" rooms.line = "And the mirrors danced so brightly" rooms.line = "The crows had fled the gables nightly" rooms.line = "And the love between the seedling was the mother of the moon" rooms.line = "The house had crumbled from the rust" rooms.line = "And the silence grew in anger" rooms.line = "As the host redoubled with a clangor" rooms.line = "And our trust had all the force of a typhoon" rooms.line = "And in the Labyrinth of Eros, a time became a turning" rooms.line = "For the blankness in the sky was a fire, and a yearning"
A principal concern while writing the poem, of course, was that it would be a good and interesting poem in any of the possible constrained patterns. I’ll leave that to you to decide.
There’s also a little easter egg—see here for more details 😉