How GeekBoss got its name and the ‘muddle’ of coding for Zork

By Matthew Stibbe Matthew Stibbe
Zork I advert - 'Your greatest challenge lies ahead - and downwards'

Readers may know that I started my career in computer games. Instead of enjoying ‘the end of history’, back in the 90s, I was CEO of Intelligent Games. One of the games that inspired me to get into the business was Zork, a text-only adventure game, and the industry’s first million-seller hit. I wrote about it in my Secret History of Computer Games.

Screenshot of traditional Zork text adventure game
Zork mixes wit, puzzles and a lot of twisty passages
Screen shot of people playing Zork in Slack
Articulate Marketing playing Zork in Slack

More recently, with history making a big comeback, Zork re-entered my life. I found a way to hook it up to Slack, the live chat system we used at Articulate Marketing. This allowed my colleagues to play Zork in Slack in a collaborative, fun way. It was cute for a while. So, I was driving through Romania with my wife and I was explaining to her how I had set up this game in Slack and she turned to me and said, ‘good grief, Matthew, you’re such a geek boss!’ Well, never let a good domain name go to waste. I actually bought the geekboss.com domain on my phone before we reached Iași. And that is how this blog got its name.

I told this story to Aaron A. Reed, author of the forthcoming book “50 Years of Text Games: From Oregon Trail to A.I. Dungeon. So he offered to write this article for GeekBoss about Zork. In it, Aaron debuts some new material from the book on Infocom’s Zork, one of the earliest commercial text adventures, and how its creators devised a unique programming language in which to create it. It’s a very GeekBoss article!


Coding a better Adventure

When four grad students at MIT set out to create a better version of “Adventure” – the genre-defining text game that set ARPANet on fire in the summer of 1977 – they were keen to not just clone it, but improve it. “We have to do something better,” co-creator Dave Lebling recalled of the attitude around the lab where Zork would be born: “the honor of MIT is at stake.” When the team was later profiled for a newspaper article, the author noted of the rivalry between MIT and Stanford (where Adventure’s Don Woods hailed from), that “American programming primacy is split like the medieval papacy between Cambridge and the West Coast.” Improving on Adventure was not just a challenge: it was a mission.

Marketing Strategy foundations course CTA

Zork would in fact end up being significantly bigger than Adventure, with a more elaborate world model, better parser, and more complex puzzles to boot. But while Adventure had been written in hacked-together Fortran, the MIT team’s ambitions stretched against the limits of a general-purpose language not built for simulating worlds. Writing in a retrospective about “the problems of building reality,” the Zork team reflected on the issues caused just by adding a river and an inflatable raft to the game:

There were minor problems of consistency — some parts of the river were sunlit (and even reachable from outside), but others were dark. The major problem resulted from the new concept Marc introduced: vehicles. In the original game, there were rooms, objects, and a player; the player always existed in some room. Vehicles were objects that became, in effect, mobile rooms. This required changes in the (always delicate) interactions among verbs, objects, and rooms (we had to have some way of making “walk” do something reasonable when the player was in the boat). In addition, ever-resourceful Zorkers tried to use the boat anywhere they thought they could. The code for the boat itself was not designed to function outside the river section, but nothing kept the player from carrying the deflated boat to the reservoir and trying to sail across. Eventually the boat was allowed in the reservoir, but the general problem always remained: anything that changes the world you’re modelling changes practically everything in the world you’re modelling

In short, Zork was aiming for a level of realism and complexity that really required an engine for simulating worlds in text, not just a series of hacked-together routines and GOTO statements. While they would eventually develop exactly that, the first step was to switch to an existing language more suitable for defining base cases and easily overriding them than Fortran.

Muddle – More Datatypes than Lisp

Zork was therefore written in a language called Muddle that had been devised by the research group the grad students were part of. The name was retconned as MDL (“MIT Design Language”) for more respectability, but had originally been named Muddle as a bit of grad student fun. Even the new name wasn’t immune from hacker humor: the joke went that the new acronym actually stood for “More Datatypes than Lisp.” Muddle aimed to be an improvement on Lisp, which the MIT group was quite familiar with: already by the late 70s it had a pedigree more than a decade long as an elegant, powerful alternative to Fortran and other workhorse languages. In Lisp, everything is represented as lists which can be altered, appended to each other, sorted, or nested. This universality of abstraction made Lisp capable of more self-reflexive operations than other kinds of programming languages: for decades, it was the language of choice for any code related to artificial intelligence.

MDL improved on Lisp’s flexibility by adding robust support for user-defined data types– “the best of any language with which we are familiar,” according to its manual — and better string handling, both of which made an Adventure-like program much easier to author. In Adventure’s code, the strings defining room descriptions and the results of actions had to be stored in a separate data file, and only referenced numerically within the body of the program. MDL let Zork be written much more naturalistically with behaviors and descriptions inline together, and its flexibility made it much easier to overrule default behaviors: a list could contain anything from a string to be printed to a pointer to a function with entirely different behavior. Here’s the (slightly truncated) code for Zork’s Carousel Room, which kicks the player out one of its exits at random until the CAROUSEL-FLIP bit is unset (when the player finds a way to stop the room’s rotation):

#ROOM {"CAROU"
     ""
     "Round room" %<>
     #EXIT {"NORTH" #CEXIT {"CAROUSEL-FLIP" "CAVE4" "" %<> CAROUSEL-EXIT}
            "SOUTH" #CEXIT {"CAROUSEL-FLIP" "CAVE4" "" %<> CAROUSEL-EXIT}
            "EAST" #CEXIT {"CAROUSEL-FLIP" "MGRAI" "" %<> CAROUSEL-EXIT}
            "WEST" #CEXIT {"CAROUSEL-FLIP" "PASS1" "" %<> CAROUSEL-EXIT}}
     (#FIND-OBJ {"IRBOX"}) CAROUSEL-ROOM}

<DEFINE CAROUSEL-ROOM () 
     <COND (<AND <VERB? "GO-IN"> ,CAROUSEL-ZOOM!-FLAG>
          <JIGS-UP ,SPINDIZZY>)
         (<VERB? "LOOK">
          <TELL
"You are in a circular room with passages off in eight directions.">
          <COND (<NOT ,CAROUSEL-FLIP!-FLAG>
               <TELL
"Your compass needle spins wildly, and you can't get your bearings.">)>)>>

<DEFINE CAROUSEL-EXIT ()
     <COND (,CAROUSEL-FLIP!-FLAG <>)
     (<TELL "Unfortunately, it is impossible to tell directions in here.">
     <CAROUSEL-OUT>)>>

<DEFINE CAROUSEL-OUT ("AUX" CX)
     #DECL ((CX) <OR CEXIT NEXIT ROOM>)
     <AND <TYPE? <SET CX <NTH <REXITS ,HERE> <* 2 <+ 1 <MOD <RANDOM> 8>>>>> CEXIT>
          <CXROOM .CX>>>

MDL lets the creators here elegantly override the default behavior for movement just for this one location, by routing cardinal movement to the CAROUSEL-EXIT function (instead of normal movement code) when CAROUSEL-FLIP is set. This ability to define specific overrides to general behavior made Zork’s code far simpler to extend and reuse than Adventure’s mess of special-case handling. It also made it easier to add extra responses to invalid commands as the writer/programmer thought of them, making the simulation more responsive to unexpected input and the resulting game more fun to play.

The origins of ZIL

The team would eventually refine a version of MDL into an even more specialized tool for text adventure creation called ZIL, the Zork Implementation Language, providing a platform for a decade of successful commercial interactive fiction games as the team became the now-legendary company Infocom. ZIL games compiled to bytecode for a virtual machine, the Z-machine (Z for Zork again), which is still used by many amateur text adventure makers today.

Coincidentally, the language created only a few months later across the Atlantic in the UK to write content for MUD, the first major multiplayer Zork-like (which itself spawned a whole genre of hundreds of other games) was also called Muddle: specifically, MUDDL, the Multi-User Dungeon Definition Language. MUDDL and MDL bear no relation to each other in design or inspiration, despite both being invented to author text adventures in the late 1970s.

Helpfully, when MUD’s co-creator Richard Bartle later made an entirely new and improved version for MUD2– a third entirely different language– he named it MUDDLE, with an E.

You can find out more about Aaron’s book on the history of interactive text games here: https://www.kickstarter.com/projects/aaronareed/50-years-of-text-games

How to choose an agency for your new website

Share