Saturday, July 2, 2011

Interactive Fiction and PiFi

About 3 years ago I started a small pet project named PiFi (Python Interactive Fiction Interpreter). You can read about interactive fiction here (they are often called text adventures). The interpreter is actually a virtual machine (much like the one java uses) so as to be able to run the same zcode story files on any platform. This isn't something new: that was the way the first zcode interpreter from Infocom used to work in the early '90s. However, it might be the first python zcode interpreter to reach this state of functionality! :-)

The only reason I started this project back then was to help me learn to code in python. I didn't expect it would be able to run anything at all at that time, and for about a year I had stuck to a stupid bug that wouldn't allow most of the stories to even start. However, I am now really glad to announce that it can finally run a lot of interactive fiction stories from start to finish without any problems. It's only dependency is PyQt4. There is of course a couple of minor bugs and it is still considered in alpha state (some opcodes are missing) but you can give it a try with any version of infocom (zcode) story files except version 6. There is a big archive of free to use story files in You can find the link to the git repository for PiFi on the right side of the blog.