Pages

Friday, 31 March 2017

Sokoban Update


I made a version of the classic puzzle game Sokoban back in 2013. I used some ASCII maps I came across for an OS9 text version I found for the Coco. Because of the limitations of the MC-10 screen I could only use puzzles that would fit on the 20X16 space I had designated on the left hand side of the screen for displaying them. That meant that only the first dozen or so of the maps from the original game would easily fit, after that I had to pick carefully the maps that would fit from the more complex higher levels. I remember at the time that I was able to decode what most of the ASCII characters used to encode the maps represented. There were the boxes, the home bases where the boxes had to be pushed to, the starting point for the character and the walls. But there was also another kind of character that I couldn't figure out. These special characters only appeared on the higher level maps. I didn't play the game well enough to have got high enough in level to know what these special codes were for, so I just left them as blanks. But it always niggled at me that I hadn't properly completed the program.

Well jump forward a few years and the thought struck me that I should be able to find more information about Sokoban on the Net today, including possibly on-line "solver programs" that would help me to check whether the program was working properly on those higher level maps. I had recently used a Minesweeper solver program to help me check whether my Sweeper program (for the 10-Liner programming contest) was working properly. I like programming, but I'm actually not very interested in logic puzzles, so it greatly eases the burden of testing to be able to have a program that will help you complete a puzzle.  Well I didn't find a solver program but I did find videos of people solving all the classic maps for the game:


Puzzle Map 50 was one of the maps I had included in my version for the MC-10.  When I viewed the video I was able to see that the strange characters I hadn't been able to figure out back in 2013, where just boxes that were already placed on home bases at the start of the level (the reverse Os in the picture below).
New 2015 Version
You can see that in my old version I had left these out.

Old 2013 Version
Another feature that I had regretted not adding to the program was the ability to take back the very last move. Without that feature, one simple slip of a finger could ruin a whole level. On the very high levels this can mean possibly hundreds of wasted moves. So I added the feature to help avoid annoying players too much (if there ever are any besides myself). I was also able to improve the animation of the little warehouse worker dude. Robert Sieg created a little click sound routine using just POKES and PEEKS, which I added as the footsteps for the guy, rather than the excessive SOUND commands I formerly used, which are simply too loud and annoying.

I was able to fix all the maps with the special characters in them by looking for images of the maps on-line. In the course of doing that I was also able to add the original map numbers to the 25 "levels" that I included.  So the player can now know which of the original maps they are playing on the MC-10 version.

I committed to blogging about my recent projects for RetroChallenge 2017 and the last two "snow days" here in Cape Breton have allowed me write about the projects that I most wanted to write about. I know that I'm early, but hey when the weather cooperates with you in Canada, you've got to take advantage! And I'm not sure if I'll be able to post in April--I'm a university professor and that's end of term and exam period for me. So in case I can't find the time for more posting, I'll thank John and the other participants for another fun contest this year. I'm sure I'll be able to find time to read about the other projects over the coming month, which will be a fun distraction from marking. For more information about the challenge click here: http://www.retrochallenge.org/2017/03/rc201704-open-for-entrants.html?spref=fb

No comments:

Post a Comment