The nostalgia is strong in this one. (In both this post and this blogger, in case you’re wondering.)
It started with my 20th anniversary at Autodesk, but it got worse, last weekend, when I travelled to the UK to celebrate the 50th anniversary of the University of Kent (where I studied, back in the day, about halfway through its history). I’d coordinated with a couple of close friends, so we descended on Canterbury from Switzerland, Connecticut and Windsor, and joined a thousand or so alumni for a really fun, celebratory weekend, revisiting old haunts and sharing old memories.
Doubling down on the somewhat dubious nostalgia derived from using the same student accommodation as I did back in 1991, I chose to burn through the first season of “Halt and Catch Fire” during the trip, too. This is set in 1983 and talks about the birth of the PC revolution, as John Walker did when I interviewed him some years ago. A brilliant show that I’m sure most people in our industry would thoroughly enjoy.
After getting back from the UK on Sunday, I hopped across to Prague on Tuesday morning for a Meetup. I had a bit of time to kill in the hotel, on Wednesday morning, which is when the nostalgia peaked… on the trip over I’d started reading an excellent anthology of computer game-inspired short stories, so I said to myself “wouldn’t it be cool to play old school text adventures directly inside AutoCAD? I wonder if it’s even possible?”
What followed was a fun couple of caffeine-fuelled hours which led to a basic .NET application allowing you to play Zork I, II & III (along with a host of other games – more on that in a bit – directly inside AutoCAD via its command-line). It turns out that the old Infocom adventures – starting with Zork – were coded against a virtual machine called Z-machine, allowing them to be ported more easily to other platforms. And, guess what? There’s a .NET version of Z-machine available, called ZLR, allowing you to play a whole slew of Infocom games (although apparently the Zork trilogy may well be the only ones not still under copyright) on Windows and integrated into Windows applications.
The C# code needed to integrate the ZLR into AutoCAD, and to wire it up to a few ROMs for the various Zork games, ended up being pretty trivial. I had to use Editor.GetString() and WriteMessage() – rather than Console.Read() and Write() – but nothing very tricky. Here’s the basic source project – which includes a built DLL and the Zork trilogy ROMs, to save you some work – which enables the ZORK, ZORK2 and ZORK3 commands inside AutoCAD (as well as a ZM command to load an arbitrary Z-machine ROM you’ve downloaded yourself). Oh, and here’s a walkthrough, in case you get stuck.
It’s a CRX app, so works well from the Core Console (and would also work inside AutoCAD I/O, but then you can also play Zork I, II & III online interactively, so it’s hard to find a sensible use-case for that ;-).
I mentioned this bit of fun to my friend and colleague, Christer Janson, and his first comment was “I spent hours drawing maps of Zork when I was a kid… can you have AutoCAD draw the map automatically as you play?” It turns out that Zork maps are notoriously tricky – the worlds typically aren’t simple grids of locations – but we’ll just have to see what we can do in a future post…