Skip to content

In the Labyrinth of Eros: A Text Adventure Poem

2010 February 17
by Tedb0t

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

python eros.py

…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[0].line  = "When we had opened all the doors"
rooms[1].line  = "When we had broken every window"
rooms[2].line  = "The vesper-bells had rattled like the floors"
rooms[3].line  = "And the dust had settled on the lintel"
rooms[4].line  = "When we first met the image of the other"
rooms[5].line  = "And the mirrors danced so brightly"
rooms[6].line  = "The crows had fled the gables nightly"
rooms[7].line  = "And the love between the seedling was the mother of the moon"
rooms[8].line  = "The house had crumbled from the rust"
rooms[9].line  = "And the silence grew in anger"
rooms[10].line = "As the host redoubled with a clangor"
rooms[11].line = "And our trust had all the force of a typhoon"
rooms[12].line = "And in the Labyrinth of Eros, a time became a turning"
rooms[13].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 😉

Related Posts:

  • No Related Posts


Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS