Current Project: Pathfinding

Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player

Pathfinding is the process of searching possible routes to a goal and figuring out the best available path around obstacles. I was initially introduced to the fundamental concepts from "A* Pathfinding for Beginners" by Patrick Lester, but I've branched off and omitted some things (for instance, all valid routes in my program cost the same to move through. I have yet to incorporate varied movement costs into the program). Currently, I am working through the following:

  • "Line of Sight" Checking. At the moment, if a wall is narrow enough, the points along the path will jump over the wall, making an invalid move.
  • Improved Path Refinement. The green circles along or near a path have been eliminated to shorten the route. Some remaining points along the path are still inefficient (for instance, the pathfinder backtracks sometimes)
  • This version is based on a grid pattern, though the program was initially written to allow for as many points as desired, all along the circumference of a circle around the pathfinder. The grid pattern made it easier to run through path checks such as whether or not a point has already been passed over. The next goal is to build a "radial" pathfinding program, but it would rely heavily on the "Line of Sight" check systems, so I am finishing that first.

Drag the wall object or the goal star around the screen to set up an enviroment for the pathfinder and then click start. Once the pathfinder locates the goal, the goal is randomly placed somewhere else. If you move the goal, the pathfinder will reestablish a better path.