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
- Facebook "click on the photo" scams: how they work
- Three alternatives to Word's spelling and grammar checker
- Google two-step verification: a must for business email
- Microsoft Office and the death of upgrades
- The ICO's shame-faced u-turn on cookies
- Start8 and ModernMix: making Windows 8 work on a desktop
- How to boost your mobile reception
- How to fix Facebook: Social Fixer
- Taking the stress out of WordPress updates
- Where to download free web fonts
- Huawei Ascend P6 review: first look
- Adobe Illustrator CC review: first look
- Let MPs tell us what they really want ISPs to block
- Adobe Photoshop CC review: first look
- WWDC 2013 and iOS 7 launch: live blog
- Sony VAIO Pro review: first look
- Want child porn blocked? Meet the IWF
- Is it worth upgrading a media centre to Windows 8?
- Flickr redesign: is it enough to tempt photographers back?
- Hands on with the new Google Maps
- AMD’s "Seattle" ARM chips set for 2014 release
- Adobe’s subscription-only Creative Cloud goes live
- BBC "misled" MPs over failed £100 million IT project
- Join the PC Pro Business Lunch for the finance sector
- MPs "shocked" Huawei-BT deal wasn't vetted
- Government wastes "three days a year" booting PCs
- Windows 8.1 brings back the Start button
- Microsoft connects Skype to Lync
- Cisco moves to block Microsoft-Skype deal
- Half of the UK’s biggest sites break cookie rules