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
- Is Facebook safe for business?
- Jon Honeyball's money's-no-object Christmas gift idea
- The importance of load balancing
- Windows Phone App Studio: an easy way to create your first Windows Phone 8 app
- The end of Windows XP support: what it really means for businesses
- Don't rely on Chrome's password vault
- Using Buffer to manage your social media
- Microsoft needs its own Steve Jobs
- Forget credit cards: hackers want your Facebook account
- Can't get fast enough broadband? Here's what to do
- Play it again: Berlin's Computer Game Museum
- Switching from iPhone to Android: what I miss, what I don't
- Tech City: Easy to score when you move the goalposts
- How to remove SkyDrive from the Windows 8.1 Explorer
- Switching from iPhone to Android? Switch off iMessage
- Why is Google pumping more money into Firefox?
- Sky Broadband Shield review
- Samsung Galaxy S4: how to double your battery life
- Motorola Moto G review: first look
- IBM Watson meets Willy Wonka
- BlackBerry loses $4.4 billion in a single quarter
- Whitman's HP salary bumped from $1 to $1.5 million
- Microsoft considered 100 candidates for CEO role
- GCHQ should have more oversight of Huawei
- Google might ditch Intel for its own server chips
- Microsoft patches TIFF flaw in next Patch Tuesday
- Microsoft expands encryption over NSA spying "threat"
- UK Cloud Awards 2014: nominations now open
- BlackBerry says "we're still alive" as sales hit new low
- Has HP turned a corner?