Jump to content
  • Advertisement
Sign in to follow this  

Maze generation algorithm for specified parts

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

I am an undergraduate student studying mechanical engineering. We are doing a project called the labyrinth cutter, we're constructing a piece of artwork consisting of a a gantry connected to a cutter head. The cutter is supposed to cut out a labyrinth to a piece of music. I decided to use the midi file of the music piece to create straight parts with certain lengths. At various beats the labyrinths changes direction. I used Java with J-music to do this and came out with 400 pieces that now have to be placed in a certain order to create a labyrinth. The lenghts of the pieces depend on the frequency of the note being played and the time between pieces. I wrote a program in c++ that uses recursive backtracking, simply trying to place piece after piece and see if it fits. Currently up to about 150 pieces is doable but after this the computation time gets way to heavy. I am wondering if anybody has an idea of a certain algorithm that could be used to solve this or point me in the right direction a bit as I'm not quite sure what I can do right now except for reducing the amount of pieces. Picture shows a solution with 150 pieces, obviously this won't fill the area. http://img89.imageshack.us/my.php?image=labyyc7.jpg Also if you have another idea of how to represent the labyrinths creation as being done to the piece of music please state your idea.

Share this post

Link to post
Share on other sites
To build a maze:
1) start from any cell
2) move in a direction, until you reach a wall or some random condition is true
3) try rotate left or right, if there is some space left
4) jump to a cell with some unvisited neighbor and break the wall between them
5) go to point 2)

What your music could control:
1) the random probability of rotating left or right, e.g.
fast music -> low probability to turn
melodic -> high probably to turn right
dark -> high probably to turn left
2) which cell you jump on (the order may lead to very different results), e.g.
classic music -> jump to the closest valid cell
electronic -> jump to a cell with big space around it

Have fun!

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!