Fiction is a Three-Edged Sword

Fiction, interactive fiction and narrative

You are in a maze of twisty jump statements, all alike


I’ve been digging into the parser, again.

I’m starting to think that, one of these days, I’m just going to rewrite it. Refactor it, rather; not changing any functionality, but just trying to make a version which is then easier to repurpose, adapt and understand.

I’m interested right now in how the parser can be extracted and made available to the game as less of a “main loop” and more of an information-gathering system, that reads in a line and returns what it has to say about it. The error message / disambiguation question system would then sit on top of that, rather than right in the heart of it.

I’m not sure what direct benefit this would be to authors, but it might open the way for more development work on the parser, which has been mostly untouched over the last ten/fifteen years. The issue of extracting decent information for giving errors comes up quite often and I’m sure that could be improved.

This isn’t a promise to do it, yet. But it sounds like a worthy challenge.

Assuming the I7 team aren’t about to rewrite the whole thing into I7 themselves?



Author: joningold

Jon Ingold is a writer and games designer from Cambridge, UK. He is co-founder of inkle, a company specialising in interactive narrative for mobile devices. He has written prose, plays, short films as well as interactive fiction, both in hypertext and parser-based systems. His short stories have appeared in Interzone magazine and his IF works have won competitions and awards.

5 thoughts on “You are in a maze of twisty jump statements, all alike

  1. There are a certainly a lot of comments in there that imply Graham would love to do this, too. The way library messages are dealt with, at least, seems to be getting positioned for a change. Whether modifying the rest of the parser is on the docket, I don’t know.

  2. > I’ve been digging into the parser, again.

    The few times I’ve done this, all I got was dirty. 🙂

    I highly doubt the I7 dev team aim to rewrite the parser. (Or so I speculate.) Indeed, I think Dr. Nelson receives some pleasure or benefit from having the same DNA sequences in today’s parser as the one way back when. It allows writing statements that references years way into the past, which I gather translate into some sort of credibility in academic circles. (“Way into the past” at least in computing’s terms).

    I could be all wet here of course, but that’s what it feels like to me.

    • I do remember being a bit surprised when I7 came out that there hadn’t been any development on that side of things. The Inform compiler is now better at providing feedback than its in-game cousin! But I guess it must feel a bit like a “solved problem”. After all, it does parse things pretty well. The only part missing is good, clear feedback to players … but that’s definitely not a solved problem.

  3. I just had a conversation on ifMUD about how with new user interfaces (non scrolling, static) you could start looking at the game engine as a querying tool. Sure, you still send in commands from the player, but what you get back need not be a “turn” of data. What if, instead, you had hooks into the system for events like “location has changed”, “inventory has changed”, or as you suggest, “parser needs help” which might send a data structure to some middleware that can handle the disambiguation better than the engine itself. The engine may also respond to queries like, “where is the npc named Joe” or “where are all of the gold pieces”. The responses to these queries are game specific and probably user interface specific, but lead to very interesting ideas about IF in the 21st century.

    • Absolutely. I’ve got an interesting demo along the lines of this sort of thing but I’m keeping it under wraps, for the moment, until it’s serviceable and ready…

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s