Tuesday, 17 April 2018

RetroChallenge 2018/04: 3DMCHASE--Faster Yet!

I've been working on speeding up the wall rendering part of the program and a few other speedups.  Renumbered the code at one line increments, because that can also help a little with speed, as the main routines are at the top of the program and switch them from 3 digit line numbers to 2 means one less digit to interpret for GOTO and GOSUBs. You be the judge if you can discern any speed increase from prior versions (maybe turn the music off, as my choices might influence your perceptions:). Here's the latest:


And the prior version (demonstrating the multiple screens):



Also been testing the 3 new screens I added.  I have yet to play three three whole maps to get to the next map. Will have to do a full playthrough without tricks to make absolutely sure everything works. Right now you get a new map after completing the prior map 3 times. The third map/maze has a secret message, which you will be able to see if you get to it, or if you can read the code very carefully. But I think it will be hard to discern using the code reading method. Maybe this will entice someone to try to get to the third screen (i.e. nine successful clearings of the mazes). I won't, however, be offering an MC-10 mug for the first person who does and deciphers the message. But maybe someone out there who might be willing to put up a piece of MC-10 swag to encourage some friendly competition. Who knows...

My plan is still to port the code to Coco. Hopefully with the speedup poke it will be even faster. I'll wait until I've got all the bugs out of the MC-10 version before doing the conversion, as its annoying to then discover bugs and fixes and have to work on both versions simultaneously. I might also try to convert my DigDug program too, if I can find the time. I've been very busy with marking, as it is end of term at the University and I did an overload course. Still, Basic coding is a nice way to wind down after a day of marking exams and papers. Ah the joys of pure logic!

Saturday, 7 April 2018

RetroChallenge 2018/04: MC-Chase the Continuing Evolution

I've added two maps to the game. You get a new map every 3 completions of a map. The third map contains a "secret message." The maps are saved as DATA statement lines. Since the speedup routine by James Diffendaffer also uses DATA statements, I had to create a routine to restart at the first map DATA statement after you lose your last man. Pippa's POKE/PEEK routine for doing a RESTORE to a specific POINT in the DATA statements was helpful in accomplishing this:

1 GOSUB8:PRINTJ:GOSUB9:GOTO1 8 OD=PEEK(173)+256*PEEK(174):READJ:RETURN 9 POKE174,INT(OD/256):POKE173,OD-256*PEEK(174):RETURN 10 DATA 1

Her routine effectively provides the same ability that other Basics have of including a specific line number with the RESTORE command to have data reading begin at that line. In fact, it is even more flexible because it allows you to choose which specific data item to restore READing to once you repoke the saved value (in the example above OD is used to restore the memory address located by the PEEKs done at line 8).

My plan is to convert the game to Coco after I've got all the bugs out. I'll then release both versions during Cocofest. I won't need Pippa's routine for the Coco version because I won't be using Diffendaffer's speedup M/L routine. Instead, I'll include a routine giving the option to use the standard Coco 2 or 3 (or Dragon) high speed POKES.

Sunday, 1 April 2018

RetroChallange 2018/04: The 'B'

I have been working on my new game for Cocofest. I am calling "MC-Chase."  I have got the wall rendering  of the 3D maze about as fast as I will be able to get it. I have the giant "B" that eats you if you're not fast enough. I have an AI for the 'B' based roughly on the same routine I worked out for DigDig. I have the routines for displaying and converting Cocos to MC-10s and keeping track of the score and high scores. Not much more to do. I think I'll just take the rest of April to search out those minor speed-ups to the code that always seem to be possible.


Next post: Some more info on my 10-Liner games for the 10-Liner Basic programming contest. I think I will also try to make a version of Frogger in 10 lines based on a graphic by Carlos Camacho:

No automatic alt text available.

Thanks Carlos!


Monday, 26 March 2018

RetroChallenge 2018/04: New Game for Cocofest

Working on an idea for a new game for Cocofest.  Here's a screenshot:
The premise I'm working on is the following:
YOU ARE AT THE HERON POINT CONVENTION CENTRE. IT'S COCOFEST. THE CONVENTION HAS BEEN TAKEN OVER BY RETROBRITE-NEEDING COCOS. YOU MUST GO AROUND THE CONVENTION CENTRE SWAPPING OUT 10 YELLOWING COCOS FOR 10 SHINY NEW MC-10S.  HOWEVER YOU ARE BEING CHASED BY THE 'B'. THE B IS FILLED WITH RIGHTEOUS INDIGNATION AT THE MC-10 (FOR RUINING THE CHANCES OF THE DELUXE COCO). HE WILL STOP YOU AT ALL COSTS.
The game is based roughly on the idea of 3D Monster maze. I will release it at Cocofest. Got lots of work to do to get it to a playable state (if that's even possible). Will keep you posted.

Saturday, 24 March 2018

RetroChallenge 2018/04: Dig Dug and FOD Updates

I have been fiddling away on both Dig Dug and Forest of Doom. On FOD I have been able to make some real improvements to the sound routines around combat and random messages. To make room for these new routines I have been combing the code for more memory savings. I found that I could really pare down the input routines. While doing so, I was also able to add a T structure for directional key input. Now TGFH can also be used in addition to the cardinal directions NSEW. I also found some redundant code that seemed to have been related to the Break key. And I improved on screen formatting. Since I have been playing the game quite a bit, I found a few places where I needed to add clearing the screen from the current cursor position calls. I sped up the sound and slightly fixed the music for Inns and also added back a few routines I had left out for space saving. I think I have sounds now for all the routines in the original program.  And I have more space left (300 bytes) than I had a week or so ago (250 bytes).  Here's a vid:
I have also been combing through DigDug. Found some more speed ups there too. It's quite fast now. In playing it, I felt I should re-adjust the scoring a little. I made rock dropping worth 80 if you kill the monster and inflating them worth 20. The disparity struck me as a little bit too extreme (90 versus 10).  Also adjusted the fire breathing and laser blast a little so they appear a little more clearly on the screen before being erased.
Played Dig Dug to the point that I confirmed that you earned a life recharge at 500 and 1000. Should also work for 1500 and so on. I still haven't played FOD to a win. Whenever I get to level 6 I run into something like a Dragon that just does me in.  At that level, especially after you get the scepter, the monsters just come thick and fast, almost every time you move a space. I haven't had much luck with getting the mirror or magic book from the innkeepers, nor much success with digging up X's. I play at level 2 so I can find the Xs but I just don't find them that often and they're usually a trap.  I think you must have to win the sword and find the mirror and book to have a chance to make it out alive.  I have tested these routines by way of  breaking and using GOTOs to get to them, as you can see demonstrated in the video. I have even won this way. So I know these routines work. But I wonder if there is some bug in my port that somehow makes it impossible to win. It would be nice if some of the pros out there could play the MC-10 version to see if it is operating comparably to the Coco version.  Maybe some folks at Cocofest?!

Anyway, I'll have to send the latest version on to Bruce.

Next postings I'll talk about my recent 10-Liner submissions to the 10-Liner Basic game contest.

Thursday, 22 March 2018

RetroChallenge 2018/04: Dig Dug Final Installment?

I thought I had finished Dig Dug but Carlos Camacho, the graphics design artist on the project, posted in the MC-10 Facebook the notes for the background/intro music of the original game. He thought that when Allen Huffman gets his sound-through-the-serial port device working it could be added to play in the background in some future rendition of the program. I'll certainly do that. In the meantime I had been feeling the existing game start routine that flashes our names could use a little music. It only had a silent pause between my name and Carlos' name. So I used my sound routine developed for FOD to play the refrain while our names are being displayed when the program is first run.

Here is what he posted:
10 PLAY "T8;O1;F#;G;G;G;G;G;G;G;G;G;G;G;G;G;E;D;E;D;E;D;E;D;D#;E;E;E;E;E;E;E;E;E;E;E;E;E;E;D;E;D;E;D;G;F#;G;G;G;G;G;G;G;G;G;G;G;G;G;E;D;E;D;E;D;E;D;D#;E;E;E;E;E;E;E;E;E;E;E;E;E;E;D;E;D;E;D;G"
20 PLAY "T8;O2;F#;G;G;G;G;G;G;G;G;G;G;G;G;G;E;D;E;D;E;D;E;D;D#;E;E;E;E;E;E;E;E;E;E;E;E;E;E;D;E;D;E;D;G;F#;G;G;G;G;G;G;G;G;G;G;G;G;G;E;D;E;D;E;D;E;D;D#;E;E;E;E;E;E;E;E;E;E;E;E;E;E;D;E;D;E;D;G"
100 GOTO 10


I'm posting it here in case anyone else might find it useful and because its a convenient place to go back and get it from when I need to use with Allen's device.

I also (of course) found a few more tweaks to the code to make the main loop just a little bit faster (I think). I should also mention that I built in James Diffendaffer's M/L speed-up routine. It's one little tweak to Microsoft Basic (something about using the 0 page), that he estimates speeds up execution by 1-2%. Only a little bit, but every little bit helps!

0 REM01234567890123456789012345678901234567890123456

1 CLS:GOSUB3000:GOSUB10000:GOTO100:REM program start line number

9998 DATA60,54,55,150,246,129,126,38,25,220,247,195,1,5,131,1,1,221,252,206,67,113,236,1
9999 DATA221,246,236,3,221,248,236,5,221,250,51,50,56,57,240,129,58,37,1,57,126

10000 FORC=0TO44:READL:POKE17227+C,L:NEXT:EXEC17227:RETURN


I've added it to many other programs in my arcade collection as well:
Here is a link to that collection:

Tuesday, 20 March 2018

RetroChallenge 2018/04: Finishing up Dig Dug

After getting the basic AI working for the monsters I started implementing some features from the original game. In the original, after you kill all the monsters but one, the last one will make a break from the surface and high tail it to the left of the screen. In my version I made so that if any monster gets to the blue at the top of the screen it heads west at high speed.
I also added the inflate attack of the character. It was too difficult to implement a multiple inflate process until the monster pops--that would involve too much processing and overhead. But now you can shoot a hose at the monsters who then inflate to fill their block, before "popping" for 10 points. The hose is short enough that you have to let them get uncomfortably close to launch such attacks.  Also, you have to be pointing in the desired direction. The pipe sections get left in place, which saves processing and keeps the game flowing and has the added benefit of allowing the player to create temporary barriers to slow enemies--All characters have to take an extra turn to clear pipe before they can proceed through that space.  This at least partially covers the role of inflating in the original, which can serve to temporarily stall monsters.

I messaged with my son Charlie over the weekend and he agreed to work up a little fanfare based on one from the original game to play at the end of clearing the screen of monsters. Thanks Charlie!

I also combed through the code and as usual found many ways to speed it up. One neat trick I came across recently was using a FOR/NEXT loop with a STEP 0 for the main loop. This allows an indeterminate loop which you can trigger an exit from by setting the variable.

10 FOR A=0 TO 1 STEP 0
20 INPUT A
30 NEXT
40 PRINT"LOOP EXITED"
50 END

I haven't checked it but I suspect that using a NEXT statement without a variable is a probably a faster way to loop than using IF statements and a GOTO with a LINE NUMBER.  A little less processing involved. Maybe I'll try these benchmarking programs and see what I get:

10 FOR A=0 TO 1 STEP 0
20 B=B+1:IFB=10000THENA=1
30 NEXT
40 PRINT"LOOP EXITED"
50 END

10 B=B+1:IFB=10000THENA=1
30 IFA=0THEN10
40 PRINT"LOOP EXITED"
50 END

Yep.  The FOR/NEXT finished many seconds before the IF/GOTO routine.

I added "flowers" to the top left because when you kill a monster I simply blank its strings and set its coordinates to the upper left. So I needed some characters around the hidden character, which it can't move through. Since I added the ability of the monsters to move into the blue, I had to allow the characters to enter blue spaces, so I put the flowers in to "trap" the hidden dead monsters.

I made it so that when you drop a rock on a monster you get ninety points. This gives the player an incentive to work at trying to trick monsters to go under rocks. As further incentive you get a recharge of your lives every 500 points. Since shooting the monsters at short range can give them opportunities for them to get up close and shave off lives from your initial 10. You need to work at balancing the risks of shooting and crushing to make it to the next 500 points to get a recharge. I also made the seeking AI routine get more acute at tracking you as you clear more screens.

Finally,  I added a random fire breathing/laser shooting routine to the monsters, which is further incentive to crush them at a distance rather than just get up close and fire away and risk getting fried. I reused the same subroutine as the player's pipe shooting routine, except using alternate graphics (yellow lines versus the "pipe" pieces) that disappear immediately as they fly away from the monster (very fast like a flame or laser). The frying gets more frequent as you clear more screens.
It's a very tough game, maybe too tough now that I have sped it up further. Hard to tell. The problem is I don't like playing games--just making them. So I don't do as much play testing as I probably should. Which means I can't really be sure if the game is complete crap, so any feedback would be highly welcome!