Saturday, 28 March 2020

RetoChallenge April 2020: The Devil's Whist

Bit of an early start to the the RetroChallenge Retry proposed by Mr. Sherman, but I have added to my JGGAME14.DSK in my Coco distro the program "Devil's Whist" from the Australian Coco magazine December 1986. It is a two player variation of the game Whist, which is itself a simplification of contract Bridge. One of the players is the computer. Bob Delbourgo has created what seems to be a pretty adept AI to play against.


Since the MC-10 and Coco video MC6847 video chip lacks any native characters for the card suits the author uses colours to represent the four suits instead. However, one of these colours is green, which creates problems in terms of contrast with the regular green screen background.  I think in the original program, the author switches the screen to the alternate orange color set in order to provide this contrast.  However, since the MC-10 can't display this alternate color when any sounds are played, I modified the program to use a black screen for the areas where the card hands are displayed.  However, in the main info display there was still a need to contrast the green suit, so I switch that suit to being not just the colour green but the diamond/asterix character.  So at least there is one of the more traditional card suits being used.


There are lots of nice sounds used in the program. Since they used the PLAY command, I translated them to use my special subroutine to play lists of notes from such commands, but using the regular SOUND command of standard Micro Color Basic. So not only will this program now run on an MC-10, it can also be used by 16K Color computers with only Color Basic. I have also created a version for the Dragon and added it to my Dragon Distro: https://drive.google.com/open?id=0B7oFL_dNqgh9OUZFeklURW9DNTQ

I also use a slightly modified version of my standard reverse video routine. This one uses AND 64 to select the correct character for polking to get proper reverse characters. Don't know if it is any faster, although the routine is one character shorter in length, but I think it might be. I should run some benchmarks to find out.

The program also replaces the instances where changes are made to character strings using the MID$ function. The MC-10 does not support the ability to use MID$ to "splice in" new character sequences into existing strings. So although Micor Color Basic can support using MID$ to "cut" a selected part out of a string like this:

10 S$=MID$("***JIM***",4,3)

which will result in S$ containing "JIM," the following cannot be done:

10 A$="***   ***"
20 MID$(A$,4,3)="JIM"
30 PRINT A$

which will result in the output "***JIM***." Instead, I had to using a special subroutine that allows strings to be poked into existing strings, which recreates this functionality built into Extended Color Basic. This  subroutine uses the VARPTR function to determine where a string is stored in memory in order to poke the new characters into that string. It probably slows things up a little, but I have used all my techniques for increasing execution speed, which hopefully means the program does not run much slower than the original. Still there is a little delay while cards are shuffled (about 10 seconds) and sorted. That's just part of the charm of such old 8-bit Basic programs that we were willing to live with. Back in the early 80s we were just impressed that the computer could be turned into any kind of "artificially intelligent" opponent for games. They were pretty heady days. We were even willing to manually type-in programs to see such capabilities demonstrated, which I had to do today as well, since the scan was not clear enough to even bother trying to use OCR.

So my thanks go out to Bob and his nifty little computer AI driven game.


P.S. There were some corrections and improvements presented by the author in a followup edition of the Australian Coco magazine (Feb 1987), page. 41. I integrated them into the program. Now the program makes sure you follow suit if possible (i.e. now you can't cheat). Again, I had to use a special subroutine (lines 8 and 9) to recreate the INSTR function used in the update because that function is not available in Micro Color Basic for TRS-80 MC-10.


Saturday, 21 March 2020

Some New Text Adventure Ports for Coco and Dragon

Inspired by the spirit of the CocoChallenge suggested by John Linville for this year's now cancelled CocoFest I have created Coco and Dragon versions of the following text adventures: Dogstar, The Time Machine (translated from Dutch), Night of the Vampire Bunnies (by Jason Dyer), and The Mystery of Flagstone Manor (one of the First Australian text adventures). Also included on the JGGAME14.DSK in my Coco distro is a bonus program "Mindbusters" from Compute! Magazine April 85.

Time Machine
The Dogstar Mission - Lance Micklus
Flagstone Manor
Night of the Vampire Bunnies

The Compute! program is an interesting puzzle game.  The program is very simple, but elegant.  I have seen images for it for many years on the Net as I have scoured for Basic code. Finally, I decided to make a version for the MC-10, Coco and Dragon. The graphic characters are a little different, but I hope the game play is much like the original.


Translating the BASICODE program "De Tijdmachine" to English English was not as hard as other efforts I have made at translating text adventures from other languages, such as the Hungarian A Hös Lovag. Dutch translates in a pretty straightforwardl way into English. Still, there were, as always, a few idiomatic phrases that Google couldn't translate that I had to figure out.

It was interesting finding out about the BASICODE standard, which was used to create programs and then to broadcast them using radio signals for distribution. Gareth Pitchford sent me a link to a neat page with a UK perspective on BASICODE: https://nosher.net/archives/computers/comm_008-acorn. And another one with the Dutch perspective on this interesting early attempt at a universal inter-computer information exchange format: https://www.hobbyscoop.nl/the-history-of-basicode/?fbclid=IwAR2jXPPZQDNev_C5f7Z3XCgxzmIJEyAGa_QgdgrMNathRdNbLD5M0ga4ikk.  Unfortunately, I had to strip out all the extra (unused) subroutines at the beginning of the program that were part of this standard. I also had to renumber the lines to save space, which also disrupted the standard, since it had specially assigned ranges of line number for putting its subroutines, and other standard parts of  programs.

I have played the games through using walkthroughs, so they should be bug free. That being said, Miyagami Noriko from the Coco Facebook group played through Dogstar and discovered that the misspelled word "HEROS" appeared in the win message, which I have now corrected. She pointed out that this misspelling was in the original Softside magazine source and that I had corrected the "Hamberger" spelling mistake that could also be found in that source. She also pointed out a missing message about the Graffiti in the Bathroom. So thanks to Miyagami for her feedback.

Hope everyone is doing well in the face of Covid-19. Perhaps these programs will help folks while away some of the hours as we all try to do our part.

The program can be found here:

On JGGAMES14.DSK of my Coco compilation:
https://drive.google.com/open?id=0B7oFL ... TN0a2Q1bGc

TIMEMACH.CAS, DOGSTAR.CAS, BUNNY.CAS, and FLAGSTON.CAS are on my Dragon Compilation:
https://drive.google.com/open?id=0B7oFL ... klURW9DNTQ

Sunday, 15 March 2020

Type-in Mania 2020 Awards


The contest rules are as follows:

The player who can achieve and post (screenshot or video) evidence of the highest score in a public forum by April 19th earned playing my Basic game MINER will win a "Type-in Mania 2020" trophy that I will send to them.

Manic Miner

A second trophy will be awarded to the first person to complete my Basic game ADVENTR by retrieving the chalice and taking it to the Yellow Castle on the highest level (1-3), and also having retrieved the micro dot and used it (dropped it) in the correct location to reveal the secret entrance to a secret room. They must record evidence of the message that can be found in the secret room and their winning screen (screenshots or video) posted on a public forum (Coco Facebook, MC-10 Facebook, Youtube, etc.) before the end of April 19th 2020.

Atari Adventure in Basic
Last year the award went to George Phillips for achieving high score on my game Dam Busters.  His  score earned him a Distinguished Flying Cross and a Victoria Cross!

George's Win

Victoria Cross















If people have suggestions for alternative original games of mine they would prefer to play for high score for this year's Type-in Mania awards, let me know. I will consider  possibly adding a 3rd trophy. Or perhaps I will simply get some specialty mugs made. Feel free to arrange online game playing sessions in any forum that might get arranged for a "virtual CocoFest" or sessions at any time between now and the deadline. You can contact me at jimUNDERSCOREgerrieATns.sympatico.ca to let me know.

My games can be played using Mike Tinnes' online Javascript MC-10 Emulator or Tamer's VMC10 emulator by download. To play the game online click the following"Play" button and then select the "Play Our Original Micro Color Basic Games" link and select the filename (MINER or ADVENTR) from the Cassette menu. Then type RUN and hit Enter. You don't need to type CLOAD. Or choose the "Download" link to download a zip with the VMC10 Emulator. The two .C10 tape files can be found in the JimG directory of the Cassette directory.  In VMC10 you will need to type CLOAD to load these .C10 files.




The games can also be played using Coco by downloading the following compilation of my virtual coco disks. The latest versions of MINER and ADVENTR (with some updates from last year) can be found on the JGGAMES12.DSK:
https://drive.google.com/open?id=0B7oFL_dNqgh9QVNGRTN0a2Q1bGc



They are also available for Dragon 32 as .CAS files:
https://drive.google.com/open?id=0B7oFL_dNqgh9OUZFeklURW9DNTQ

These can be played online using XROAR here:
http://www.6809.org.uk/xroar/online/

Sunday, 23 February 2020

2020 Basic 10-Liner Entries and Asimov Awards

Asimov Awards Entries

It's that time of the year when I turn my attention to converting some of my MC-10 BASIC programs into Coco and Dragon 32 programs. Diego Barizo has added some impetus for this task by way of his 2020 Asimov Awards. In past years he has held the contest at the Chicago Annual Last CocoFest. I hope someday to be able to attend a Fest. Until then, sending my programs to Diego will have to suffice. It's a little bit of virtual participation.

This year I have collected together some programs I have been working on most recently on the MC-10. All of them were in somewhat unfinished states. My puzzle game SolChess is based on a popular smartphone puzzle game and also real chess board game, "Chess Solitaire."  Here's the board game:

It's a lovely little game. My version has 40 of the standard puzzles. However, the game was completely silent and I had always planned to have some musical refrains for success and failure. So when my son Charlie came home for his midterm study break I availed myself of his musical skills.  He put together two Russian tunes, since that country seems especially connected to Chess.


For a lark I also translated a brief little joke quiz game with silly MC-10 questions. It's called "QuizNite" and the graphic of the title screen is borrowed from a similar image from some kind of activity in honour of the Dragon 32 held in the UK. The approach to getting the questions right is to look for the answers that are the most unlike the others, most silly, downright false, or some combination thereof. Only the true masters of MC-10 will succeed first time.


The other entries are arcade games. My Space Mouse game was inspired by a classic arcade game for the Japanese 8-bit NEC PC-6001. As I have investigated that game further I realized that the premise of the game is that you are supposed to be a cat climbing a tower infested by invading space mice. I must have interpreted some Google translated Japanese website info incorrectly (perhaps the use of the singular "mouse" in the translated title confused me into thinking a mouse was the central character). In my version, you are the mouse and you are climbing a launch tower in order to stow away on the rocket before it launches.  You must avoid the dangerous objects rolling down the power, which have been shaken loose by the pre-launch vibrations.

If you complete 20 screens you are rewarded with an nice animation of the rocket blasting off and disappearing off the top of the screen. My son Charlie got it after a couple of false starts, so I know it all works.  I was never good enough to successfully complete my own game on a full 20 stages.  After 10 stages a tone will sound and the maze will get a little tougher, with only two exists, instead of 3, for movement between each floor.


Another game is also from Japan. Manbiki Shounen or "Shoplifting boy" is a classic early Japanese BASIC game, which has been described as the first example of a "stealth game."  I had left this game a little unfinished. I needed to work out a better way to hide the bottom of the characters as they passed behind the shelves of the store in which all the action takes place. I needed to do this because unlike the NEC PC the coco and MC-10 don't have an extended character set for the MC-6847 VDG with line graphic characters. To get proper "legs" and "feet" I had to use the regular SG4 graphics, which required two lines to work, instead of one as in the original. I finally got this fixed up and also translated it to Coco Basic.

I also translated my version of "Elevator Action," a classic arcade cabinet game. Mine is a bit of a flicker-fest. The action is frenetic and there are some tricks that need to be mastered to avoid death, but with some persistence you can become the 007 of Coco Basic games. If you complete a number of buildings, you will be rewarded with a special message in honour of CocoFest. But I doubt if there are many with the fortitude to persist against the annoyances inherent to Basic arcade gaming. But if anyone does and can prove that they have done so. I will happily send them a trophy.

Another original game initiated this year was "Alpha Force." This was a development of a failed game called "Square Force."  Square Force was simply too slow. I figured out a better way to have the enemies track the player's character in a simple grid layout.  I took advantage of every possible way to reduce processing in the main loop. Finally, Charlie made some suggestions about adding some additional challenges, so now you must also collect randomly distributed plus signs for 10 points each. Every 100 points will earn you an extra life.  Since the shots move simultaneously as you and enemies move, there are times when your shots will skip hitting an oncoming enemy. There's no way to avoid this without a serious speed penalty, at least that I can figure out, so it is just a deficiency the player will have to work around in his or her play. Sometimes munitions fail, just like in real life!  But at least now you can win extra life back, so you can possibly go on forever.  But the enemies will also slowly get a little more ruthless in tracking you.

The collection is rounded out by my Christmas 2019 mini game "SANTA", which started as a simple animation of Saint Nick flying over house tops. However, it now involves a "reflex" gift dropping challenge. You will receive an assessment of your performance. Only the very best will be awarded the coveted "Super Santa" rating.

Finally, I included my most recent version of my port of Akalabeth from MCX Basic. I found an error while testing the Coco version as I prepared JGGAMES13.DSK. So if you have a version from my prior distribution of this program on JGGAMES12.DSK, replace it with this one.  The newest version of my JGGAMES.ZIP containing JGGAMES13.DSK is where I have now put all my work from 2019.

BASIC 10-Liner Entries

My entries for the BASIC 10-Liner Contest are as follows: SANTA, which is just the same as the Coco game above, but condensed; AINVADER, which is an extremely simple Space Invaders type game using string manipulation to move the invading force; and OUTHOUSE.


Outhouse was inspired by the wonderful artwork of Erico Patricio Monteiro using a SG4 64 by 32 pixel layout:


Erico really knows how to manipulate those chunky pixels into something magical. Alas, in 10 lines it would be impossible to take full advantage of his screen work, but I hope to apply his stuff in a more advanced version of the game. Here is a video of Outhouse:


Saturday, 15 February 2020

The Secret of Flagstone Manor


My streak of interest in text adventures continues. The Secret of Flagstone Manor by Brian Betts of Mountain Valley Software is reportedly Australia's first home produced text adventure in 1981. Or so reports Renga in Blue has been playing it recently. This piece of BASIC computing history certainly peaked my interest. It would be nice to add this game to my international collection. A Los Lovag was a fun exercise in translating one of the first Hungarian text adventures. Hopefully an Australian program would not present the same degree of translation issues, although having heard some working class Aussie accents, I had my doubts. But the game text was very well written and presented no translation issues;). This is not surprising as it was not a homebrew effort, but a commercially available game.

The only issues in translation involved the large number of ELSE statements. The game was originally programmed for the TRS-80 Model 1, so using ELSE might have been a memory saving trick. I only have a couple of thousand bytes left in my version after having removed all the ELSEs, so it would have been a tight squeeze in a 16K Model 1. Another memory saving trick was the use of strings to store info about items.

Betts used a system of string arrays for items held and for items in each room. Up to 10 item strings can be "stored/dropped" for each room. I can't recall seeing anything quite like it. Most other parsers use numeric arrays to store which items are being carried and which rooms they are in. This game just moves strings around in a string array for each location with each actual item name. This method makes for a lot of string storage when saving a game, so I had to leave that part out since the MC-10 can't easily save strings.  But it likely saves memory since each item will simply represent a single byte for each character of the item, stored in string space, instead of that plus some complex numeric array structure with 5 bytes for each array item.

Renga in Blue suggested that the game had similarities Scott Adams early games, but I'm pretty sure it's not like the Adventureland parser. The BASIC version of that program is very complex (and slow) and uses lots of numeric arrays, probably because it is meant to be a generalized "engine" for multiple adventures. This one uses a more standard and simple cascade of IF/THENs to parse input for different verbs. It also doesn't read its locations into an array. There are only 18. So it just uses a sequence of IFs to print specific room info. I'd say this game does not have any specific parser "engine" at its core. It just applies some common approaches to programing adventures that had developed from 1979-1981. Except for the string array stuff re. items.

On the whole it is a very well debugged, elegantly written, BASIC text adventure program. Although the room count is small it is a fairly complex game. There is a timer aspect that can result in death, but it is fair. The puzzles make sense and there is a pretty interesting dynamic HELP command. So don't just accept the first response of "LOOK AROUND" from that command. The response eventually does change according to progress and context. The other sources of death are also generally fair, since there are clues to help avoid them. 

It was a fun exercise to port the program and add another international early BASIC text adventure program to my collection. I am currently working on De Tijdmachine, an early Dutch text adventure, which I hope to have up and running shortly, so more international fare is coming.

The source code for my version can be found here: https://github.com/jggames/trs80mc10/tree/master/quicktype/Text%20Adventures/WorkInProgress/Flagstone

SPOILER ALERT -- Walkthrough below.

*** The Secret of Flagstone Manor ***
Walkthrough by Jim Gerrie 2020

GO DOOR
E
LOOK CUPBOARD
GET MATCHES
GET CAN
W
W
LOOK SHELVES
GET BOOK
READ BOOK (LAST # FOR COMBINATION)
DROP BOOK
TURN LAMP
GO OPENING
GET GARLIC,LOOK SKELETON (YOUR FATE IF YOU TAKE TO LONG)
EAT GARLIC
U
E
N
W
LOOK RACK
GET WINE,LOOK BOTTLE
PRESS PANEL
GET KEYS
E
S
GO STAIRCASE
OPEN DOOR
GO DOOR
MOVE BED
GET OPENER
OPEN CAN
DROP CAN
DROP OPENER
GET CHEESE
GO MANHOLE
OPEN CHEST
GET DIARY
READ DIARY (HINT ABOUT EATING GARLIC)
DROP DIARY
MOVE CHEST
GET ROPE
D
LOCK DOOR
GO BED
SLEEP (HEAR CLINKING CHAINS IN NIGHT)
W
OPEN DOOR
GO DOOR
D
N
N,HELP
OPEN CLOCK
GET KNIFE
E
LIGHT FIRE
GO OPENING
MOVE COBWEBS (CLUE ABOUT SECOND # OF COMBINATION)
DROP MATCHES
GET LADDER
S
W
S
S
GO STAIRCASE
GO DOOR
LOCK DOOR
GO BED
SLEEP (DREAM ABOUT LEAVING WINE IN STUDY OVERNIGHT)
W
OPEN DOOR
GO DOOR
D
N
N
OPEN DOOR
GO DOOR
LOOK DESK (IGNORE ASHTRAY)
DROP WINE
S
S
S
GO STAIRCASE
GO DOOR
LOCK DOOR
GO BED
SLEEP (YOU HAVE A QUIET NIGHT)
W
OPEN DOOR
GO DOOR
D
N
HELP
CUT PAINTING
DROP KNIFE
GET PAPER, READ PAPER (CLUE ABOUT FIRST # OF COMBINATION)
DROP PAPER
N
GO DOOR
PRESS PANEL
GO OPENING
FEED MOUSE (CLICK-- THE WALL MOVES ASIDE)
GO OPENING (YOU'LL SEE A GHOSTLY FIGURE, WHO WON'T ATTACK BECAUSE YOU'VE EATEN GARLIC)
OPEN DOOR
3
8
7
GO DOOR (DON'T TAKE GOLD YET)
TIE ROPE
S
PULL ROPE (CRASH-- YOU AVOID THE CAVE IN BY LEAVING THE ROOM)
GO DOOR
GET GOLD
GO HOLE (YOU USE THE LADDER-- YOU'VE ESCAPED WITH THE GOLD! YOU'VE SOLVED IT ALL.)


Sunday, 9 February 2020

The Silverton Adventure


The map at the bottom of this post has instructions for all the basic actions that are needed to get to the end of the Silverton House Adventure, which I have ported to Micro Color Basic for the TRS-80 MC-10 from Extended Color Basic for the Coco. This was published by Rainbow Magazine (Falsoft) in 1985 as a type-in game in its Second Rainbow Book of Adventures. The authors are John and Pat Everest. It's a treasure hunt and the basic plot is that you are a master adventurer invited to the first ever Durango puzzlers adventure game.



Durango Dan, has challenged you to find the dollar sign hidden in the Silverton estate. But this is not your standard treasure hunt. There are many (non lethal) traps, red herrings and a large number of diabolical riddles and puzzles to solve. The walkthrough map below provides you with the minimal instructions you need to unlock doors, but it doesn't take you through all the rooms you need to examine in detail to find all the clues to unlocking those doors. Puzzles like this one:

In one room with three keys hanging in a little alcove you can read this message written underneath the keys:

THE KEY IS THREE!
          TINONGTGTATHKHEEELTSEHIAELDGVKOEELRYDKSKEAEYYYSSSAIAYNYKGRI

By skipping every three letters from various starting points and wrapping back to the beginning of the string of characters you can discern the following 3 messages:

          TO TAKE THE GOLD KEY SAY RING
          LEAD KEY SAY SING
          THE SILVER KEY SAY KING

If you "Say" each of these words you are provided with the key.  Simply trying to "get" them opens a trap door which takes you back to the beginning. There are many places where such trap doors are waiting.



Another clue requires that you know that there are four American states with borders that meet forming a perfect cross.





One riddle was particularly hard for me to figure out involving noticing the difference between "pairs of shoes" (8) and simply being asked "how many shoes?" (16).  A keen eye is critical in this game.  Familiar messages are sometimes flashed briefly (with extra words), to trick you into overlooking how many letters are referenced in the message.  Messages are sometimes shown once, and then disappear.  So you must heed the advice on the introductory screen that a "piece of paper might come in handy." Everything must be examined and details noted down carefully, such as:
  • 72 Trophies
  • 23 Dolls
  • 11 Pens
  • 7th son of 7th son (used to decipher a math problem elsewhere referencing "SON X SON")
  • 8 Gowns
  • 8 Shoes
  • 43 Adventures
  • 6 Oranges
You find a painting of a Girl in blue dress sitting on a swing (SWING translated to a phone keypad is 76464, which unlocks a door). What is "below" ZXCVBNM? I take it this is the SPACE key from a standard qwerty keyboard, but I don't yet know what riddle/puzzle this helps with. Durango Dan's "autograph"

VIY MIBLC, ABBY WRALC, TRECES THIN, TROBHOAM LAWL LOVE, DURANGO DAN

can be found in the safe and has 11 words. The following formula gives a combination to the safe:

Left-Dolls, Right-SonXSon, Left-Pens, Right-Shoes = 23, 49, 11, 16

You must take the sum of this combination (99) and divide that by the number of words in the Dan's autograph to give you 9, which is the number of the closet you must open to unlock a door in the room of closets.  Another riddle: "HOW MANY CUBIC FEET OF DIRT IN A HOLE 7 X 14 X 3?"  You might think the answer is 294 square feet, but a  hole doesn't have any dirt in it!  It's a hole!  So the real answer is 0.

There are some puzzles and riddles near the end of the house that I have yet to figure out. Instead I simply resorted to the time tested method of looking at the source code to enable me to figure out what needed to be input. So there is still work for those out there who would like to unravel all the secrets of this enigmatic game.

In porting the game I came across a few errors.  I can't recall all of them, most were minor or stylistic, but one would cause a crash:

1320 IFR=35ANDRIGHT$(B$,4)="DOOR"THENPRINT"THE SOUTH DOOR LOOKS LIKE THIS *"*PRINT"- --- --- *--* * -* *** *- -*--*--*

The *"* in the above should be :":PRINT

Another error involved a confusion between the variables WW, which was used to flag when you find the Dollar Sign by moving a chest, and WX, which was used to flag when you "GET" the Dollar Sign after finding it. The inventory routine checked for WW, which would lead to the the dollar sign appearing immediately in your inventory upon finding it, which might mislead you into thinking that you didn't also need to "GET" it.  But the win routine checked for WX, which was only triggered if you "GET DOLLAR SIGN," so even though you might have it in your inventory you could make to the exit and still be judged to not have completed the adventure.  I fixed this by making the inventory routine use the WX variable.

There was another error with the handling of the container because of conflicts with its use of the variable C and the use of that variable elsewhere in the program, in particular in the entering of lock combinations (A,B,C,D). I changed the variable to C2 where it was clearly intended for handling the player's interactions with the container so that it couldn't be set to values that would cause the malfunction of the container handling routine.

The Game can be played here: https://gamejolt.com/games/jgmc-10games/339292
Select the "Play Game" button at the top and then "Play Our Text Adventures," and then choose SILVERTN from the Cassette menu and type RUN and hit Enter.

Sunday, 5 January 2020

The Night of the Vampire Bunnies


There is a text adventure program that I have been wanting to convert to MC-10 for some times. It's by Jason Dyer. The name of the game, "The Night of the Vampire Bunnies" is what intrigued me. Such a playful title. I was able to get my hands on the BASIC source fairly easily. There were versions in Microsoft GW Basic in various places on the Net. GW BASIC is very similar to Microsoft Micro Color BASIC for the MC-10. It's usually fairly easy to translate such programs. I was able to get the slight differences between BASICs fixed up without much fuss.

Then I converted most of the print statements to use my standard 32 character word-wrap subroutine, so that things would print nicely on the small 32X16 screen of the MC-10. The problem was, I needed to use the maximum extended memory of the MC-10 emulator to test and run the program. Depending how you configure things on VMC10 you can get up to almost 32K of emulated RAM memory.  In other words, more than 12K more than an MC-10 with the standard memory pack. I did this all a few years back.  The program was running, but not able to run on a standard machine. I was daunted by the prospect of paring it down by more than 12K, so I put it aside as a specialty program and promised myself to get back to it to defeat the demonic bunny I assumed lurked at its heart.

Well as things go, of course, I got distracted by the endless number of other BASIC programming projects that I have going at any time.  In the meantime I learned all kinds of techniques, many I have written about in this blog, for condensing programs, especially text intensive programs such as text adventures. In my last project I translated a classic Hungarian Language text adventure "A Hos Lovag."  It whetted my appetite for working on text adventures again.  So I thought I would return to Vampire Bunnies.

The most basic technique I have found for making text adventures smaller so they will fit in the 20K of the ordinary MC-10, is to simplify the text messages. These messages can often be boiled down to something much less complex. The trade-off is losing some of the unique flourish of the original author's writing.  Often this is not a terrible loss as many of these games were written by very young programmers back in the early 80s. As a result they are often filled bad grammar and spelling mistakes. I can report that this was not the case with Bunnies. But there was quite a bit of repetition of the same messages or similar messages in different parts of the code. This was likely a result of the larger memory that a PC provides under GW BASIC. Programmers in the late 80s had room that those of the early 80s using simpler 8-bit home computers did not.  So I was able to consolidate a lot of those messages into a subroutine and then simply GOTO or GOSUB to it.

Another technique I have found useful is to consolidate very common sequences of subroutine calls into their own subroutines. Then you simply have to make a single call to a routine that runs multiple subroutines. This is common in text adventures, in which you often have a bunch of actions being done at the end of player command sequences. It might be to reset variables, check player status, tally scores, display formatting, such as lines on the screen to demarcate a new turn etc.  Jason (again likely because of the memory largess of GW BASIC) had lots of places where multiple subroutines sequences occurred at the end of the different possible player command sequences. This programming technique would have been prohibitive in 16K or 32K machines of the early 80s, but as I discovered later, Jason was inspired by the these early 80's BASIC games but was not creating his own games until the end of the 80s-- when he was 11! (I later found out he went on to become one of the most influential bloggers on early IF fiction with his well respected Renga in Blue blog). Bunnies is interesting because it plays like an early Greg HassettScott Adams or Tim Hartnell adventure, but Jason was writing it in 1989. My technique of creating subroutines of subroutines can be even further improved (and make for more speedy execution) by putting the routines at the top of the program.  So a line like this,

GOSUB 12000:GOSUB13000:GOSUB950:GOTO100

which might occur multiple times throughout the program (at the end of IF statements or command sequences) could be replaced by a single call to a subroutine containing all those routines:

6 GOSUB 12000:GOSUB13000:GOSUB950:GOTO100

And all references to these sequences can be triggered by:
GOTO6
or
THEN6

That's a lot of memory savings when you are counting your bytes. Sometimes these routines were not in the exact same sequence, so I did a little reordering (where it made no difference) before doing a global search and replace.

The real damage done to Jason's program, beyond condensing his descriptions, was that he had a fairly complex parser which I removed.  It is clear that he did not simply use a standard existing two-word parser example program like "Tower of Mystery" from Compute't Guide to Text Adventures (1984).  He created his own unique system for parsing command input. He had a complex system for removing extra article words like THE and ON and TO.  He had ways of breaking the sentences input not just into VERB NOUN, but also W1$ and W2$.  He had the ambition to have his players type in more complete English sentences and then to try to parse the input into coherent instructions that could be handled by the program.

This ambition would bite him in the buttocks when it came to the reception of his program years later in the hostile era of the Internet. The reviews of the program on various retro IF sites tend to complain about its departure from the standards of two word VERB-NOUN parsing.  Some of the puzzles involved having to figure out 4 word command sequences. For example JUMP OVER THE RIVER rather than JUMP RIVER. To be fair, in the context of 80s hobby BASIC programming, this convention was not sacrosanct. It was with a little regret that I stripped out this unique parsing engine and put in its place an extremely simple 2-word parser.  However, it did allow me the get the program down to about 20K. Then all I had to do was replace some multi-character variables with single or double variable names, take out extra spaces between commands, and renumber the program by an increment of 2, to get rid of the large line numbers, which just hog memory in interpreted versions of BASIC.

I now have a working version of "The Night of the Vampire Bunnies." I spiffed up the title page a little by adding an ASCII text graphic of a Vampire Bunny. I originally used a W to symbolize the nose and fangs but switched to an M, which I thought worked better. Then I also added some screen flickering using the different SG4 screen color sets in an attempt to evoke lightning flashes, which I think is in keeping with the B-horror movie feel Jason was attempting to evoke (along with Monty Python's Quest for the Holy Grail). Hopefully that will make up a little for the loss of his more detailed location descriptions.

Bunny now with downward pointing fangs
I've play tested the game using various walkthroughs from the the CASA IF Solution Archive.  I haven't run into any errors, but my edited version only requires two word command sequences, so it is slightly different.

Next project: I'm currently working on a BASIC program called "X-Rated Adventure" by V. K. Supersoft (1984), which was recently posted on the Coco Archive. So far, I've got it working on the MC-10.  Not sure if I am going to release it.  Have to try to play through and test it, both for function, and for appropriateness.  Still it might be useful for psychologists to gain insight into an aspect of macho (teenage boy) culture in the early 80s.