maze generator

Started by
7 comments, last by mike74 18 years, 7 months ago
I made a maze generator. It's at http://www.coolgroups.com/mazegen/ if you're interested.
Mike C.http://www.coolgroups.com/zoomer/http://www.coolgroups.com/ez/
Advertisement
Cool.

Now the next step is to turn it into a dungeon generator. [smile]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
hmm, i could perhaps have a use for this. but i don't have thin walls in my game. i have potentially thick hills and houses. i was originaly going to just design the map (one map for a start) by hand but a generator would be great to extend the player experience.
It's not hard to convert to thick walls. Just take each cell of the maze and convert it to a 3x3 set of squares. For instance, if a cell has a right wall and bottom wall, it would convert like so.

oox
oox
xxx

where o is empty space and x is a square for a 2d game or a cube for a 3d game.

mike
http://www.coolgroups.com/
Mike C.http://www.coolgroups.com/zoomer/http://www.coolgroups.com/ez/
I created a version that creates thick walls. It's good for a tiled map.

It's at http://www.coolgroups.com/blockmaze/.

Mike C.http://www.coolgroups.com/zoomer/http://www.coolgroups.com/ez/
This looks interesting. I might be able to use it. Here is an applet version of what I am creating. The mountains and graphics are crap at the moment. I am just trying out a few techniques.

http://mxbdesigns.streamlinetrial.co.uk/RedRiddingHood/bin/RedRiddingHood.html

My map is tiled roughtly at the scale of the size of the character in middle which you can move.

I will need a bit more open maze however.

Regards, Martin.
Now expand the maze to n-dimensions. [smile]

It's actually been done. (You can find a screenshot under "Game Screenshots" for "5D Mazes")
Thanks. I had a look at the maze generator and i have to say that it looks pretty well advanced. I will have to look into this further when I have more time.

Cheers, martin.
It's actually pretty basic as to how it works.

It starts out with a grid of blocks with walls in-between.

It just picks out a block (block 0, 0 for starting) and sees if there are unvisited neighbor blocks. If so, it picks a random one and punches out the wall. Then it visits that block.

If there are no blocks that it can move to from a particular block, it goes to a previously visited block and tries.

Once it's back at the first block and it can't move, then every block has been visited.

mike
http://www.coolgroups.com/
Mike C.http://www.coolgroups.com/zoomer/http://www.coolgroups.com/ez/

This topic is closed to new replies.

Advertisement