Into the Wilderness


You are an intrepid explorer and the object of the game is to advance as far into the wilderness (represented by the dark scary forest overgrown with ♣s) as possible. The wilderness is the same every time, so if you make a wrong turn and end up in the dead end, there is an opportunity to make a right choice next time.

Code and comments

Download the INWOODS.NSG code.

I wrote this program after 20 year hiatus I took on MSX programming. I was surprised that I still remember a lot of it.

The program generates simply connected (AKA 1-connected) maze one row at a time. This guarantees that the maze will continue ahead indefinitely and there will be no end to it. It also guarantees that if you take a wrong turn, it will eventually end in a dead end -- the split paths will never rejoin.

It is possible that the generated maze will have an S-trap (this is where the path takes you up, then down, then up again) taller than the screen height. This will make the maze effectively unpassable, but I hope that such trap is so far ahead that nobody will get there anyway.

This game is not unlike earlier AMTRUCK.NSG or ROAD.NSG. Those two also feature random content falling down on you. In contrast, here we have a 1-connected maze (rather than random noise) and the player moves in 2 dimensions, which adds to the complexity. I was really surprised when I managed to fit it all into 3 lines, I did not expect that.

For example, look at print operator (the first operator in line 2). Originally K$ was inlined here (and was not a variable in the first place). But, I needed room in line 2 for structure reasons so I sacrificed some space from line 1 by creating a variable K$ there and then using it in line 2. However, there was not enough room in line 1 for the entire variable, so I had to put only part of in there an leave CHR$(11) in line 2.

Overall, I think it is pretty good game on its own merit. 1-connected maze looks pleasing to the eye. It provides unique patterns to recognize and remember the direction of the correct path, the generation (which is slow) is blended with the movement and because of that does not feel too slow.

Best score

I explored 452 km as reported by the game.

[ MSX BASIC | << Previous | Next >> | Feedback ]