Wednesday, April 10, 2019

Zork I: Of minis, micros, and Z-Machines

Zork I arose from the decision to sell Zork on the booming microcomputer market, and it had to be more or less rewritten. It is a condensed, polished up version of Zork, with large sections of the game removed because something had to go in order to fit such a massive game on a 96KB floppy disk and run on a 32KB machine.

Digital Antiquarian goes into more technical and historical detail than I do, and if you're interested I would highly recommend reading it:

Rather than duplicate too much of that information, I'm mainly going to discuss the parts relevant to my approach on how I'll play Zork I, and why. As before, “Zork” refers to the mainframe game, and “Zork I” refers to the more widely played microcomputer game.

My tipping point on deciding to replay came from realizing that I may have never played a sufficiently original version of it. Infocom updated Zork I many times in between 1980 and 1983. The final release of 1983, which had been updated to the technical standard of Zork III, is known as “revision 88,” and is the most widely distributed version of it. It has been since distributed in all compilations, in Activision’s freeware release, in the Zork packs distributed by GOG, Steam, and even as an easter egg in Call of Duty: Black Ops. And yet, this isn’t the final version.

In late 1987, Infocom produced a final “Solid Gold” version, which updated the game code to their current standards and added in-game hints. This version, confusingly numbered “release 52,” has fallen to the wayside, having never appeared in subsequent compilations. Paradoxically, it not only means I never played the original version of Zork I, but that I also never played its actual final, definitive version.

So I thought I ought to play the earliest available version of Zork I, but which platform was its original home? I had thought it debuted on the TRS-80, but the full story was a bit more complicated.

Zork I’s commercial releases were not written for any particular platform, but for a virtual “z-machine” in an abstract code. Infocom’s developers would write Zork I’s “story file” on the same PDP-10 mainframe that ran the original Zork, which in turn was the same kind of computer that ran Adventure. The story file defined Zork I’s rooms, items, logic, and descriptions, but would make no assumptions about the platform it would eventually run on except for a minimum amount of RAM, the presence of a floppy drive, keyboard, and some ability to display text.

Story file interpreters were written for the target computers, initially the TRS-80, Apple II, and PDP-11, a DEC “minicomputer” smaller than the PDP-10 mainframe but still far too large at the time to compete with personal computers. These interpreters were analogous to emulators, software that emulated the virtual “z-machine,” working by translating the “z-code” logic of the story file into instructions compatible with the target computer.

For instance, the Apple II at the time lacked the ability to display lowercase letters, but Zork I’s story file contains them. It’s made compatible by a routine within the Apple II interpreter logic which converts all lower-case letters into upper-case. Meanwhile, the TRS-80 could display lower-case letters just fine, so the TRS-80 version’s interpreter doesn’t need to do any such conversion.

Nowadays, there are modern z-machine interpreters which run natively on modern hardware and enable features such as custom fonts, colors, unlimited save files, text output redirecting, and transcripts/printing, but still use the original story files.

This isn't even the first adventure game I've covered that was written with this kind of data/engine separation of concerns. Adventureland's code was also strictly separated into two parts, a "data base" program with a list of the words, rooms, nodes, objects, and relationships between them, and an interpreter program which was re-used to make over a dozen additional games in the same format, including Pirate Adventure and Mission Impossible.

I’m tempted to just use Frotz, a native Windows interpreter, to play Zork I. After all, it’s the story file that’s the heart and soul of the game, and Infocom had, in a way, been very forward thinking in their approach. When the Amiga 1000 hit mass market shelves in 1986, they were able to rapidly port a whopping 22 of their games to it within a year. This is because they really only had to port the interpreter component, and only had to port it once; the same interpreter could be used with all 22 games that they had written at that point. Then, every existing Infocom story file could then be released on the system by pressing a disk with the new Amiga interpreter and the old story file, and all could take advantage of the Amiga's colors, fonts, and expanded RAM, even though the games had all been programmed on a PDP-10, mostly without knowledge of the Amiga's existence. You can even extract the “” file from an Amiga disk, byte compare it with the one from a 1983 PC re-release, and see that aside from padding required by the Amiga file format, they are the exact same file!

So why not just use Frotz? Zork I, being developed on a PDP-10 to a virtual specification, has no real target platform, and Infocom clearly had future-proofing in mind. Well, I expect that I will use Frotz to play future Infocom titles, but I think that at least once, I’m going to emulate a vintage system, for the most authentic 1980 experience that I reasonably can.

Jimmy Maher at Digital Antiquarian used a similar rationale, choosing to emulate an Apple II, as that was the most popular platform of the day. I decided to go with the TRS-80 instead, for two reasons.

First, as mentioned, the Apple II cannot display Zork I’s lower-case letters, which means we’re already compromising Infocom’s intent by using that platform. The TRS-80 also has a wider column display; the text is formatted at 80 columns, but the Apple II only supports 40 columns, and the TRS-80 supports 60. Consequently, both platforms need to break up long lines, but the TRS-80 does it less often.

Second, the TRS-80 version I found seems to be more original, being designated “release 2,” while the Apple II version Maher played is designated “release 5.” I presume “release 1” was an internal Infocom build that never saw a commercial release.

The very first commercial release of Zork I was actually the PDP-11, and I expect it offered an experience closer to Infocom’s original intentions than the TRS-80, but I have no idea if it’s even possible to acquire PDP-11 game disks, or if that’s possible, or what I would do with them if I had them.

Curiously, the PDP-11 had already received a port of Zork of sorts. Bob Supnik's "Dungeon," a FORTRAN rewrite of MDL Zork, which I understand had a fairly wide distribution at the time. Who knows why Infocom decided to make a commercial product available to a niche platform unsuited to personal use that already had access to the original, more complete version, but they did, and reportedly it sold no more than 100 copies.

Next post, I'll actually play the game.

No comments:

Post a Comment

Most popular posts