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.
Dennis,

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 <http://jerz.setonhill.edu/if/gallery.metamorp/index.html>. 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.

Regards,
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 rec.arts.int-fiction 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 Homestarrunner.com 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 rec.arts.int-fiction, where the IF gurus are.

3 Comments

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.

Even if you implemented the ability to enter a line on the dos command line, that would be very useful.

Craig Daters said:

Though this might not be what Mr. Williamson was looking for, it might be interesting to look into it.

http://www.guncho.com/

What is it?

Guncho is an online system for multiplayer interactive fiction based on Inform7.

Leave a comment


Type the characters you see in the picture above.

Recent Related Entries

Old-School Text Adventures Come to the iPhone
An iPhone is too expensive for my budget, but I'm still happy to see this, from Wired:Open iPhone. Go to App Store. Download Frotz. The classic text adventures from Infocom made us all learn the shortest possible way to write...

Lord of the Memes
David Brooks, NYT: Today, Kindle can change the world, but nobody expects much from a mere novel. The brain overshadows the mind. Design overshadows art. This transition has produced some new status rules. In the first place, prestige has shifted...

You are likely to be eaten by a grue
Mark Bruno offers his version of the "Remember text adventure games? People are not only still playing them, they're writing new ones!" essay. I thought his discussion of the relationship between IF and electronic literature showed some insight.I also discovered...

When Google Owns You
Chris Brogan just posted a horror story that made me make backups of everything I've ever uploaded to Google Docs. Note to self: use Google Apps as a redundant backup only.Monday afternoon, after lunch, Nick came back from lunch to...

Hamlet (Facebook News Feed Edition)
McSweeney's:Horatio thinks he saw a ghost.Hamlet thinks it's annoying when your uncle marries your mother right after your dad dies. The king thinks Hamlet's annoying. Laertes thinks Ophelia can do better. Hamlet's father is now a zombie.Thanks for the suggestion,...