My Interactive Fiction Page

Alexandre Owen Muñiz

Interactive Fiction is a computer game form characterized by the use of text both as input from the player as well as output. Its popularity peaked during the 1980s with works by Infocom like Zork and an adaptation of Hitchhiker's Guide to the Galaxy. Later, as personal computers became capable of displaying better graphics, Interactive Fiction died out as a commercial form, but it was kept alive by hobbyists who continue to produce IF games, the best of which measure up quite well against the old commercial games. I've found writing IF to be very rewarding. It is an excellent way for a single author with a little writing and programming ability to create an immersive experience of taking part in a story and exploring a world of the author's creation.

Some links:

A New Life

2nd place, 11th annual Interactive Fiction Competition
This is either a really great game I just didn't fully understand, or a pretty average game that does a great job of seeming to be a really great game I didn't fully understand.
--Mike Snyder
A New Life was my first full length interactive fiction game. It is a fantasy game that borrows liberally from the tropes of the genre, but gives them (hopefully) fresh twists. The reviewers generally praised the depth of implementation and worldbuilding, but had trouble with finding a strand of the plot and with the PC's (lack of) motivation.

Download the original competition release.


I will be releasing a new version shortly which fixes some of the problems present in the original release.

You need a zcode interpreter to play this game.

You: Tense, Ill

A Gardenburger of Forking Paths

1st Place, PrologueComp (via Internet Archive)

The prologue

PrologueComp was a mini-competition for prologues of unwritten IF games, that is, just the text that comes before the first prompt. I wrote the whole thing in the two hours immediately preceding the competition deadline.

I'd like to write the rest of this game someday, but coming up with a playable game from this scenario could be very tricky.

Make All Sad

Not all of my things are sad. Make all of my things sad!

A game in 140 characters of code (not counting whitespace) written for TWIFcomp. You can download the source here. This version is the post-competition enhanced deluxe version. (I figured out how to save 13 characters and used the space to squeeze in a new feature.)

Directions: To play the game, type "perl" on the command line of a system that has perl and a command line. "QUIT" quits the game, "G" repeats the last command, and everything else... well, that would be telling.

If you're ready to be spoiled, feel free to look at the source code below.

Source Code:
@o = split ' ', 'ma cu to sa re od';
@s = 0..2;

    print "My $o[$_]p is $o[($s[$_] += $x >> $_) % 3 + 3]d.
" for 0..2;
    print ">";
    $_ = <>;
    /^g$/i || ($x = y///c - 1)
until /^quit$/i
If you found that completely unenlightening, here are actual spoilers about how the game works.
The trick behind the game is that (aside from supporting "QUIT" and "G") it only looks at the length of the input string. This means that any command has a repeatable, deterministic effect on the game state, and that different commands (as long as their lengths are different) do different things. The intended effect is to create the illusion that the game is actually understanding and parsing input.

We keep track of the information needed to get the adjective for each noun with an array. The length of the command affects the values in the array as follows. First, we simply add the length to the first value (the one for the map.) Then for the cup, we lop off the least significant binary digit, and then add the result. For the top, we lop off the two least significant digits, then add. The lopping off is done by the shift operator, ">>" in perl. (Note that shifting by one is the same as dividing by 2 and rounding down.)

Let's look at an example. Suppose the input is "BREAK CUP". That's 9 characters. (Unlike the competition itself, I count the space.) 9 in binary is 1001. Lopping off the 1 on the end gives 100, which is binary for 4. Lopping off the 01 at the end gives 10, which is binary for 2. So we add 9 to the value for map, 4 for cup, and 2 for top.

But we only have three adjectives! So we divide our accumulated result by 3, and take the remainder. (This is what the "% 3" does.) Sad is 0, red is 1, and odd is 2: these are the three possible remainders. In our example, 9 % 3 yields 0, which means that the map does not change. But 4 % 3 is 1, and 2 % 3 is 2, so it advances the adjective for cup by 1 and for top by 2.

Now, since there are 3 possible states for each noun, the total number of possible game states is 27. But the number of commands that are actually distinct is somewhat less than that. To see this, consider what happens when we type "MAKE ALL SAD" (or any other 12 character input.) In binary, 12 is 1100. The first shift gives 110, or 6. The second gives 11, or 3. All of these numbers are multiples of 3, so the remainder dividing by 3 is 0, and so nothing happens. This is the same result as if you just hit Enter, which gives a string of length 0. After 12, results start repeating, so 13 does the same as 1, 14 does the same as 2, and so on.

Now you know enough to figure out what the twelve distinct lengths of commands do, and find the shortest "winning" (making all sad) sequence. But in order to play and enjoy the game, it's sufficient to experiment and find commands that keep a certain noun unchanged, and make that noun sad before working on the others.

Sure, that's not all that hard, and you could easily stumble on a winning sequence without understanding anything about what's going on, but what do you want out of a 140 character game?

I've also written a blog post about the making of the game. The original page for the game on the TWIFcomp site is here.
Please email comments and bug reports to me at:
Last modified: Fri Oct 29 18:33:58 PDT 2010