Sign in to follow this  

maze generator

This topic is 4479 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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/

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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/

Share this post


Link to post
Share on other sites
Sign in to follow this