Question about INFORM7 IF playing from Web Pages

I got an e-mail this morning from a multimedia developer who found my online version of Emily Short’s Metamorphoses, asking some technical questions about whether it is possible to give web-based users tasks to perform in an interactive fiction game, and have the game notify the outside world when the task is completed. I’m reproducing it here with permission.

Hi. I write with something of a request. I wonder if you can help?
I’ve been able to find one of Emily Short’s IF stories playing within a web page on your site <>. This is the only time I’ve been able to find IF playing this way – most IF seems to get played as a self-standing application – and so I wondered if you might be able to give me some idea about how the web-based IF is accomplished?
As an old (in both senses of the word) player of IF, and now a self-professed multimedia developer, I am trying to see if I can use INFORM7 to write some “tasks” for users of a web-based ‘community’ site that I’m working with. The idea would be bring up a short IF task as an alternative activity for a user who requests one, on the  
web page, get the user to work through it, and get the story to send a message to the web server on successful completion (or on saving, etc.).
If you have time to reply, and if you can help, I would be most grateful.
Denis Williamson
Hong Kong

I’m posting my response here, in the hopes that anyone with a better answer will share it.

The Inform system produces game files that run on the Z-machine, which is a virtual machine that exists only in software. When you see an IF game running in a web page, it is probably using Matthew Russoto’s ZPlet, which is a Java interpreter for the Z-machine.  I wouldn’t know how it is possible to send a message from within the virtual machine to the outside world, but my programming skills are very modest, so just because I can’t imagine how to do it doesn’t mean it’s impossible.  I don’t know all that much about the Z machine — Andrew Plotkin or Matthew Russoto would be the ones to ask (both of whom read the Usenet group).

It should be a fairly trivial thing to have a small stand-alone ZPlet program that ends with the player finding a magic word, which the user would then just manually key into some other program.  I embedded a few small IF programs in a web page designed to teach my students about exposition in interactive fiction — that might give you some idea of what you can accomplish. I don’t try to communicate to the outside world from within the sample games, but there is some crude interaction (in in the form of questions the web site asks about the in-game experience.)

The Glulx interpreter has some significant multimedia capability, and there is a Java interpreter for Glulx, Zag, by Jon Alfred Zeppeiri. Inform 7 can output gamefiles in the Glulx format.  (It requires the Java Runtime environment to be installed on your local computer, so it’s not as point-and-click simple as ZPlet.)

TADS also has some multimedia capabilities, but it is a completely different system from Inform and I have not recently checked out its capabilities. It has had HTML hyperlinking for some time, so I imagine it should not be too hard to send a message to the outside world.

The website created a flash-based spoof of text adventures called Thy Dungeonman. I don’t know whether the flash code has been released, or whether some other text-adventure fan might have released a homebrew version of the code. But that game was released long before Inform 7, so my guess is the creation of such a flash-based game would be hackish.

I just Googled and found Flashonate, a flash-based z-machine interpreter, by Peter Rogers. He has released the code as GPL.

I hope you will share whatever you learn as you investigate the possibilities.

Update: I posted the question to, where the IF gurus are.

3 thoughts on “Question about INFORM7 IF playing from Web Pages

  1. Though this might not be what Mr. Williamson was looking for, it might be interesting to look into it.
    What is it?
    Guncho is an online system for multiplayer interactive fiction based on Inform7.

  2. Conceptually, what Mr. Williamson has suggested is entirely possible, but no one has implemented an environment that would offer this capability.
    In developing the interpreter for Textfyre, we plan to have the ability to setup a testing version so that the game player’s interactions are sent back to our servers over the Internet. This is for market testing and will allow us to build a repository of commonly missed commands and sentence structures.
    But as a side benefit, we would also be able to do as Mr. Williamson suggests. We would be able to notify some external entity of progress or receieve a notification from somewhere outside the interpreter. I can think of a myriad ways this would be useful, but at this time Textfyre isn’t really focused on communication aspects outside of test marketing.
    But it’s a cool idea. We’d thought of getting into developing content based on domain expertises (educational tools) and this might one of the aspects of that type of system.
    David C.

Leave a Reply

Your email address will not be published. Required fields are marked *