Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / How do you make an 3d maze?

Author
Message
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 21st Apr 2007 18:22 Edited at: 21st Apr 2007 18:23
Hi all.

I've got this idea for a game using Dark Physics, but to do it, I need a decent 3d maze generator. The problem is I do not even know how to start. I searched the forum for an example, and found one at this thread. However, I don't understand the code works (it gives me an headace), so if anyone could either explain it to me, or give me an leason in how to create an maze generator, I would be vary grateful. Please help me.
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 23rd Apr 2007 20:54 Edited at: 23rd Apr 2007 20:55
Ok, I've managed to create an maze-generator by myself. It will do, though it is not an very good one. If anyone have any idea about how to make it better, please post it, so I can improve the maze. Here is the code:
. Anyway, I thank you for your time.
aluseus GOD
17
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 23rd Apr 2007 23:44
Are you using any plugins?

I will Learn to rule 2d. Someday...
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 25th Apr 2007 04:33
I wrote a maze generating program in GFA Basic about 25 years ago.

If I can find it in my archives I'll have a go at converting it to DB for you if you like.

As for the method - if I remember correctly - you create a grid of walls and record the number of unvisited cells, along with all of their cell numbers.

You select one of the cells at random to start in and randomly choose which direction to remove a wall (as long as it doesn't lead to a cell you've already been in).

You then move into that cell, decrease the 'rooms left to visit' counter and add the current cell number to the record for the current path.

You repeat this until you have no more legal moves left - at which point you backstep a random number of cells along the current path - at which point you remove one of the remaining walls and start another path branch.

You effectively repeat this until the 'rooms left to visit' counter reaches 0 (zero).

If you apply this method to an array, you can use it to construct the maze in 3D using boxes.

TDK_Man

Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 25th Apr 2007 13:10
aluseus GOD, I'm using Dark Physics (I wrote that in the first post).

TDK, I don't really understand how you mean. But I might take a closer look at it later (haven't much time this week). And an example would be nice.
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 25th Apr 2007 22:13
I have made 3D maze code and posted it here.

It makes it all one object by using a memblock. Maybe this helps.

Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 28th Apr 2007 13:12
Wow, that was nice Deamon. But there is an problem for me: I've never ever created an 3d object before using memblock, and to make the code to what I want, I would need to modify it a bit. A large bit.

Login to post a reply

Server time is: 2024-09-25 21:16:43
Your offset time is: 2024-09-25 21:16:43