Saturday, 30 March 2019

RetroChallenge 03/2019: Last Post

The time is ticking down. Don't think I'll be able to add much more to my activities this month for RetroChallenge, so I think I'll wrap things up. Since finishing "Manic Miner" I have been just fooling around with a few back burner type-in projects. The first was one from my list that I mentioned at the start of the Challenge, "Convoy."  This program was one of a number of listings I found in Dragon 32 programming books. Had to type it in from the PDF. Few tweaks and it was running.

It takes a little knack to figure out the ranging. Each level adds more ships. I think it might be possible to add an animated shot flying from your cannon to the target, rather than simply have a numeric countdown and then "splash."  Maybe some speed ups could be done too, to make it a little more challenging.

The second project I completed since Miner was a program called "Geography." This one I got from a German VZ200/Laser Fan Club software repository on the Net: It has been a really valuable resource in the past and I thought I would take another look. There are so many programs listed and all the descriptions are German, so it is hard to guess what's there. Some program descriptions mentioned "Englisch" so I took a look and found "Geography". The remarks in the program seem to indicate that it might have originally been from a Coco book and then migrated to VZ by way of a PET stage.


Added my name to the list. 2018 seems like quite a jump! But the program had already travelled from the Rocky Mountains to Germany in space, so a little leap by time is perhaps not that unusual.

It has quite a list of names stored in its DATA statements. I added a little graphic partial world map that I found in a Sinclair Spectrum program listing. Not sure if I translated the Speccy semigraphic characters completely correctly, but from the description of the graphics I found on the net, it seemed the best I could do. Here is the original listing:


Each letter represents a semigraphic character from the following list

From various experiments it seemed like the order of the top 2 lines went like this


But the resulting picture seems a little odd/fuzzier than it should. I tried some add hoc substitutions but it didn't seem to make much improvement so I left it pretty much as is.

Well that is the end of my RetroChallenge activities for this month. All the best to the other contestants. I've enjoyed popping into a few projects that looked interesting (mostly ones with programming aspects looking for ideas) and reading John's mid contest update. Thanks again to John for organizing and to all the other contestants for their efforts.  Keep on retrocomputing!


Thanks to Solar Penguin (Pippa) I learned that the Speccy and the ZX81 don't use the same block character set.  Since my map data was from the Speccy, my map didn't look right.  Now it does.

Friday, 22 March 2019

RetroChallenge 03/2019: Some Updates to a former Retrochallenge Program

I have made some edits to a program I did for a RetroChallenge a few years back. It was a port of a text adventure coded by "Floyd" (aka Joshua Bell) in Applesoft Basic for Javascript. Since Floyd had lots of power to work with, speed was not a problem. He coded a clever encoding system to hide the game's text data from snooping eyes peeking at the source. However, on an MC-10 with plain old interpreted Basic, the setup time to decode all this data was way too long. So when Floyd contacted me about an error I had made in my Walkthrough map of his game, I decided to revisit his encoding routine and apply some of the Basic speedup techniques I've picked up over the last few years. I also decided to add a little reverse video to provide some visual distinction between room descriptions. I have also fixed up my standard word-wrap routine since then, so I updated that as well. If you click on the link to my original post you will be taken to an updated map of the game with hints about how to complete it, so beware if you don't want the game spoiled. It can be played online at Game Jolt and also find a link below to Github with the latest source code:

Friday, 15 March 2019

RetroChallenge 03/2019: Responding to Charlie's Input

Made the changes to my game "Manic Miner" that my son Charlie recommended. There is now a (kinda) timer. If you finish collecting all the gold on a screen quickly enough, you get a 500 point bonus. Also, the snake starts higher when on the lowest ladder. So you have to finish quickly or it will make it to the bottom of the ladder blocking the exit. Then you are stuck waiting until it moves up again.

Now the instructions explain the numbers at the bottom of the screen. Also fixed some other minor errors on the instruction screen. Changed the program so now you have to clear every gold on the level prior to the 5th to earn the bonus life. This also happens every subsequent 5th screen, so you have to make sure to clear on levels 4, 9, 14 and so on. Don't know how to explain this exactly.

Also added true flapping to the bat's wings. Used the counter (ZZ) for the level timer that I added for the bonus calculation and then just (1ANDZZ) and add the result to the array pointer for the bat graphic.

Also did a bunch of speedups. Can always seem to find untold ways to make the code more efficient. For example, when printing the rock it is just one graphic that never changes, so instead of using the array A$(15) I just print the two characters in a string "**" that's a saving of two characters that don't have to be interpreted and also the removal of some string variable manipulation. Also noticed that if you stood on the edge of the screen as a monster headed towards you, it wouldn't kill you because the end of its run would be triggered and it would be plucked from the screen and assigned a new location before it got to the regular collision detect in the main loop. Needed a special collision detect just for checking at the end of a monster's run.

Not sure now if the game is too fast again on the first levels. I felt it was a bit too slow at the point of my last posting, but now I'm not sure if I have made it too fast again because of the speedups. Can't stay alive too long to test whether I have the amount of time allocated for the bonus on levels other than the lowest. I changed the program so now as you progress, every 5 levels another gold is added to the screen up 7. So the speed bonus has to also allocate more time as you have to deal with more gold. Hard to know if I have it "tuned" right. I'm just using a straight counter and not an internal clock timer. I'm hoping my son Charlie might be able to find some more time to help test these features. He's a much better game player than me.

Chad Edward on the MC-10 facebook group recommended shortening the musical refrain. It does get a bit tedious. So after the first two levels, you only get a much shortened version before you must be ready to face the monsters.


Charlie has tested the game and helped me with fine tuning the speed timer for level completion. He has declared it "tight." So, unless any brainstorms strike, or bugs appear, I think I am calling this project complete. "MINER" can be played under our "Original Micro Color Basic Games" category on Game Jolt:

Thursday, 14 March 2019

RetroChallenge 03/2019: Miner Working

I got the enemies working. Some interesting compromises had to be made to maintain speed. The bat basically patrols the top 3 levels. The boulder bounces on the bottom level. And the snake lurks on a random ladder. It climbs up and down at random intervals adding a little complexity to the player's navigation decision-making. The other two appear randomly from either side. The snake will eventually speed up as you proceed through levels. The other two monsters will also speed up as you go.

Some other surprising features emerged spontaneously as I worked out player movement. You can't move through enemies (a mistake), but then I realized that this allowed for some quirky player dynamics. If you jump up just before getting hit by the boulder you can end up jumping on top of it and possibly running over it.  Just don't fall in front of it or it will roll over you.  You can rest by standing on ladders between platforms and use these refuges to plan your strategy.

Solved the problem with the platforms not always providing a complete path to all the gold. You can plant a few ladders of your own, 3 per level, to make a path. Had to finesse the gold planting routine. It prioritizes planting on upper levels, but will sometimes plant one on the lowest level so that you have to play footsies with the boulder. After every 5 levels you get an extra gold up to a max of five.  Each gold is worth a 100 more than the last one retrieved, so there is some incentive for cleaning a level of its gold.  If you don't collect at least 2 before each fifth level, you don't earn an extra life.

My son Charlie composed a nice SOUND command routine to play "Hall of the Mountain King" from Edvard Grieg. This was the in-game refrain from the original Manic Miner. It gives the player a chance at the beginning of the level to plan initial strategy. I also added a variation of the original game's loading screen.

Not sure what is left to do. Asked Charlie to give me some suggestions for some refinements. Here is what he said:
  • anyway I played it for a bit and got a score of 5200
  • the jumping is the best mechanic
  • the animation is smooth so it's very usable
  • I also like how the arms move for it
  • at one point I was a bit annoyed since I couldn't place a ladder down while I was on a ladder, but that's minor
  • or should I say miner 😉
  • also a couple times a snake sat on the exit for a while, which was annoying, but on second thought it sort of made things interesting since I just ended up jumping over boulders for a bit
  • map generation is good
  • only recommendations I can think of for now would be to add labels for the numbers on the bottom, and to maybe add a time bonus for each level (there's a timer and you get extra points for any time left when you finish the level)

Tried labels, but they created a conflict with my key polling and peeking routines, which both use an array K(255), to store codes for using with ON/GOTO commands. Don't want to declare a separate array because each variable brings speed down.  People will just have to figure out the arrangement of numbers: SCORE, LEVEL, BRIDGES,LIVES.  Also don't think a timer is really worth it, as most screens can be completed fairly quickly.

Source can be found on Github:

Monday, 11 March 2019

RetroChallenge 03/2019: Manic Miner

This is update on my original project for this RetroChallenge. I have been working on a platformer game using only MC6847 semigraphics and BASIC. I have been able to work out most of the player movement mechanics. Jumping, falling, ladder climbing, picking up gold piles and moving to the next level have all been implemented.  Since my last post and video I have also added ladders to the screen and the placement of piles of gold.  I'm tentatively calling the game simply "Miner" after the "Manic Miner" platformer classic for the Sinclair Spectrum.

I had been thinking Miner 6809er, based on Miner 2049er for the Atari , but then remembered that I'm an MC-10 coder! But Miner 6803er just doesn't roll off the tongue. Perhaps I'll port it to Coco after I'm finished so I can use that title. Or I'll simply call it Manic Miner and recreate the fancy flashing loading screen of the Speccy game:

I'm planning to implement other features of Manic Miner, such as the timer (air supply) and enemies that make your life difficult. Right now I have graphics for bats, snakes and boulders, but I'm not sure if I will be able to get all 3 working and whether I can have them exhibit different movement behaviors. We'll see what can work without sacrificing game speed too much. This is the fun of BASIC game coding. Can a playable game be achieved or not. Won't know until we try. Usually something can be worked out, but sometimes sacrifices will have to be made in an original vision. My highest hope is that I can have three different types of enemies with unique movement characteristics: Bouncing boulders, that roll across the bottom of the screen from a random side; Flapping bats that crisscross the screen at random heights; a snake that patrols on a specific platform. At least 3 moving on each screen at all times.

I like the way the random automatic levels has turned out. It might help provide a little variety and challenge to the game to offset the lack of enemies or speed of machine language equivalents.  The only problem is that sometimes the screen will not render paths  to all platforms given the player's jump limitations. I have worked out what I think is a work around for this. The player is going to be able to place some sections of ladder/platform left or right, to help bridge gaps.  The number of pieces of ladder carried will be limited and only replenished by going deeper, perhaps a piece every level up to a max of 3 or something like that. I'm also considering the ability to jump straight up and grab the bottom of ladders.  Decisions will have to be made.

I'm thinking that the player will have to collect all three piles of gold each level before being allowed to proceed deeper into the cave. Not sure if I will make the goal some set number of levels (e.g. 20 like in Manic Miner) and then you get an elevator ride back to the pit face. Or perhaps, just an endless descent.  My sense is that a fixed goal is best.  Or optional gold collection and a key that must be retrieved to open the next level. That probably makes more sense and then a fixed number of levels. The challenge will be risking to collect as much gold as possible and make to the bottom with the highest score.

If any RetroChallengers have recommendations, add a comment below.

Friday, 8 March 2019

RetroChallenge 03/2019: Finally an Idea!

Been pretty uninspired so far this RetroChallenge. I have a number of old type-ins at varying stages of readiness, that I planned to get working. Some are just rough text listings from scans from online PDFs. Others have to be typed in the old fashioned way. None of them have gripped or inspired me. At least not as much of some others I recently completed. For example, Swordsman was a intriguing program listing I found in a Dragon 32 book:…/Sixty%20Programs%20fo…

I had to fix it up quite a bit. You can find the listing here:…/q…/Strategy%20%26%20Simulation/SwordMan

It was ported from Commodore 64 to Dragon and whoever did the conversion from the Petscii characters was not very thoughtful or inspired. I think they just did a text dump from the C64 and whatever came out they used without consideration of what might work better from the MC6847 character set.
Some enemies like the "Gangrene Goat" were not even recognizable-- just an incoherent blur of hashes, which was sad because "Swordsman" has some charming characters as opponents. It's a real classic from the 8-bit type-in days. I had to do quite a bit of work on the swordsman himself to get the animation to look reasonably like the original and to fix a fundamentally broken implementation of hit detection. I had to play the original Commodore version quite a bit using Winvice to see how the game was supposed to look and play. I finally got it working like the original. Here's a final update, which shows an improved way I got the swordsman and the enemy "sprites" to overlap each other in their final movements:

Another port I worked on recently was "Sheepdog Trial" by Guy Morgan. It was from ZX Computing magazine (April/May 1983). The premise of trying to move a randomly moving herd of sheep was intriguing. If your dog gets too close then the sheep get scared and move more erratically. If your dog is too far away, you have no influence on their movement. But if you are at the right distance you can nudge them away from your dog (i.e. in the direction that you need them to go). More sheep equals more difficulty. I used color semigraphic block characters of different colors, with moving heads (black dots), instead of the original characters used to represent dog and sheep. I added a high score feature in case multiple players might ever wish to compete against each other.  

For this Retrochallenge I will add some other posts of recent porting and type-in projects that I haven't blogged about yet. But I think I do have an idea (finally) for an original project. I had an idea for a randomly generated platformer game. The platforms will scroll up from the bottom of the screen. Your character's goal will be to proceed deeper into a potentially bottomless old mine. I plan to add randomly placed ladders which will go from the top of the screen where your character appears, to the bottom and one other randomly placed ladder. Enemies, possibly bats (or maybe different kinds, with different movement styles) will fly back and forth across the screen. Miss a jump and fall too far, and you lose a miner. Randomly placed items for points or aid/powers will also be placed on each level.  Here's a video of the platform generating routine: