Wednesday, 2 November 2016

October Retrochallenge 3: The Valley

Here's my final project of the October Retrochallenge. I finished just a little too late to make the 31st deadline, but in the spirit of better late than never, I'll post about a porting project I embarked on over the last week to help cheer myself during one of the most challenging times I have at work every year, midterms! Lot's of marking of exams and papers makes this a time, along with mid-winter, that I really need some pleasant distraction.
Grundy Newbrain 8-bit computer
I am a member of the CASA website "Solution Archive" dedicated to Interactive Fiction, including classic adventure games. Colin Appleby joined the group and asked a lot of questions in the "classic forum," about adventures with versions for the Grundy Newbrain 8-bit computer of the UK. He was looking for games for this quirky little 8-bit machine, which was a little like the MC-10, in that it never really gained a big enough market share to be considered one of the mainstream home computers. Like the MC-10, it was bit of an outlier, which is just one of the features that can make a machine so endearing as an object of retrocomputing interest.

One of the games Colin mentioned in his posting was a Basic RPG called "The Valley." This, of course. elicited some complaints from the IF purists in the group that it wasn't really an example of interactive fiction or text adventuring. I think such distinctions are rather arbitrary and was quite happy to hear that Colin had made the file available on the Newbrain emulator site. I am always on the lookout for basic source code!
Kayde Manual
The game is from the Kayde company and was originally distributed on tape. Colin's distro not only included a file for loading into the emulator but also the text source code. Oh how I wish everyone who distributed Basic games for emulators did this! It means you don't have to figure out a new system, its emulator and all the tricks about how to get a Basic file in text format out of the system. The source also lists Chris Despinidis as contributing some debugging. I think Chris is the maker of the Newbrain emulator. See: http://www.newbrainemu.eu/ for more info about the Newbrain.

The Newbrain has a 40X24 screen and the game uses simple "text graphics." Since the MC-10 doesn't have 24 lines, it was useful to be able to use the 64X32 8 color low-res graphics to recreate the text maps. Instead of using various characters to represent the objects on the map (forests, lakes, castles, dark tower, woods, safe path, swamp) I was able to use colours. I also had space left over on the right hand side to put a colour key to explain what each colour represented, since 64-40=24 dots or 12 characters. Luckily there weren't too many items, so 8 colors and black were basically enough to represent everything needed for the maps, with only a little careful doubling up of some colours for slightly different uses on the 3 basic types: terrain, forest/swamp, and castle/tower. The result is a little speedier than the original (I was able to get the game up and running on the Newbrain emulator to help with the porting project), which I think is simply because the MC-10 was developed about 3 years later.  As usual, I never know if I have fully debugged, but I will continue to play the game for a while and hope to weed out any that may be left.

In fact, I think I might have spotted some bugs in the original source. I shared this info with Colin on the MC-10 Facebook page. I found an error in line 3820 of the original source that I had downloaded (back in September) that involved a missing colon before a PUT command (how the Newbrain outputs special characters to the screen). Having had my source for some time it's possible Colin or Chris has debugged it in the meantime. I also noticed that line 9000 should probably have had a GOSUB20000 in it instead of GOSUB2000, since the former was a commonly called subroutine, whereas the later was definitely not. However, this GOSUB would possibly never have been triggered in the original because it was in an IF statement looking for a character 230, which I could not find "PUTed" anywhere in the source. My best guess was that a code 254 was what was really needed and adjusted my MC-10 version accordingly to use the right POINT check (to sense the color of the screen locations and return a number from 0-8 for the color found). The command now randomly triggers a message that there is no entry to the buildings on the islands (in the middle of swamps and forests) from the direction one is coming and to seek another route in. So perhaps, the MC-10 version has a feature that even the Kayde original lacked?!

Thanks to John and the other participants in the Retrochallenge, and to Colin and Chris over on the Newbrain site for sharing their retrocomputing enthusiasm!

No comments:

Post a Comment