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
- How to sell more ebooks on Amazon
- 10 ways to make your business more secure
- Top five VoIP mistakes
- How to add in-app purchasing to an iPhone, Android or Windows app
- Remote-control ransomware: TeamViewer and software hardball
- 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 check your identity hasn’t been sold to the hackers
- Tim Cook: this is how much TV has changed since the 70s
- Westminster wins the .London battle
- 20 years of PC Pro: from deep pan pizza to virtualisation
- Five reasons why the Apple Watch leaves me cold
- Apple Watch, iPhone 6 and 6 Plus: Tim Cook's Apple back with a bang?
- BT Home Hub 5: how to get maximum speed
- 20 years of PC Pro: one-star reviews (including "the worst tablet we've ever seen")
- 20 years of PC Pro: our best covers
- Why we've closed the PC Pro forums
- Toshiba beats retreat from consumer PC market
- Ellison steps down: but who's really running Oracle now?
- Microsoft set to make more job cuts
- Is Peter Pan panto tickets email genuine? Oh no, it isn't
- Intel triples Xeon E5 chip performance, adds DDR4
- Patch Tuesday targets critical IE flaw
- Microsoft refuses to hand over customer emails
- Microsoft yanks Windows 8.1 update after crash reports
- Microsoft backtracks on blocking out-of-date Java
- Gartner: time to start planning your Windows 7 upgrade