Pix Plays Richard Garriott’s DND#1 On a Commodore PET
Pix recently acquired a 2001-series Commodore PET. A vintage 1977 system, it sports “32K of RAM, a 1 Mhz 6502 processor and a 9 inch 40×25 character based green screen display”.
Richard Garriott’s Akalabeth precursor, DND#1, was written in 1977 as well…which fact led Pix to the following conclusion:
The PET first came out in 1977, the same year as DND#1 and it struck me that in the absence of a PDP-11 it was the perfect platform to port the game on to for an authentic 70’s gaming experience. Also since Commodore BASIC is extremely similar to the one used on the PDP-11 there should be minimal work involved. I took a lazier option still and started from an Applesoft BASIC port by Aaron Lanterman. Both Apple and Commodore BASIC were based on Microsoft BASIC making them almost entirely compatible and limiting the amount of work I had to do.
Of course, he had to make a few changes to the code to get it to work:
The changes I made were:-
- Convert everything to lower case. Despite the PET only having uppercase it needs all the BASIC commands to be lowercase when pasting the code into the WinVICE emulator.
- Remove most of the spaces from the code. Other than the one after the line number and those in strings, Commodore BASIC ignores spaces and since memory is in extremely short supply they needed to go.
- Shrunk all the arrays. These all appeared to be unnecessarily large and caused out of memory errors in their original sizes.
- Hardcoded a dungeon into the code. The original game allowed the user to pick 1 of 6 dungeons which were then loaded from a file. This wasn’t an option for me so I pinched the first dungeon from the winning javascript port athttp://www.kirith.com/DND #1/pure-js/ and load the data into the dungeon array. You get this dungeon no matter what number you pick.
But, as you can see above, he got it to work…and even played for a little while, to better form an opinion of the first in a series of little games that Richard Garriot would write, before calling one of them Akalabeth and putting a few copies up for sale at a local computer store:
DND #1 is very basic and not all that playable but has to be worth a glance at least for anyone interested in the pre-Ultima dark ages of early video games. It’s not hard to see how this evolved into Akalabeth – convert it to 3D and they really wouldn’t be all that much different. As for playing it on the PET, it’s certainly an oldschool experience if nothing else. A bit of optimisation to get the speed up really wouldn’t hurt – I might take another look at it some time.
…
The game isn’t all that user friendly. If you do play it, don’t ask for instructions or it kicks you out, make sure your player name is shavs and enter 16 (or any higher number) once you have bought enough equipment at the start to go into the game proper.
He has also released the modified source code, the tape file, and the WAV file for loading the game onto real hardware. I’ll probably have to put together a project entry at some point…just as soon as I figure out where it should go.