Culture / Development

Software Developer Tracks Down Code for a Beloved 41-Year-Old Text Adventure

25 Apr 2021 9:00am, by

Arthur O Dwyer - pumpkin-toss (cropped)

“You are in a large, tarnished brass bed in an old, musty bedroom. Cobwebs hang from the ceiling…”

In the late 1970s, when two students graduated from New York’s Rensselaer Polytechnic Institute they left behind the interactive text adventure “Castlequest,” which remained installed on the school’s computer system.

More than 40 years later, after five years of searching, the original Fortran code for that game has been re-discovered and resurrected, thanks to the diligent efforts of an amateur game preservationist who had fond memories of playing the game when he was 11. It’s a story of dedication and perseverance, but most of all how far one can go with the fondness for a minor piece of tech culture.

And there’s something reassuring in knowing that memories can be preserved and that childhood joys can be experienced again, even if it’s only restoring a fanciful college student game about exploring a medieval castle.

Back to the Future

For more than a decade, “Castlequest” had languished in oblivion, until 1994, when it had been discovered at the university by a visitor from a then-growing online service called The Source. He’d contacted the game’s two authors — Mike Holtzman and Mark Kershenblatt — offering to port their game to The Source (and split the royalties). Later ported the game over to two other pre-internet online services,   CompuServe and an online service offered by General Electric that had amassed over 350,000 users, namely GEnie.

One of those customers was Arthur O’Dwyer, the 11-year-old son of two programmers. He had very much enjoyed playing “Castlequest.” By middle school, he was even designing his own amateur interactive fiction games. “I definitely had more incidental exposure to text adventures than the average ’90s kid,” O’Dwyer tells me in an email interview.

O’Dwyer would go one to develop a hobby of rescuing classic computer games, starting with the interactive fiction game “Colossal Cave Adventure.”

Programmer Will Crowther (also a part of the ARPAnet development team), had created the game in his early 40s for a PDP-10 mainframe in the mid-1970s. Still fondly remembered, the command-line game simulates exploring a cave while collecting treasures and solving puzzles — and showed the world the potential of computers for gaming. O’Dwyer even ran a Kickstarter campaign in 2012 that successfully funded the adaptation of “Adventure” into a board game.

O’Dwyer would later create a playable online version of “Adventure”, based on the version that was created by famed mathematician Donald Knuth in 1998 using the CWEB programming system to adapt the original Fortran source code.

And this in turn got O’Dwyer exploring what other variants of Adventure existed. He’s still on the hunt for some missing treasures — including David Long’s 751-point “New Adventure,” and a version from Colorado State University featuring a witch’s gingerbread house. So he put out an online plea — adding as an afterthought that he was also looking for other lost computer games, “ones I’d actually played as a kid,” such as a Dungeons & Dragons clone titled Black Dragon… and Castlequest.”

Unfortunately, “after the demise of GEnie ([along with] The Source and Compuserve), it seemed that the game had been lost forever,” O’Dwyer wrote in a blog post. Starting in 2016 he’d swapped some emails with one of the game’s original creators. But then last year there was a crucial discovery. 40 years ago, one of the original programmers had submitted a registration to the U.S. Copyright Office. O’Dwyer had discovered that registration had “remained on file somewhere in the depths of Washington, D.C., for forty years.”

Castlequest in US Copyright Office database (screenshot)

This October one of the original authors agreed to try retrieving a copy of their original submission. No one remembered what they’d submitted. It could be just a transcript of the game’s text as it was being played, or a “walkthrough” summarizing all the game’s events. But when the Copyright Office employees went into their physical archive and retrieved the original deposit, it turned out to be all of the game’s original code (written in VS Fortran).

All 78 pages of it.

Holtzman had printed it all out on the printer at his first post-college job at Grumman Data Systems…

“I was thrilled,” O’Dwyer told me, adding that none of the original programmers expected their filing had included a complete copy of all the code. Reunited with his code, Kershenblatt lovingly scanned in all 78 pages (at a local Staples store), and then uploaded the resulting files to Dropbox. This ran up against the limits of optical character recognition, O’Dwyer points out, and after exploring several ways to re-scan the results — O’Dwyer finally just decided to manually transcribe the PDFs himself.

“Three days of eyestrain later, I had a plain-text version of the code!”

GNU’s free version of Fortran (gfortran 4.9) kept giving him an error message about incompatible data types when he tried to run the code. O’Dwyer later blogged that Fortran IV actually didn’t have a dedicated data type for character strings, so they were stored in other variables (like integers) and they later converted back into strings. But by making some strategic tweaks to the code, he got it to compile. At one point he even consulted his mother, who is now a retired computer programmer.

Back from the Dead

The end result is a small but glorious revival of the game, demonstrated by a discussion thread on the Interactive Fiction site where new users are rediscovering its joys — and even some bugs that apparently survived over 40 years. One user described getting it to run on their Windows system (using the Windows Subsystem for Linux). Another noted that “This game is so old-school it demands you to type in ALL_CAPS.”

But after reaching the happy ending (which involves cheering villagers) one player called the whole game “quite charming”

O’Dwyer himself created a blog post describing his experience of finally playing the game after all these years. Although “I’d just spent three days transcribing the source code, so I’d seen literally every line of the game — and yet I was still relatively unspoiled.”

He’d soon created a map of the manor — the hallway, parlor, foyer, smoking room — and discovered again that mysterious umbrella near the door — still dripping! — and that ominous black cape that’s been draped over the banister…

The New Stack is a wholly owned subsidiary of Insight Partners. TNS owner Insight Partners is an investor in the following companies: Diligent.

A newsletter digest of the week’s most important stories & analyses.