Perfect Maze Generation

About Monkey 2 Forums Monkey 2 Code Library Perfect Maze Generation

Tagged: 

This topic contains 3 replies, has 3 voices, and was last updated by  impixi 1 year, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #8561

    impixi
    Participant

    The following example generates a “perfect maze” within a 2d bool array using an iterative, depth-first technique. (I sometimes use the approach as a basis for some types of procedural dungeons.)

    Theory:

    https://en.wikipedia.org/wiki/Maze_generation_algorithm

    #8563

    Ethernaut
    Participant

    Yay, code snippets! Thanks for sharing.

    #8809

    peteswansen
    Participant

    Thanks Impixi, this is the first piece of Monky 2 code I was ever able to compile!

    The mazes it makes are not quite complete- they have numerous “dead” ends and there is no single complete path from one side to the other-  in other words, there is not one entrance and one exit.

    A shame there  is only 10 examples of code and over 1800 posts looking for help with Monkey 2.

    #8810

    impixi
    Participant

    @peteswansen:

    The mazes it makes are not quite complete- they have numerous “dead” ends and there is no single complete path from one side to the other- in other words, there is not one entrance and one exit.

    The code generates “perfect” mazes, meaning every coordinate is reachable from every other coordinate within the maze. There are many types of mazes. See here:

    http://www.astrolog.org/labyrnth/algrithm.htm

    A shame there is only 10 examples of code and over 1800 posts looking for help with Monkey 2.

    The “Monkey 2 Code Library” forum is only a week old. More examples will be posted over time. Personally I have more examples to post when I tidy up my code, but at the moment I’m too busy working on other projects.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.