How can I make a stand-alone/browser-based piece of Interactive Fiction?
December 14, 2008 4:29 PM   Subscribe

Interactive Fiction question. I want to write a short (~2 hour) piece of interactive fiction, but I want it to be a stand-alone file or able to be integrated/hosted on a website when done. (Simply put, I don't want people to have to download anything more than a single file to play it, or, ideally, to do anything other than play it directly in a website.) What's the easiest way to do this? (I'm using Inform 7, but would be happy to use something else if needed.)
posted by Damn That Television to Computers & Internet (13 answers total) 10 users marked this as a favorite
 
Back in the old days of Inform, I got a game running in a Java window. There's a site out there that has all the Infocom classics in some sort of Flash, and I think there's some easy way to port it to that format.
posted by Kirklander at 4:37 PM on December 14, 2008


Best answer: Yeah, there are definitely Java applet Z-code players out there. The Z-Machine Preservation Project includes an applet that runs Inform 7 files.

When it comes out, please post this in Projects.
posted by Deathalicious at 4:39 PM on December 14, 2008 [1 favorite]


Why not just use single HTML file with a bunch of anchors? You could then very easily use the same file up on a website or distribute it via another media. It might be very hard to keep track of the links, but you have to solve that problem somehow anyway...
posted by yellowbkpk at 5:00 PM on December 14, 2008 [1 favorite]


Best answer: This page seems to have a good guide on what interpreters are out there. You might want to check out what the Interactive Fiction Competition did -- they seem to have separated games and interpreters separately, which might be an issue.

The best interactive fiction experience I've had was online, which was via Flash and thus lightweight and not too cumbersome -- a game called Violet. The site, JayIsGames, seems to have coded an in-house interpreter. It doesn't seem as if they're keeping the interpreter unreleased for any specific reason -- maybe if you ask nicely they'll release it?
posted by suedehead at 5:06 PM on December 14, 2008


Best answer: Parchment is a web-based Z-machine interpreter that is open source and uses only Javascript (no Java plugin or Flash required). You can play a bunch of games using it here.
posted by enn at 5:06 PM on December 14, 2008 [2 favorites]


yellowbkpk, because interactive fiction often goes beyond 'choose-your-own-adventure' and deals with having items or not having items, using items, etc, etc, etc. I don't think HTML+anchors would work with anything beyond a story tree.

Or -- I guess you could have a system in which files are nested in folders, and a single folder stands for a single inventory status or a personal status. That is, if you have x number of items possibly obtainable, then you'd have 2^n folders, each folder representing a given inventory status in binary ('have coin, don't have hammer, have knife, so on' -- folder '101'). Within each folder, then, would be another a series of HTML files that would deal with character status, if such things are applicable ('thirsty', 'just read book', 'found magic key') titled in a similar binary encoding. ("101101.html" and so on.) And then the contents of each HTML file would have a series of anchors indicating location -- which room, which place, etc. These three methods would then together be able to represent any character's situation with any inventory in any location. If you're at "101/010.html#southroom", picking up an item would increment the folder encoding but not change the file name or anchor such that you'd go to "111/010.html#southroom". And so on. I suppose it'd be possible to 'export' interactive fiction in this way so that the resulting folder is cross-platform and distributable via the web....

Or, you could just write the thing in a system designed to do such things in a far more sophisticated and convenient matter. Not to mention that part of the fun of IF is not knowing what commands you can input ("what the fuck am I supposed to say in order to avoid the bulldozer?").
posted by suedehead at 5:15 PM on December 14, 2008


This is a job for Hypercard.
posted by OmieWise at 5:20 PM on December 14, 2008


Suedehead: Interestingly I remember a very early Web port of Colossal Cave that worked something like this. But for Inform 7, you gotta have specific support for that Zork-File interpreter. Damn, I really need to write another IF.
posted by Kirklander at 5:40 PM on December 14, 2008


This is a job for Hypercard.

Yeah, I loved HyperCard, but. No.
posted by Deathalicious at 9:35 PM on December 14, 2008 [1 favorite]


Damn, I really need to write another IF.

Yup, I think MetaFilter needs to have an IF challenge one of these months...maybe February? Because it's shorter and it sucks even if you have a sig oth on the 14th.

I didn't know about Parchment; that is a much better solution and is also very awesomely designed. I really, really want to take a look at the code running that and see how it works since it seems so, so cool.

Parchment is very dependent on having the latest JavaScript browser, so for added compatibility I'd seriously consider using the applet as a backup (basically if they javascript fails somehow, offer a link to the applet page). Barring that, it's really not that much of a burden for people who have decided not to have a well-running browser to download the story file and find an interpreter that works, and some people may even prefer using their own interpreter, so you should offer that as an option.

To elaborate on my HyperCard answer: I think it would work for more passive interactive fiction, such as Myst and Afternoon, where you're not anticipating typing in commands, etc. I personally think HyperCard was awesome, had a lot of potential, and if developed correctly could have made quite a lot of inroad into the web community. But it, along with other interesting but complicated Apple software, was pretty much dropped like a wet sock when Jobs took over. I still miss it.
posted by Deathalicious at 9:54 PM on December 14, 2008


According to this faq, Inform 7 texts can be used by the web-based interpretators mentioned upthread (search for 'Presentation').
posted by Hildago at 10:30 PM on December 14, 2008


If you are even vaugely considering it for the comp (~ 2 hrs sounds like you are), stick with Inform and let the Java players pick it up. I reviewed most of the games this year, but near the end of the pile, anything that wasn't z-code or tads was tossed out. (Especially with the 'crap, this Windows only game may have a virus' problem.) Anyone playing the comp will have a z-code player.
posted by cobaltnine at 6:13 AM on December 15, 2008


Response by poster: No, this actually has nothing to do with the competition, but I might enter it in that anyway.

Thanks for all the help, everyone!
posted by Damn That Television at 8:18 AM on December 15, 2008


« Older Gift suggestions for colleague moving to the UK   |   Can mold grow on food packed in oil? Newer »
This thread is closed to new comments.