Search Unity

automated maze exploration

Discussion in 'Getting Started' started by boolfone, Jun 25, 2016.

  1. boolfone

    boolfone

    Joined:
    Oct 2, 2014
    Posts:
    289
    I started an “autopilot” feature on my maze:

    http://coolfone.mobi/fpmaze11/

    It is activated by clicking the checkbox in the bottom left corner.

    The computer basically starts moving through the maze on its own.

    Right now, the algorithm is sort of a placeholder until I get something better. The computer won’t necessarily visit the whole maze as is.

    I was wondering if anyone has ideas how to make the computer walk thru the maze better? I want to have it cover the whole maze (i.e. pick up all the coins), and I also want it to look visually appealing for onlookers.

    Any ideas what algorithms or even Unity features I can use for this?

    Thanks.

    maze-autopilot2.jpg
     
  2. Bill_Martini

    Bill_Martini

    Joined:
    Apr 19, 2016
    Posts:
    445
    Try the 'Right Hand Rule' for mazes. Drag your right hand along the maze wall. Follow the maze and always turn right on outside corners and left on inside corners. No matter where you are in a maze you will find the exit. In your case, it will traverse the entire maze. This approach is not efficient, but does work.

    I'm sure there is a waypoint and raycast method of doing this which would allow completion in the fastest possible way.
     
  3. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Any standard graph search algorithm will do the job. I would suggest a depth first search, as this will reduce retraversal.