3D RayCaster Maze – Featured Small Basic Game

Check out this fantastic 3D real-time game (that runs online)...


3D Color RayCaster Maze - by Old Basic Coder


From the creator, Old Basic Coder...

I made a "3D Maze" type program as an exercise. Had not programmed anything for about 25 years, fancied getting back into it, and downloaded the free version of Visual Studio. It popped up with the option of SmallBasic, so I thought I'd start there first.

My first attempt at the 3D maze has been uploaded to program ID - DWV967

However, I wanted to develop this further into something that resembled the old Bard's Tale games and have some simple textured walls/graphics. But couldn't work out how to transform and project the textures in software alone. I then read about RayCasting being an efficient method of portraying a simple pseudo 3d world made from blocks, with the ability to map simple textures.

Found a tutorial at lodev.org with some sample C++ code. I eventually worked out how to translate this into Smallbasic (have never coded C++ before!!) and managed to get the basic engine working.

After that, I made some improvements to the code (though it is still a bit messy, could probably be optimised and needs more annotation), and included colour shading that gets darker the further away the walls are.

My RayCaster Maze has been uploaded to program ID - RVR504 

FIrst Version - BRS931

It's probably not running fast enough to include textures within Small Basic, which would probably benefit from some type of screen buffering (double buffering?) but am now very keen to see if I can port this to my Nexus 7 using "RFO Basic!", include textures and eventually some basic RPG elements too.


I would love to see the RPG elements too, like characters who give you hints in the maze or random enemies that pop up.

I issued the challenge to the community in the Small Basic forum to improve on the maze:

Small Basic Community Challenge: Want to turn this 3D Maze into an RPG?


Great job, Old Basic Coder!

   - Ninja Ed

Comments (15)

  1. 8Bit Pony says:

    Wow! It is truly amazing what you can create with small basic. This is a very good example of what you can do with it! :3

  2. anonymouscommenter says:

    Very nice old basic coder. It runs reasonably quick on my computer and it's not the fastest in the world! I love rpg's and I need to think about how to get monsters into the maze. However, doors, decorations, objects on the ground would be a good start to. The potential is there. Never thought BASIC was fast enough. But then I started BASIC programming back in the 8-bit world.

  3. Congratulations to Old Basic Code

    Excellent programming level.

    I think it shows that Small Basic has a huge power

    Best wishes

  4. anonymouscommenter says:

    Just downloaded smallbasic, looking into using it to teach programming to my younger brother. Is there no way to make stand alone exe's with smallbasic?



  5. Elmernite, You can ask in the forums to get some specifics options (various extensions come to mind): social.msdn.microsoft.com/…/threads


  6. IlikeBasic, well it did slow down too much when adding textures, so it will be interesting what people come up with to improve the game.

  7. anonymouscommenter says:

    updated the main forum (challenge) thread for this, with a newer version of code, that introduces "very" simple textures, including doors. ๐Ÿ™‚ Program code WZN127

  8. Great job! It would be cool if the doors could open.

  9. anonymouscommenter says:

    The version I'm working on has doors that open. ๐Ÿ™‚

    I'll wait until there are a few more improvements included before I post another version of the code.

  10. "I would love to see the RPG elements too, like characters who give you hints in the maze or random enemies that pop up."

    Excuse my ignorance and my poor English language

    I met RPG (Report Program Generation) running on IBM AS 400

    I do not understand in this context


  11. RPG in the context above is Role Playing Game (basically adventure gaming elements) ๐Ÿ™‚

  12. Old Basic Coder, that's awesome about the opening doors! What other improvements are you adding? Is there an "end" to the game/maze?


  13. I have a big "to do" list at the moment…

    1) include random maze generation.

    (I noticed another maze demonstration that generated random mazes using Prim's algorithm. So I may look to introduce something similar.)

    2) hide a 'key' within the maze, that the player would need to collect in order to open the exit, and progress to the next level.

    3) include some basic RPG combat elements. (Currently researching simple combat rule on the internet). Need to include some basic stats, that improve with each successful battle.

    I have been able to include proper textures, running locally and without extensions, using jpg images that I cut into multiple 1 pixel wide jpgs. It slows a bit, but is still playable, moving around. I now need to set up a Flicker account, so I can upload all of these "stripe" images, so that they can be downloaded and  used when running online.

    However, I am struggling for time, as I am also trying to renovate a house in my spare time. ๐Ÿ™  So it may be a while before this becomes a proper game.

  14. anonymouscommenter says:

    Example of my locally running version using detailed textures, uploaded to YouTube….


  15. link to RPG challenge thread to keep all the comments in the one place….


    please can all updates/comments be posted to the thread link above. ๐Ÿ™‚


    Old Basic Coder

Skip to main content