Save-Point

Full Version: ForeverZer0's Pathfinding Advanced
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
ForeverZer0's Pathfinding Advanced
Version: 1.0r


Introduction
This is an advanced an highly inteligent pathfinding system. It allows for the user to either, through script or script call, quickly and easily have events or the game player automatically walk a path to a given set of coordinates. The system is smart enough to quickly find paths through relalatively complex areas, and asjust on the fly for any obstacle that moves to block its path. I used the A* algorithm, basic search algorithm used often for robotics. More on this algorithm can be read about here:

http://en.wikipedia.org/wiki/A*_search_algorithm



Features
  • Fast and intelligent pathfinding
  • Easy to use script calls
  • Optional "range" parameter can have character find alternate locations if the preferred one is blocked and they are within the given range.
  • Optional Proc Class defined callbacks can be given to have something execute if when the character reaches its goal, or when it fails to do so.
  • Compatible Near Fantastica Pathfinding v1 methods included:
    • find_path(x, y)
    • clear_path



Screenshots
None. Its characters moving around the screen.



Demo
None.



Script
The Header and Instructions
The Engine Code



Instructions
Paste Below Scene_Debug and above Main. Likely, it will need be above other scripts or script-sets that utilize pathfinding codes or algorythms.



Compatibility

Designed for RPGMaker XP. Consistent with Ruby 2.7 Coding Standards.

Highly compatible. May experience issues with Custom Movement scripts, but even then, it is unlikely.



Credits and Thanks
  • ForeverZer0, for the original script
  • Special thanks to Jragyn for help making the big maze for the demo and help testing.
  • Credit goes to the Peter Hart, Nils Nilsson and Bertram Raphael for the original search algorithm that was implemented



Author's Notes
I was asked to look into the original work as it had issues with move routes that were blocked/impeded which brought up critical errors. It pretty much involved a couple lines of code added just to exit methods before the errors occurred.

Three of the original script calls have now been passed into the Interpreter class to make it cleaner from a user's perspective. And more safeguard measures and default options were added.

And a lot of the language within the Instruction/Header page is mostly the same as the original. Only that some instructions were made clearer.



Terms and Conditions
Free for use, even in commercial scripts. However, I require due credit for myself and all others listed in Credits/Thanks.