Castlequest: 1980 text adventure recovered

Via Arthur O’Dwyer at Quux+1:

With assistance and permission of one of the authors, O’Dwyer has posted the source code of a 1980 text adventure, Castlequest, that was once available on the GEnie network, but thought to be lost until now.

I gather that it’s not yet possible to play the game until someone works out a few difficulties with compiling the ancient FORTRAN code. Meanwhile, I’m sure this will be of interest to many people here.

(This is why I keep Quux+1 in my RSS feed, even though most of it is technical posts on C++ that are entirely Greek to me.)


I recently ported Adventure from Fortran to Rust.

Maybe I could do this too. :grinning:

Edit: The source looks simple enough.


The code is now compilable.


Yep, looks like a bunch of the same kind of stuff I dealt with in translating Adventure to Rust.

Are you sure? I’m still getting fatal errors.


Whoops. There it is in the patches branch.

1 Like

I call dibs on translating this to Inform6!!!


Note that there are still transcription errors being fixed, though. I’ve been helping out with that, but I’m probably missing things and anyway I still have about 30 pages left to look at.

1 Like

I eventually managed to compile this on WSL after Googling a few cryptic error messages (I know rather less than an addled egg about this), and I’m just starting to play the game. (If someone produces a working Windows executable, please speak up. I was able to run the MinGW version of gfortran without errors, but the executable segfaults when I try to run it.)

It seems to lack some of the polish of Adventure so far, but I’m having fun exploring. The game takes place in a castle “somewhere in eastern Europe,” and you’re told that your goal is to find and kill the master of the castle. Meanwhile, in the very first room, you find a crucifix and a silver bullet. So it’s easy to guess what sort of person the master of the castle will be. Interestingly, this first room is a bedroom, and you start the game in the bed. All sorts of questions suggest themselves about this situation. How did we get here? If there’s any information about the player character, I haven’t found it yet.

LOOK works as expected, but there’s no EXAMINE. There’s a VERBOSE command, but it doesn’t seem to work - I have to keep LOOKing to get the full description of visited rooms. SAVE creates a file called CQUEST.SAV and exits, while RESTORE reads this file. Managing multiple save files requires renaming the files manually, and CQUEST.SAV is overwritten without warning on every save, so be careful.

1 Like

Did you use Arthur’s “patches” branch to compile? I’ve just tried with MinGW64’s gfortran 10 (under Cygwin) and it seems to have worked, the resulting executable is here:

Yes, and I was able to run the program in WSL. Trying to run the Windows executable produced this:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  ffffffff

However, your executable seems to work, although it says this on exit:

Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG

I finished my proofreading, so I tried playing the game for a bit, using a version I compiled myself under Linux. I saw the same thing when quitting, but not every time. Maybe it’s tied to some event that isn’t running at the very beginning of the game (e.g. the werewolf)? I didn’t get very far, so most of my quitting was very early.

Speaking of the werewolf, once it appeared and I tried shooting it (I missed) it just kept following me around like a puppy, taking the occasional swipe at me and always missing. Does anyone know how it’s supposed to work? Looking at wwolf.f, I get the idea that he’s suppose to get more likely to hit you every time he misses. But I don’t speak Fortran, and I hadn’t even heard o the game before this.

Looks like this is indeed a bug. See Does the werewolf work as intended? · Issue #8 · Quuxplusone/Castlequest · GitHub for details.


I know zilch about Fortran but the PDP-10 ITS has an old Fortran compiler (Fortan IV, I think) that can compile the ADVENTURE. Coul this be used to compile the original code to Castlequest?

There where no problem to compile Castlequest with gfortran in CygWin. CygWin lacks the asa command to handle carriage control but it was quite easy to compile my own from, for example, this source.

Ah, I did look for the source for asa, but not very hard. I’ve added an asa.exe built from that to the Win32 build at - run it with “cquest | asa”.


When I get some time, I am going to attempt a Rust conversion of this like I did for Adventure.

Rust’s memory safety was able to help me identifiy at least one memory bug in the original game.

1 Like

I don’t know how the hell is structured, but that link seems to go to the old version of Castlequest_win32. I can download the newer version including asa by accessing it from this page, even though the link on that page seems to go to the same URL. I don’t know if it’s an oddly persistent browser cache issue or ifarchive is doing something bizarre with HTTP referrers.

EDIT: I think it’s HTTP vs. HTTPS. seems to be the old version, modified 03-14, while is the new version, modified 03-16. There are also three different indexes available for the “unprocessed” directory which list different versions of the file or omit it altogether, but I think HTTP vs. HTTPS is what matters. is behind Cloudflare, which can take 24 hours or so to update itself for changes to files, which is usually the cause of such oddities. It seems to be okay for me now.

I’ve already started, but I really need to get a compilable version so that I can play the game. That will make it easier to decipher the Fortran, as it’s a dialect that I’m not familiar with…and I haven’t really used Fortran for 40 years, anyway.

What system are you on? I had no problem compiling it with gfortran but you have to compile the asa or patch branch because the master branch isn’t patched for modern fortran and is still the transcribed original for ancient fortran.