Sunday, 19 January 2014

Homage to the Commodore Pet: Ouranos aka Weather War


Another source of good Basic programming ideas is the Commodore Pet.  One of the games I came across while researching the programs available for that classic 8-bit computer was "Ouranos" by Kathy Higby.  Here is one of the videos I viewed:


"Ouranos," the Greek weather god, is the official name of the program.  But most people seem to know it as "Weather War", or by its subtitle "Take the enemy by storm!"  It is a charming and unique variation on the "Duelling Cannons" theme.  I thought I might be able to port the program from Pet Basic, but I couldn't find any source code that I could easily lay my hands on.  On one of the videos the videographer tantilizingly breaks and lists the program and I thought perhaps I could obtain some insight into how it worked by capturing stills of the video.  This is the kind of thing I was able to obtain:

Unfortunately, the video only showed a partial listing and all the embedded control codes just intimidated the heck out of me.  Also, someone mentioned in their description of the game that Higby had to use a special machine language routine to get the flashing lightening effect, so I decided just to do a complete remake of the program myself.  I had to watch a bunch of videos to try to get the full gist of it, as well as read every description I could locate.  I think I've been able to recreate all the aspects of the program including the flashing lightening effect by way of the MC-10's POKE49151,64 and the Coco's SCREEN 0,1 command.  Here's a video of my son and his friend playing it:


One thing I changed was the title of the random weather event from "Act of Nature" to "Act of God," which seemed more appropriate to me since the latter is how my insurance policy refers to such events.  If anyone who has played the original could let me know if I've left anything important out I would really appreciate it.  I've now ported it to the Coco (JGGAMES.zip) and Dragon 32/64 (archive.worldofdragon.org).

Saturday, 18 January 2014

"The High Mountains" Port from VZ-200 to MC-10, Coco and Dragon

The images to the right shows a screen shot from a unique text adventure made for the ZX Spectrum by Paul Braithwaite.  The game is called "The High Mountains."  It was based on John Christopher's Tripods trilogy.  This game allows up to five players to take the roles of the human resistance or the alien masters and their tripods. There are relatively few puzzles in this game, but a fairly large area to move around in and plenty of NPCs. Originally published as a type-in game for the ZX Spectrum in the British magazine Personal Computer News #79 there was also a VZ-200 version.

This game is very interesting because this is the only multi-player text adventure I've ever come across. Each player alternately gets a number of turns to explore the world of the game. You can choose to either be a baddie alien, in which case you go around trying to kill the humans, or a human character, in which case you have to collect various items and interpret various clues in order to figure out how to thwart the alien invaders. The game allows you to play alone, but the story and puzzles are fairly simple. I imagine the time pressure created by trying to complete your appointed tasks before the other players complete theirs must add a nice element to the challenge. The game wouldn't be much fun to play as just an alien alone.  It would simply be an exercise in moving until you run across all the human players and kill them. The combat seems somewhat random, although there are weapons that can be picked up at various locations in the game. I'm unsure how they affect combat. There might be opportunities as an alien character to interfere with the other player's ability to complete the game by seizing or moving objects. However, combat can make players drop things, if you are willing to risk possible death, so there are ways for human characters to win objects back. I am unsure if, when played with others, it is recommended that they not be allowed to view the screen, but I suspect this might be so (or an "option"). In that way, if you're an alien you can hide or move objects, and the other player will have a harder time finding them or knowing when they need to confront you to try to force you to drop them. If you're a human character, it would give you the opportunity to try to hide or use circuitous routes to get to objects unmolested. I suspect knowing the original book series would also add to game play (although I think names have been changed to protect the original author against a copyright challenge--for example the first book of the series is called "The White Mountains," not "The High Mountains").

I created a version of the program for the TRS-80 MC-10, which was ported from code for the VZ-200 version that I managed to get a copy of from Dave Maunder of the VZemu group on Yahoo, who found it on a German fan site (http://www.wolkenkratzerhaus.de/VZ/). The VZ-200 is a good source of porting code because it uses the same display chip as the MC-10 (and Coco and Dragon). In the course of porting the program I slightly condensed some of the descriptions and fixed some grammar and spelling errors.  I also noticed what I think is a catastrophic error in the VZ version, which allowed the non-playing characters to move completely off the "grid" of the map of locations--never to return!  This would effectively make the game unwinable for the alien characters as their job is, as Bender would say, "to kill all the humans."  If some can simply disappear completely, this becomes impossible.

I've also now completed a further port to the Coco 2/3 and Dragon.  I've added it to a compilation I am building of my coding projects for 2013. You can link to that compilation here.

I will be adding to this compilation disk JGGAMES6.DSK and perhaps a JGAMES7.DSK if I run out of space over the next month or so as part of the the Retrochallenge 2014

If anyone out there has played this game, especially the VZ200 version, I would really be interested in hearing about your experience.  The Dragon version as a cassette file for the XROAR emulator can be found here: archive.worldofdragon.org

Addendum: Erico Patricio Monteiro shared a link on the TRS-80 Color Computer Facebook group about another multiplayer text adventure called "Spooky Manor" for the BBC Micro. Up to 4 could play.

Saturday, 11 January 2014

The Pharaoh's Tomb

Last year I worked on a game called "Penguino" for the Retrospectiva 2012 Basic programming competition.  That game used a basic 4 X 4 character matrix for each of the "sprite" characters in the game.  In the case of Penguino this was 5 or 6 "Snow Bee" blobs and the main character.  I was able to get quite a bit of speed for the animation of all those characters and this got me thinking, perhaps, with a slightly smaller number of characters I could also include some animation of the characters themselves.  All I needed was a premise.  The main point of my retrocomuting hobby is to fill out the software complement of my favourite little orphan 8-bit micro, the TRS-80 MC-10, so I'm always thinking about the classic arcade games that I played as a kid.  One game I remembered playing was called Tut's Tomb, or Tutankahmen, or something like that.

It involves an archaeologist character loosely based on "Indiana Jones" venturing into an Egyptian tomb in search of treasure.  He has to avoid all the nasties that he meets there including bats and snakes and mummies.  The distinctive feature that I remember most about the game was that your character could only fire on the horizontal.  This meant the game required some strategy and timing when taking on the baddies.  I thought this might also simplify some of the problems of making a game in Basic, as I would only have to work out firing on the horizontal.  I had also made a Q-Bert game, in which I had included a snake character, so I thought it would be easy to make an animated snake.  I also had used a fly in my Frogger game, which with a little tweaking, would make a nice bat.
So I had my premise.  Now I just needed the code.  It took quite a bit of work to get the animation fast enough on the MC-10, but I think I have the workings of a game with an animated bat, snake and shuffling mummy.  Unlike Penguino, this game has 12 pre-made mazes.  Each maze presents different challenges.  To up the ante, there is a time limit as your "air" runs out. 

The Coco version (JGGAMES.zip) really flies with the double speed poke, although the Dragon version was a little sticky in its key input until Zephyr helped me out with a "speed keys" routine for that computer (archive.worldofdragon.org).  I have to admit that another inspiration for the game was seeing a game called "Pyramid" for the NEC PC-6001 32K.  I was exploring the NEC PC because it also uses the Motorola 6847 VDG graphic chip.  I was hoping to find inspiration for some games, or possibly even some code for porting.  One of the things I found was a YouTube video for Pyramid.

I also have made some other discoveries for programs to port to the MC-10 (and the Coco and Dragon). One of these is NukeWar.  Although I found graphic images for games, I found it impossible to get at the original code for the NEC PC version.  I just can't navigate the language barrier to get a working emulator, and no one is simply posting the code directly on-line.  However, once I saw the images, it did make me aware of games that could possibly be ported to the screen size of the MC-10.  One of these was the Avalon Hill simulation NukeWar, which I stumbled across a NEC PC image for.
Then I simply had to find a TRS-80 Model 1/3 version of the code.  The screen re-sizing work has been simplified because I have the NEC PC image to help me figure out how to do it.  Notice the Japanese characters being generated by the VDG.  The NEC PC takes advantage of the hardware character re-definition abilities of the chip, which, unfortunately, were not enabled in the MC-10, Coco or Dragon.  It's neat to learn about all these interconnections between machines from the early 1980's.  That's part of the charm of the retrocomputing hobby!

Saturday, 4 January 2014

The Treasure of Elgon Adventure By Keith Hawthorn (Walkthrough)



Walkthrough for the TRS-80 MC-10 and COCO and Dragon 32/64 Version
by Jim Gerrie
(Other's might be different)
WARNING: This Adventure may contain a Grue!



N
GET LADDER
S
DROP LADDER
CLIMB LADDER
JUMP
N
GO SHACK
W
GET GLASSES
WEAR GLASSES
E
E
GET HAMMER
W
S
GET PLANK
WITH HAMMER
DROP HAMMER
GET PLANK
GET AXE
S
CHOP TREE
GET APPLE
D
READ SIGN
N
GIVE APPLE
TO GRUE
GO TUNNEL
W
GET COIN
E
E
S
CLIMB LADDER
JUMP
S
PAY MERCHANT
GET SHOVEL
W
PUT PLANK
GO PLANK
S
JUMP
DIG
DROP SHOVEL
GET AMULET
N
SHOW AMULET
DROP AMULET
GET KEY
GO PLANK
E
N
E
GO POST
UNLOCK BOX
OPEN BOX
DROP KEY
PULL LEVER
S
GO DRAWBRIDGE
N
GET SWORD
E
GO STAIRS
W
GET ANKH
E
U
W
S
E
READ BOOK (NOTE WORD 'RACK' AND CLUE FROM SIGN IN FIRST ROOM LEADS TO THE SECRET WORD 'ACKRA')
GO PASSAGE
DROP GLASSES
GET SHIELD
N
W
W
W
S
W
GO PLANK
S
JUMP
W
INSERT ANKH
SAY ACKRA
GO CRAWLWAY
SHARPEN AXE
S
E
JUMP
N
GO PLANK
E
N
E
GO DRAWBRIDGE
S
CHOP CLOSET
GO CLOSET
DROP AXE
W
N
W
W
D
GO TUNNEL
W
W
SAW PADLOCK
OPEN DOOR
GO DOOR
E
MOVE CHEST
GO HOLE
GET TREASURE

Wednesday, 25 December 2013

Friday, 13 December 2013

Retrochallenge Winter Warmup Project

Mahjong

Well here are my plans for a Retochallenge Winter Warmup project and my New Year's resolution.  I'm going to finish up the following Basic programming projects I've been working on for the TRS-80 MC-10 and then port them to Coco and Dragon formats:

1. NightBlitz
2. Flipull worldofdragon.org and JGGAMES8.DSK
4. Ouranos worldofdragon.org and JGGAMES6.DSK
5. Great worldofdragon.org and JGGAMES6.DSK
6. Tomb worldofdragon.org and JGGAMES6.DSK
7. Aststorm worldofdragon.org and JGGAMES6.DSK
8. Fesquest worldofdragon.org and JGGAMES5.DSK
10. Defcon1 worldofdragon.org and JGGAMES2.DSK
11. Qbert worldofdragon.org and JGGAMES2.DSK
12. Invader worldofdragon.org and JGGAMES2.DSK
13. Mahjong worldofdragon.org and JGGAMES2.DSK
14. Rover worldofdragon.org and JGGAMES2.DSK

I'll also be adding a number classic Basic games to my Coco and Dragon software collections that I originally ported to the MC-10 from other systems:

Hustle (TRS-80 Model 1/3) worldofdragon.org and JGGAMES8.DSK
MoonFX (PC) worldofdragon.org and JGGAMES6.DSK
3DLaby (VZ-200) worldofdragon.org and JGGAMES9.DSK
Mountain (Spectrum) worldofdragon.org and JGGAMES7.DSK
Elgon (TRS-80 TRS-80 Model 1/3) worldofdragon.org and JGGAMES7.DSK
UncleTay's House Adventure (Apple JSBasic github.com) worldofdragon.org and JGGAMES9.DSK
Mansion (TRS-80 Model 1/3) worldofdragon.org and JGGAMES7.DSK
DND (TRS-80 Model 1/3) worldofdragon.org and JGGAMES7.DSK
IceWar (TRS-80 Model 1/3) worldofdragon.org and JGGAMES7.DSK
Swarms (PDP-11) worldofdragon.org and JGGAMES9.DSK
Roulette (Sol-20) worldofdragon.org and JGGAMES6.DSK
Nukewar (TRS-80,Apple,Atari) worldofdragon.org and JGGAMES6.DSK
Lostgold (TRS-80 Model 1/3,PC) worldofdragon.org and JGGAMES7.DSK
Snake (Nec PC8201a) worldofdragon.org and JGGAMES9.DSK
Uboat (PC) worldofdragon.org and JGGAMES9.DSK
CIA (TRS-80 Model 1/3) worldofdragon.org and JGGAMES7.DSK
Gables (TRS-80 Model 1/3) worldofdragon.org and JGGAMES9.DSK
Bulls (TRS-80 Model 1/3) worldofdragon.org and JGGAMES8.DSK
Draughts (Alice) worldofdragon.org and JGGAMES8.DSK
Tholian (TRS-80 Model 1/3) worldofdragon.org and JGGAMES7.DSK
Dominoes (TRS-80) worldofdragon.org and JGGAMES6.DSK
Andromed (PC) worldofdragon.org and JGGAMES5.DSK
Switch (Atari ST) worldofdragon.org and JGGAMES5.DSK
Engineer (TRS-80 Model 1/3) archive.worldofdragon.org and JGGAMES5.DSK

Monday, 13 May 2013

"Fest Quest:" Pit With Monsters By Jim Ennes Becomes Something New

Allen Huffman, the videographer and Fest reporter for Glenside Color Computer Club's Annual Last Coco Fest contacted me after the "last" Chicago Coco Fest to see if I might be interested in programming a game based on a Fest motif.  He had seen my port of Pitman and thought that I might be able to create a similar puzzle/adventure game, but somehow using Fest locations  He thought it could possibly be used as fundraiser for Glenside or perhaps to help promote next year's event.  I started thinking about the project, but in the meantime I had been working on another port of a classic game from the ZX81 called "Pit with Monsters" or PM for short.  In this game you are presented with three panels representing left, forward and right, each containing a brief description of a what you see in those directions (see above).  You choose which direction to go based on what you see there and each of the various kinds of structures (passageway, room, door, stairs up, stairs down) has different attributes that influence their optimal navigation (up and out of the pit).  Also you run into a range of monsters (1-100) with varying strengths that you must take account of when you choose to fight them.  You can fight monsters using your strength and weapons, which are all represented by your "hit points," or with magic using your "magic points."  You can find various items throughout the pit that can add to your supply of these different kinds of points.  You can also choose to retreat, but this option has its own dangers.  It is a very simple game in its elements, but they all combine to create a game that is actually quite complex and interesting to play.

The port of the code from the ZX81 went quite well.  The two machines share a 32 column screen, which makes things a little easier.  ZX81 Basic is a little unique, but not overly weird.  The primary difficulty is dealing with the fact that the ZX81 has 24 rows of text, so messages have to be shortened or blank lines removed to fit information into the 16 rows of the MC-10.  This was somewhat simple for PM because many of the messages used double spacing, which could simply be removed (or replaced by the use of my handy word wrap routine for printing messages).  Other than that, it was just a question of removing redundant code, such as repeated IF statements that do the same test but only one operation per IF.  Instead I just use colons.  I suspect that the lack of colons in the source indicates that the ZX81 doesn't allow multiple commands per line.  To save space I pulled together many such lines into single lines of code containing multiple commands separated by colons.  As sometimes happens since I have a "word-processor-eye" view of the code it is easier for me to spot mistakes or minor oddities in the operation of the program that probably eluded the original programmer simply because they were stuck with the clunky line editor and the awkward LIST command.  Once again I came to appreciate EmuCompBoy's VMC emulator with its quicktype of text files saved from WordPad.  A quick change to the source in Wordpad, then type NEW and Enter and then quicktype in the new source code.  Then type RUN and see the results.  Takes about 10 seconds.

As I did the conversion it struck me that it might be nice to use some simple VDG graphics for the three panels, then it struck me that instead of just doing that, I could perhaps simply nudge PM into a slightly different story premise based on the Fest motif instead of monsters in a dungeon.  As usual, I sat down with my son Charlie and we quickly settled on a "battle with geeks" theme.  Instead of "hit points" we would use "geek cred".  Instead of "magic" we would use "floppy trading".  The items would come from the Coco Fests as would the "monsters" aka "geeks", who would, like in the original, come in a range (1-100) of power when it came to their geek cred.  Here are some screen shots of the new game:
I based the various geeks on names mentioned in Glenside newsletters over the years (more mentions roughy higher in the list) and some classic names from Color Computer magazines for the most powerful geeks.

Finally I thought it might be nice to add a trivia component to the game, that would celebrate Coco lore and act as another way of judging the "geek cred" of the player.  I asked people on the Yahoo forums to send me multiple choice questions and a few did, such as Allen, John Mark Mobley and some others.

Allen Huffman Wrote regarding this aspect of the game:
I was actually thinking more about memory usage. I created a simple word tokenizer in C for my day job when I was out of room in a small project, and I think it could be used on the CoCo as well. I wrote a test version in BASIC via Xroar yesterday, and will finish it up and make it available in case it is of interest to you.

Basically, it will scan thought all the strings (from a text file, or from data statements) and then create a dictionary of words, and tokenized strings. I have a method that will be ultra efficient, but not human readable (it would be legal BASIC, but not something you could LIST or type in), and another one that is not quite as efficient but completely typeable.

For instance, it might look like this:

1000 REM Token dictionary
1005 DATA 8,bacon,eggs,and,really,like,i,pancakes,too

Above, that might represent an 8 word dictionary. Then the strings would be encoded and might look like this:

2000 REM Tokenized strings
2005 DATA "FDEACD"

Assume "A" is 0, etc. So that represents those full words. This is a simple example, limited to the number of single characters you could put in a string. If I built those strings mechanically, I could use non-typeable characters and get maybe 128 tokens. But, a decent compromise is to use two characters. Instead of using numbers, which take more BASIC space:

2000 DATA 2,42,3,25,5,1,23,51
It is our shared hope that over this coming year we can add a much larger library of questions than the current 40 (please still send me any you think of), which will likely require integrating something like Allen's tokenization routine.  Unfortunately, this will likely only be available on the Coco version of the program and not the MC-10.

There are several aspects to game play beyond the trivia component. These are a legacy of PM. The object is to explore and gather the right kind of items that will increase your geek cred. Other kinds of items add to your “floppy” supply.  One must learn to recognize the differences between these two kinds of item. The opponents have different levels of geek cred (1-100). If you run into an opponent who has more geek cred than you, they will defeat you. If you have more geek cred than them, then you will defeat them, but you “use up” geek cred to do so (i.e. the amount of geek cred of your opponent is subtracted from your geek cred). So you must sometimes avoid such combat by using floppy trading (at least as long as your “disks” hold out) to overcome more powerful opponents. However, I added the trivia question component as a randomly occurring “save” feature (you only get asked a question half the time when geek combat occurs). If you meet up with someone with higher geek cred and you answer the question correctly, then you beat them no matter how much cred they have, but just barely, so your cred goes to 0.   If you meet someone with higher cred, but flub the question, then you lose.  But if you meet someone with lower cred and get asked a trivia question, but flub the question, then your geek cred goes to 0.   If you battle someone with lower cred, and get the question, you beat them in the usual way (your cred is reduced by the # of their cred).

So, in brief, navigating to the top floor takes a bunch of strategies. You need to collect floppy trading stuff (or equivalents, such as the coco CD or drive-wire cables). You also need to collect other items, which increase geek cred (manuals & cool hardware). You need to avoid combat with people with higher cred unless you feel you have enough floppies for floppy trading  to defeat them, or you are confident enough that your trivia knowledge can save you in geek combat no matter what their cred. You also have to try to keep building up cred and floppy supplies, so sometimes careful exploration of rooms (and strategic retreats) can be more prudent than simply trying to move forward and upward via passages stairs and combat. Use the “s” option to see the status of your cred and floppy supplies at any “what direction” prompt. I should also mention the “q” can be used to start the game over.

There are also some completely random elements of the game that can knock you back down a few levels (the object of the game now is to get to floor 20 of the hotel where the "no minimum bid auction" is going on).  A geek squad can abduct you, or you can accidentally wander into a elevator.  These events add a kind of "snakes and ladders" element to the game.

I will probably post the 40 question MC-10 version soon.  I will hopefully be followed next year with a more full-blown trivia Coco version.  Whichever version you might try, I hope you enjoy "Fest Quest."