Jump to content
  • Advertisement
Sign in to follow this  
mike74

maze generator

This topic is 4766 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

Advertisement
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
I created a version that creates thick walls. It's good for a tiled map.

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

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
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.

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  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!