3D Maze PoC (totally from scratch by hand)

(Thanks to the 'your thread is similar to...' I found First Person "3D" Maze & Relative Movement which is ace. But I still like to share too.)

So I decided to try a tech demo. Writing a basic 3D maze engine from scratch. Outline as:

  1. Generate a maze of arbitrary size (video is of 3x3, anything bigger take a long time to wander through)
  2. Write a solver for the maze
  3. Walk the maze

I had some issues, such as:

  1. turning corners put the camera out of centre, and moving back is sloooow
  2. The whole thing is sloooow (on my list to fix, or abandon, even though I had fun)
  3. We can't really do shading :wink: So I just did random black/white, as you can see

If you do want to see, you can find the simulator recording (running on a 14yo MacBookPro) over here.

My next steps were going to be:

  1. Use crank as a mechanism for looking around (buttons to switch plane)
  2. Sort out those walls

Mostly it was me just having a bit of fun with the sdk and simulator, as it will be a while before I get actual hardware.

Anyhow, I did have fun, and that was the main thing, right? :slight_smile:

3 Likes

My thread you link through to is really just pseudo-3D in Pulp, the much more basic alternative to the full SDK - this here is a lot more impressive! (You might be more interested in seeing this lit raycaster demo which might give you some ideas about shading at distance? I found it pretty mind-blowing!)

I kind of think you could do some interesting things with the black/white barcode effect you have though. If you broke up the vertical lines and had them cascade down it might make a kind of matrix-y effect, that could be cool.

What algorithms are you using for maze generation and solving? I spent a little time learning about the different options for my project, but Pulp not supporting arrays limited my options so I only implemented binary tree and Aldous-Broder (sort-of) :smile: You have a lot more freedom with the SDK of course!

Oh that looks awesome, and was kinda where I would have went next (I have done ray casting before, and know where to hook it in, this was just me messing around. Seeing that, I can give up and go home now :slight_smile:

I can't remember which algo it was, I found a page of 'maze solving strategies' and implemented one. I can share the code if you want.
As for generating it, it is the standard carving method.