Monday, 10 July 2017

Wizard's Castle and Star Traders

David Ahl was one of the giants of the earliest era of  personal computers in the late 1970s and 80s. He edited Creative Computing magazine and published several major type-in program books such as Basic Computer Games, which sold millions of copies.

I thought he was the author behind a game I had in my collection (VENTURE.C10) for the MC-10 called "Castle Adventure." The title screen mentions his name:
The instructions mention a "Wizard Bergal" and a "Orb of Zot."  I don't know where I got this piece of code. Its been in my collection for quite some time, and might have been one of the programs I had from tapes for my original MC-10 from the 1980s. Recently I came across some discussion on the Net for a "classic" Basic game called "The Wizard's Castle" by Joseph Power. The discussion mentioned the "orb of Zot," which triggered my memory of Venture. However, as I explored people's discussion of Power's game and its influence I began to realize that it was a very different program from the one I had. For example, in Power's game there are flares that can be used to shine light into all the cells immediately surrounding the one you are in. Also, you can buy a lamp, but it never runs out of oil. You can also choose other equipment (and can find better equipment in the dungeon). People commented about the simple but interesting D&D like character creation (Hobbits, Elves, Human, etc.) and equipping choices in Wizard's Castle. Such features, along with others that occur while you are exploring, were completely absent from Venture:
Clearly the program in my collection was not the classic program by Power. I had to lay my hands on the source code of the original and take a look. I went to my standby go to source for source, software repositories for the original TRS-80. I easily found references to Power's Wizard's Castle. Once I had the source roughly converted (including removing a modification that simply revealed all the locations) it was obvious that its 8X8X8 multi-dimensional array blew the lid off the memory requirements of a standard MC-10 with just the 16K RAM pack expansion. I would have to do some cutting or figure out a way to organize the info into a less memory demanding form than 5 byte floating point numbers for each array element. I began to suspect that the "Venture" program I had was a significantly simplified version of the game that made space for the massive numeric array by removing many of the minor, more quixotic features, of the original. Sadly, these features were what gave the program much of its charm. If I was going to preserve these features, I'd have to be creative.

I realized that each location in the array only needed to store an ASCII character representing the different items in each room, "B" for books, "C" for chests, etc. All I needed was to create a string space so each item could be stored as a single byte character poked into that space. As I read more about Power's efforts to create the program for the 16K Exidy Sourcerer computer he developed the game on, he'd had to do a similar thing. In fact, he used a memory space used for storing user definable characters. When someone had ported the program to TRS-80 they had simply removed this stuff and substituted simpler integer numeric array references. But the subroutines for doing all the fancy "poking" were all still there for me to re-engineer back into place a routine for poking the memory into a string space using VARPTR command (to find the appropriate locations in that space).

Eventually I got the program pared down (removing spaces, creating long multi-command lines, etc) to work in a standard 20K of the MC-10 with RAM pack. I even had enough space left over to create a simple "castle" graphic to wrap around the presentation of the grid map. The parring down also helped with the speed of set-up for the map layout, which was quite long.  Here are videos of the first version and the final product. Notice the difference in the length of time for setup:

Having completed this conversion of a classic program to the MC-10 I went in search of another kind of classic game program that I have wanted for some time to add to my collection-- a "Space Trader" type game. I had been aware of a version of such called "Star Lanes" for a while, but I wasn't overly enthused by its "corporate" theme (company creation and share buying and trading). So it was a pleasant surprise to discover that the original granddaddy of such games, called "Star Trader" by Dave Kaufman, was less corporate in character, and more in keeping with the spirit of Issac Asimov's "Foundation" series of novels-- with its developed Galactic core planets, and wilder less developed frontier planets.

The only problem with getting a version of this program up and running was that there seemed to be nothing on the Net regarding running versions. The original source I was able to find was for some kind of DEC minicomputer (HP Basic?). It came in two parts that were run in a "CHAINed" fashion. The first set up basic parameters and variables, which were left in memory when the second program was loaded by the CHAIN command. The source also mentioned "loading the tape into the tape reader" (tape reel? paper tape?) as a means of saving and loading games in progress. Yikes! I could find some tantalizing screen shots of an Atari 8-bit Basic version by someone who had a tribute page for the program, but that page now existed only in "archived" format on the "way-back machine." Most of the links were broken, and I could find no reference to the program in any of the Atari software archives that I searched. So I had to work from the original source helpfully provided by a tribute webpage to the multiplayer on-line "Trade Wars" games that descended from the original program by Kaufman.

When I finally got the two programs merged and running and most of the bugs worked out, I noticed that there seemed to be something wrong with the economies of the various star systems. They did not seem to develop or change their demand for products in the way I expected. However, after combing my source for possible errors introduced during porting, I could find nothing that would explain the weird behaviour of their economies. I began to suspect that there was simply something wrong with the data used to define the subroutine calculating the productivity for each system. It seemed skewed towards high production of goods, which resulted in very low demand for new goods. So I went in search of the original publication of Kaufman's program.

Apparently the game originally appeared in the People's Computer Company (PCC) newsletter (later magazine) and latter in a book compilation What to Do After You Hit Return. I was able to get a PDF from the Net of the book, and sure enough when I looked at the DATA statements for the "econometric" data, it was different from the data listed in the on-line source code from the Trade Wars tribute site. Swapping in the data from the scan seemed to solve the problem--a fun little piece of retro-programming archaeology! I don't know why the values were changed (transcription error from the scan, weird considerations of a networked version?), but now there is a working version of the program for people out there to try. It includes a save to cassette tape feature, as opposed to (possibly) save to tape reel or paper tape. Here's a vid:
Rogers Cadenhead, one of the many commentator's on the Star Trader and its influence, discussed its history with David Ahl to get his perspective on the game. The following is a quote of Ahl's response:
As far as I know, the game Star Traders originally appeared in People's Computer Company (a newspaper/magazine) published by P.C.C. (an alternative education computer center) in Menlo Park, CA. (It's a bit confusing that the physical storefront computer center and the newspaper both had the same name.) The game also appeared in What to Do After You Hit Return subtitled "PCC's first book of computer games." PCC was a rather egalitarian organization, hence credit was only rarely given to the authors of the various games they published and there is no author credit affixed to Star Traders. So it could have been written by any one of the 40-50 people cited in the acknowledgements of the book. The game, written in "standard" HP Basic, is a monster and, unusual for the time (1973) has both a set-up module and a main playing module. Also unusual for the time, it had the capability of saving the playing data (1) from one session to the next and (2) for different users who logged onto other nodes of the timesharing system. It was this that allowed it to be a multi-player game with games often lasting a matter of weeks or months. The book had some interesting suggestions and ideas for extending and modifying the game to make it more interesting and longer lasting; I believe that over the years many (or most) of these have been implemented.
I can understand how on a timesharing system you could easily have rigged up an ad-hoc way to make the game one of the first multiplayer net-based games (tape reels or paper taps must have been replaced by electronic files at some point). You can save all the main game variables at the end of any round of trading at the prompt for picking your next planet to visit (i.e at the end of your turn). Early players could have organized games with other players on a system. All you would have to do is send the game data file to the other players or save it in publicly open file space. Then the next player could load the data file and continue with their turn and then re-save and so on for each player (it can handle up to 12). The only problem is that in the version of the code as I found it, when you re-load the data, the first thing the program asks for is the choice of next planet for the last player, since that player would have typed 'save' at the prompt instead of their choice. Either people modified the game so each player could enter the choice before saving the game data, or ad hoc solutions were worked out, such as sending a message mentioning one's desired choice to the next player. In fact simply sending a message with a planet name might have been the way players let other players know the file was available and it was their turn. Then they could simply enter it and continue with their own turn.

It's funny but similar systems could easily be worked out today for people wanting to play the game on the Web for "1970's" experience of early network multiplayer gaming. Just fire up the virtual MC-10 and save your game data "STRADATA.C10" file (the emulator will create this for you when you save) to Yahoo public file space or e-mail to a friend. Then text your opponent the name of your desired planet. They can download the file and load it up into the VMC10 on their computer running the game. A little clunky perhaps, but it would give you a feel for early network computer gaming.

Recently, I created a Google files site for all my MC-10 programs, including STARTRAD.C10, which contains WAV sound file versions of the programs. These sound files can simply be played with your original MC-10 plugged into the sound-out jack of your PC. I find a half volume setting seems to work best and make sure to turn of any "noise reduction" features in your player software. Of course, they can also be obtained as .C10 emulator files in my MC-10 zip compilation, which includes Tamer's great Virtual MC-10 emulator (VMC10.exe).

Monday, 22 May 2017

Galaxy Trek Adventure #1

Galaxy Adventure #1
I have already ported Howard Batie's second Star Trek themed text adventures for the Coco to the MC-10. The Coco program for his first adventure, which can be found in Hot Coco Magazine August 1983, was based on an original game for the TRS-80 16K by Randy Hawkins in 80 Micro (August 1982, pp. 174-184). In fact, the version I ported might be more akin to Mr. Hawkins' original, as I based it on some source code that I found for the TRS-80 Model 100, which might have come from the Model I version rather than the Coco version.  However, the fact that Batie's name is on it leads me to believe that it must be from the Coco version. I have source for the Hot Coco magazine version, but it's from OCR text of a scan of the article, and it was getting very tedious trying to get it into running form, so I switched to the source for the TRS-80 Model 100. I might still plunk away at the original magazine source, because Mr. Batie suggests in the article that there are some differences between his version and the TRS-80 Model I version, which might be nice to uncover. Also, the magazine version uses the technique of encoding all of the messages, so you can't cheat by looking at the source code.

There were a number of errors in the Model 100 source. Some of these problems are outlined in a Gaming After 40 blog post. I found others and corrected them. There was a big problem with how the game handled the button pushing for the impulse engines, that essentially allowed you to correct the orbit without having to solve the puzzle. GamingAfter40 suggests that the way to get rid of the Klingon guarding the Tribble on level 2 is to get the phaser, but really it was because he pushed the button for the engines on level 1 and triggered the bug (which moves the guards to the planet). The real way to get rid of the guards is to shoot all of them with the phaser. The phaser only self-destructs on the planet after you've done all the necessary shooting on the ship. There were also problems with beaming routines, that allowed you to beam down without Spock being present, but which indicate that he is present by the messages displayed. There were also some problems with how the score was accumulated.

I have bug tested the program pretty extensively and played it to completion a number of times. Here's a play-through for those who may have been frustrated by the game in their youth.


** SPOILER ALERT **

G A L A X Y
A D V E N T U R E    # 1

COPYRIGHT 1982 HOWARD BATIE
HERNDON, VA 22070

NORTH,WEST,NORTH,DOWN,SOUTH,EAST,EAST,GET NEEDLE,WEST,WEST,NORTH,DOWN,SOUTH,WEST,NORTH,WEST,GET PHASER, GET COMMUNICATOR,EAST,SOUTH,EAST,EAST,FIRE PHASER,EAST,INJECT SPOCK,WEST,WEST,NORTH,UP,UP,SOUTH,WEST,FIRE PHASER,WEST,GET TRIBBLE,DROP NEEDLE,EAST,EAST,NORTH,DOWN,DOWN,DOWN,SOUTH,EAST (IGNORE SPOCK'S REMARK), EAST,THROW TRIBBLE,GET TRIBBLE,EAST,HELP,SAY TRISAETI,HELP,WEST,WEST,WEST,NORTH,UP,UP,SOUTH,EAST,NORTH,FIRE PHASER,EAST,GET MANUAL,WEST,SOUTH,WEST,NORTH,DOWN,DOWN,SOUTH,EAST,EAST,EAST,READ MANUAL,WEST,WEST,WEST,NORTH,UP,SOUTH,WEST,NORTH,WEST,GET SHUNT,EAST,SOUTH,EAST,NORTH,DOWN,SOUTH,EAST,EAST,EAST,INSTALL SHUNT (A GREEN PANEL LIGHT GLOWS...),WEST,SOUTH,READ MANUAL (NOTE: INSTALL CRYSTALS),NORTH,WEST,WEST,NORTH,UP,UP,UP,SOUTH,EAST,EAST,SAY ENERGIZE,FIRE PHASER,GET CRYSTALS,DROP PHASER,DROP TRIBBLE,DROP MANUAL,SAY ENERGIZE,WEST,WEST,WEST,WEST,GET TRIBBLE,EAST,EAST,NORTH,DOWN,DOWN,DOWN,SOUTH,EAST,EAST,SOUTH,INSTALL CRYSTAL (STARTS A COUNTDOWN),NORTH,WEST,WEST,NORTH,UP,UP,UP,UP,EAST,EAST,PRESS BUTTON (STABLE ORBIT ACHIEVED),WEST,WEST,DOWN,SOUTH,EAST,EAST,SAY ENERGIZE,GET PHASER,DROP COMMUNICATOR,EAST,NORTH,FIRE PHASER (PHASER VAPORIZED),NORTH,THROW TRIBBLE,EAST,WEST,SOUTH,SOUTH,WEST,GET COMMUNICATOR,SAY ENERGIZE

I also completed the clean up of two simple programs taken from OCR text of scans from Color Computer Magazine and Hot Coco Magazine. The first is a simple game called SPRINKS the second is a Mother's Day graphic and simple music demo called MOTHER:


Thursday, 11 May 2017

4 Mile Island Adventure: Update



4 Mile Island Adventure, not to be confused by another Basic adventure for a recent programming contest (in the 2000s) of the same name, was a text adventure made by Owls Nest Software for TRS-80 Color Computer and MC-10 in 1983. Ported the Coco version to MC-10. Made some changes in the save game routine. In addition to the object list of locations, it now also saves the following variables:
F,G,CF,TB,GB,CA (# of objects being carried), RT (reactor temperature), YO (present location), DO,NOT,DR,M
This means that you don't start fresh every time you save and re-load a game, which makes the game more challenging (as there is a countdown to meltdown).

Brief Outline:
The 'impossible' has happened! This area was devastated by a severe earthquake. The reactor has been severely damaged. The plant has been deserted. Only you can save the area from a major disaster! Your goal is to achieve a cold shutdown of the reactor at Four Mile Island. Alternative? Death!

Walkthrough:
S, E, E, S, S, LOOK DESK, UNLOCK DRAWER, OPEN DRAWER, LOOK, GET BADGE, DROP KEY, N, N, N, N, LOOK WALL, INSERT BADGE, LOOK, D, W, GET CROWBAR, GET WRENCH, E, U, S, E, LOOK FLOOR, MOVE TILE, LOOK, DROP CROWBAR, GET ID, W, N, N, N, D, GET SPANNER, U, S, S, E, N, PUSH BREAKER, N, PUSH BREAKER, S, S, W, S, E, DROP WRENCH, GET CROWBAR, W, N, E, OPEN VALVE, W, PUSH SWITCH, PUSH LEVER

Type CLOAD & hit ENTER. Select TOWER.​C10 in the JimG subdirectory of the Cassette directory. Type RUN...

Sunday, 30 April 2017

RetoChallange 2017: Graf Spee


Came across a neat game for the Sinclair ZX81. It's a World War II naval simulation. You play the role of the captain of the German battle cruiser the Admiral Graf Spee. You must destroy shipping and avoid being captured or destroyed. I have't got it working quite yet, but I have made substantial progress.  Here are some screens showing a little of what the game will look like.




 I still have to finish converting all the lowres graphics for all the ship types.

This is likely my last posting for RetroChallenge 2017. Thanks to John for organizing another competition for this year. Thanks to all the other posters. I'm still working through browsing all the projects. They are wonderful inspiration for further efforts in my own retrocomputing hobby activities. Good luck to everyone and I hope to see you all again next year!

P.S.

Here's a video of the completed game:

Monday, 24 April 2017

RetroChallenge 2017: 4 Mile Island Adventure



Found another obscure adventure in the TRS-80 Color Computer Archive. This one's called 4 Mile Island Adventure. It's loosely based on the 3-Mile Island nuclear disaster. Everyone has fled and it's up to you to cold-shutdown the reactor.

Couple of weird things about the adventure. First the save routine seems to just save the objects array. It doesn't appear to store anything else, such as your location, the reactor temp, radiation level or how many items you're carrying (although this may be generated when you take an inventory).  So when you restore, you seem to start off at the beginning location, but you have any items you found previously.  Since you are racing against the reactor temperature going up, it seems like you can reset the clock by saving.  Don't know if this is important or unimportant, but I might change it.

There is a link in the archive to the manual by Owls Nest software. I can't find a link to the game in the CASA: Solution Archive, although there is a listing for a program of the same name written for a recent text adventure contest.

Since there's no listing, I'm working on solving it.

Friday, 21 April 2017

Retro Challenge 2017: Greg Hassett Adventures

I have finished porting two Greg Hassett adventures. "Atlantis" was ported from a Coco version. It was very buggy and the screen formatting was very weird. It also lacked save and restore routines. So I had to go back to the TRS-80 16K version and put them back in based on what I found in that source code. I have played it through using a walkthrough, so I hope it is pretty much bug free now.


I also ported "Enchanted Island." I used source from TRS-80 16K source. Working on Atlantis had prepared me well for Hassett's programming style, so this conversion went very fast.


After completing these two adventures, I realized from internal advertising that Hassett displays in them that he had set of adventures.
59000 R1$="TRY SOME OTHER GREG HASSETT ADVENTURES: JOURNEY TO THE CENTER OF THE EARTH, THE HOUSE OF SEVEN GABLES"
59005 R2$="KING TUT'S TOMB, SORCERER'S CASTLE, VOYAGE TO ATLANTIS"
These messages get displayed at various occasions, such as when your character reads a newspaper, or at the end of the game. I realized that I had previously ported the others. So I went back and fixed them up to use a common visual aesthetic (eg. solid line demarcating main messages from input prompt). Now I have a set of six Hassett adventures:
  1. Voyage to Atlantis (ATLANTIS.C10)
  2. Sorcerer's Castle (SORCAST.C10)
  3. King Tut's Tomb (TUTSTOMB.C10)
  4. Enchanted Island (ENCHANTI.C10)
  5. The House of Seven Gables (GABLES.C10)
  6. Journey to the Centre of the Earth (JOURNEY.C10)

The House of Seven Gables

Journey to the Centre of the Earth

Sorcerer's Castle

Tut's Tomb with my own intro screen
They can all be found on my distro: http://faculty.cbu.ca/jgerrie/Home/JG_MC-10_GAMES.zip

Sunday, 16 April 2017

RetroChallenge 2017: Dr. Livingston Adventure


I noticed a BASIC adventure "Dr. Livingston: The Search For" listed on Curtis Boyle's site. I have searched through many Coco archives, but I couldn't recall every seeing a copy of this game. I also found a listing for it under Gaming after 40 blog. It sounded like an interesting game, that was having a little fun with the famous story of the search for Dr. Livingston, who disappeared into the heart of Africa in the early period of European contact with that continent.

I also found a listing for it under the Interactive Fiction Database. The reviews were't very good, but I think this was because most people had played an unofficial version of it for the Commodore 64 that was a little buggy. Here's what I said for a review I wrote for the the database:
I have read the other reviews and can't but wonder whether some of the frustrations result from the versions they are playing. The parser is not so problematic in the TRS-80 versions of the program. These machines often ran in all caps mode (the original TRS-80 didn't have uppercase characters and the TRS-80 MC-10 never had them). Apparently there were also changes made to the puzzles in many of the unofficial versions. The TRS-80 version I ported remains entirely true to the original TRS-80 16K version.

There are some intentional inconsistencies to the movement in the game. I didn't find them all that bad (especially compared to some other games from the era). For the most part I think they were carefully chosen and meant to enhance the effect of being "lost in the jungles and savannas" of central Africa. To a large extent, I think this technique works successfully in this adventure, where the setting makes it appropriate to use. Once I had some mapping in place, it wasn't all that problematic and there is a kind of logic to the backs-and-forths.

There are some really charming aspects to the game. The quicksand graphic is a wonderful piece of TRS-80 chunky pixel 8-bit animation. If you die the program simulates a return to the basic command prompt, before surprising you with a resurrection to a restore point part way into the game (preventing a need for a complete restart).

The game is challenging and doesn't have any of the totally arbitrary deaths that are so common in games from this genera. I found the plot to be a nice balance between slightly humorous almost fantastical whimsy and an attempt to remain true to the Victorian mythology of the original quest for Dr. Livingston.

For fans of 8-bit Basic adventuring I would highly recommend this game. But for less hardy souls, it might be better to stay away from venturing into the dark heart of the Victorian imaginary.
I had asked if Curtis could put his hand on his copy, but it sounds like he's buried under a pile of original disks. He said he'd keep his eyes peeled. In the meantime, I put my hands on the original TRS-80 version of the source code and over Good Friday and this Easter Weekend I plunked away at converting it to Micro Color Basic. I don't think I have ever come across so many convoluted long IF-ELSEIF lines before. Some took a number of different stabs at it before I got them right. The really fun part was re-creating the graphic for the jumping character animation.

I ran into some snags at the end in the form of some strange behaviour with FOR/NEXT loops.  I think this might have been a result of the fact that like a lot of early programmers the author of this game use a lot of FOR/NEXT loops for searches which they exit ungracefully from the middle of using a GOTO statement when they find what they're looking for.  I always try to properly finish a FOR/NEXT.  Anyway, I fixed a few of these and started using my own variable for my additions to the program to avoid conflicts with the FOR/NEXT variables used in the original.  Another, difficulty with porting was the use in the original TRS-80 16K version of IF structures like this:

IF A<B GOTO 10
or
IF A>B LET A=0

It's possible in original TRS-80 Basic to dispense with the THEN command.  In Micro Color BASIC this can only be done using the GOTO command. Others, like LET don't work.  Had to weed all these out.  Also the programmers had used DEFSTR to define a bunch of character string variables without dollar signs, another feature missing from Micro Color Basic. I think it is fully debugged now.  I have played it through to its end a number of times and in a number of ways.  Here's a vid of LIVNGSTN.C10. At the end of it you can see the effect of the fake "exit to Basic prompt" before it revives you to a restore point.  Very clever little effect that demonstrates the care lavished on the game by its original programmers, Carl Russell, Karen Russell, Ralph Fullerton, Becky Fullerton. (published in Softside, Vol. 2. no 12):