Jump to content
  • entries
    106
  • comments
    796
  • views
    140,987

Now With Mazes


vdub_bobby

2,227 views

BEEN PRETTY BUSY WITH RL over the last week, but found a few hours here and there to work out the code to generate mazes programmatically:

blogentry-6060-0-89447200-1328508942_thumb.pngblogentry-6060-0-49483900-1328508943_thumb.pngblogentry-6060-0-15216200-1328508944_thumb.png

TankMaze20120205.bin

 

To my surprise, I was able to get something working that actually doesn't look too bad. The algorithm is roughly based on the so-called "sidewinder" algorithm, though with some tweaks. To geek out about this for a minute, it is a pet peeve of mine that every maze-generation algorithm i've ever seen always works on the assumption that the walls have no width, and it takes a lot of hacking and messiness to get them to work with mazes where the walls have width. But anyway, after a lot of hacking and messiness I did get it to work, and it ain't too bad. ;)

 

EDIT: Forgot to mention :dunce: press RESET to switch through mazes.

4 Comments


Recommended Comments

Looks very good - I assume you have 8 seeds hardcoded at the moment?

How are you going to protect the home base - will this have a wall around it also?

 

Chris

Link to comment

it is a pet peeve of mine that every maze-generation algorithm i've ever seen always works on the assumption that the walls have no width

 

Yep, I ran into the same issue when trying to create mazes for Skeleton. I ended up creating my own algorithm to fit my particular requirements (e.g. no open areas & wrap around).

 

One trick I used is to have two starting points for the "random walk" which then became the starting points for the player and the skeleton. You might want to do the same.

Link to comment

Not sure about protecting the base. As the kernel is written, it isn't possible to have walls to the left/right of the base. My plan was to leave it completely open, but that might make the game too difficult.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...