How to write interactive fiction games on Windows or Mac
Posted on 23 May 2011 at 09:36
Ian Wrigley reveals how to use open-source tools to create games from a bygone era
My first computer was a Sinclair ZX80, followed rapidly by a ZX81, a Commodore PET and a BBC Micro, which I bought second-hand and that was missing the heatsink from its CPU. I got around the overheating problem by running it with the top off and a glass of cold water balanced on the chip. Ah, the innocence of youth.
Back then, computer games either had pathetically basic graphics or were entirely text-based. In the latter category were what we called “adventure” games, and which are nowadays more generally known as interactive fiction (IF).
I suffered a bout of nostalgia recently and wanted to revisit some of those old games but, of course, I no longer own that BBC Micro. It turns out that isn’t a problem, because there’s a thriving community of IF enthusiasts who’ve created interpreters capable of playing all these old games, and they’ve even created systems that enable you to author your own titles.
There’s a thriving community of interactive fiction enthusiasts who’ve created interpreters capable of playing all these old games
The standard way that IF games are written is by employing a virtual machine called a Z-machine, which was originally written back in the late 1970s by Infocom, the main company in the IF world at that time.
The Z in Z-machine in fact stands for Zork, which was the company’s first famous adventure game. Infocom took this virtual machine approach because there were so many different types of personal computer around at that time, so by writing a Z-code interpreter for each new platform the company could immediately make all its products available on that platform. That’s great news for us now, because it means that to play all of these old games, all you need do is implement a Z-code interpreter for your particular OS (or, perhaps more realistically, hope that someone else has already done so).
This, as it turns out, is very likely because there are Z-code interpreters for Windows, Mac OS X, Linux and pretty well any platform that you’re likely to be using. The key ones are, of course, open source. If you’re using a Mac the gold standard is Zoom, which supports not only plain-text games but also adventure games with graphics. For Windows folk, Frotz is probably your best option, and there’s even a port of Frotz for the iPhone and iPad, so you can play your games while you’re out and about.
The interpreter itself is of no use without games, of course, but you can find the old Infocom games online very easily, although the legality may be slightly questionable. You might also still be able to buy a compilation of the games that Activision released in the 1990s (Infocom was taken over by Activision in 1986, but it abandoned the Infocom trademark in the early 2000s).
Should you happen to download or buy one of these games, you’ll find that you need to rename the data file, whose name ends in DAT, so that it ends in Z8. Once you’ve done that, you’ll be able to open it in Zoom or Frotz and immediately start playing.
There are also many IF games that have been written by other people, and the best place to look for these is The Interactive Fiction Database, which is a searchable archive. From there you can download the games, and most of them work in Zoom or Frotz since they’re written in Z-code. If you want to create your own game, you can do that too, thanks to a program called Inform that runs on Windows, Macs and Linux.
Game development is interesting as you really don’t need to be a programmer at all: Inform’s “language” is very similar to standard English and the interpreter then translates that into Z-code (or into another similar bytecode called Glulx, which is more suitable for games that include multimedia content).
It takes a while to get the hang of writing games using Inform but you’ll be creating mysterious worlds to your heart’s content soon enough. An interesting application of Inform, as well as Zoom and Frotz, is letting teachers create games that their students can use, which can be used to improve reading and problem-solving skills – if you’re a teacher who’s done this, or who hadn’t considered it until now but is going to give it a try, I’d love to hear your experiences.
I have been exploring IF for education for about 12 months now. Slow progress but great results. More here http://t.co/f126BSh
Happy to pick up the conversaton.
By Kristianstill on 22 Dec 2011
PS - IF
Forgot to mention the platform we are using is QUEST, recently taken OS by lead developer Alex Warren.
By Kristianstill on 22 Dec 2011
- Why laptops with serial ports matter to the Internet of Things
- Make your mobile battery last longer
- Small steps into handling Big Data
- Nexus 5: does it really run stock Android?
- How to get broadband to a garden office
- How to write your company's IT security policy
- Raspberry Pi and Wolfram: a must-have for every child
- Could you get by with Office Web Apps?
- The best Android antivirus apps for 2014
- Headings vs headers: how to use both in Word
- Hello Cortana, it's nice to meet you
- Windows 8.1 Update: an abject surrender
- The insane economics of Sky Now TV
- No such thing as a free app... so pay up if you want quality
- Time to outlaw crapware-laden installers
- Windows Phone 8.1 video: hands-on
- Office for iPad: key information
- Why every PC buyer owes Richard Durkin a debt of gratitude
- HTC One M8 vs Samsung Galaxy S5: 2014's big-hitters compared
- Windows XP end of life: key information
- Cisco: 100% of companies hosting malware
- Microsoft supercharges PowerPoint with Office Mix
- Microsoft and Nokia deal tweaked ahead of completion
- Microsoft slashes custom XP support price
- Ubuntu LTS Server 14.04 extends cloud support
- Intel: PC sales are "encouraging"
- Google to rank encrypted pages higher
- Heartbleed: the race to reissue security certificates
- Dropbox boosts app line-up with Carousel and Mailbox for Android
- BlackBerry CEO says not selling off phones "any time soon"