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. 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).

No comments:

Post a Comment