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.

Monday, May 30, 2011

libEasyRandR and kdisplay update

libEasyRandR is still progressing quite well and can already catch some unwanted arguments for the RandR extension functions. kdisplay is the GUI app that helps in testing this lib and is able to list all available outputs from all virtual screens on your computer, change their resolution and place them using absolute position in virtual screen space.

Testing the RandR extension is no fun if you are not careful enough. I have caused my display to go blank with no way to restore it except killing the Xserver! :-( I don't know if it was caused by bad graphics driver or some condition that wasn't covered in RandR.

Luckily, in the later versions of VirtualBox you are able to add multiple monitors to your virtual machine thus enabling me to test kdisplay without risking killing my Xserver all the time. Also I can do tests with more than 2 outputs without having to get my desk cramped with monitors :-) Here is a screenshot of my virtual setup:

And to think that all these are run in a quite old laptop!

Monday, March 14, 2011


I've been trying to create a library to simplify the use of randr functions in X server. It's still a long way from being complete however I have already implemented most of the functionality that exists in v1.3 of the randr specification. I have written a small test program to test if the library actually works and for now I'm able to query the xserver for the available outputs, what modes they support, which one is being used now and much more. I have added support for also making changes to the configuration but it hasn't been tested for now. For anyone interested in the project, I'm using github for the project. You can find it here.

The next step is to create a nice GUI application to use the lib. I'll be making some tests with some concepts I have for multimonitor configuration and I'll be posting the progress. You can find the GUI app in the github repository as well (kdisplay) however it doesn't do anything for now.