Lagless Path Finder
Authors: Blizzard
Version: 1.3
Type: Path Finding System
Key Term: Environment Add-on
IntroductionThis script will allow your characters to walk from point A to point B, navigating by themselves, finding the shortest path and all that without you having to manually specify their moving route. They can also navigate through dynamically changing environments or track a dynamically moving target.
This work is licensed under BSD License 2.0:
QuoteCopyright (c) Boris "Blizzard" Mikić
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
You may use this script for both non-commercial and commercial products without limitations as long as you fulfill the conditions presented by the above license. The "complete" way to give credit is to include the license somewhere in your product (e.g. in the credits screen), but a "simple" way is also acceptable. The "simple" way to give credit is as follows:
QuoteLagless Path Finder licensed under BSD License 2.0, Copyright (c) Boris "Blizzard" Mikić
Alternatively, if your font doesn't support diacritic characters, you may use this variant:
QuoteLagless Path Finder licensed under BSD License 2.0, Copyright (c) Boris "Blizzard" Mikic
In general other similar variants are allowed as long as it is clear who the creator is (e.g. "Lagless Path Finder created by Blizzard" is acceptable). But if possible, prefer to use one of the two variants listed above.
If you fail to give credit and/or claim that this work was created by you, this may result in legal action and/or payment of damages even though this work is free of charge to use normally.
Features- calculates path from point A to point B on the map
- allows immediate calculation as well as path calculation requests that are done over the course of a few frames in order to reduce lag
- supports dynamic calculation that is done every step to ensure the character reaches its targets
- can assign other characters as targets so dynamic calculation with a moving will cause the character to find the target regardless of his changed position
v1.01- fixed attempted optimizations to work properly
v1.1- added PASSABLE parameter for all path finder functions to determine how to behave when using the RANGE parameter
v1.2- added waypoints
- Game_Character#has_path_target? now returns true as well when using target coordinates instead of a target character
v1.21- added option for loose movement when target cannot be reached
- added separate option for debug messages
v1.22- fixed a problem with waypoints when using range
v1.22- fixed a problem when DIRECTIONS_8_WAY is turned on
v1.3- added new license
- added usage and crediting instructions
ScreenshotsN/A
DemoLagless Path Finder
ScriptJust make a new script above main and paste this code into it.
Script Download
InstructionsInside the script in the first comment.
Compatibility99% compatible with SDK v1.x. 90% compatible with SDK v2.x. May cause incompatibility issues with exotic map systems.
Credits and Thanks
Author's NotesThis Path Finder is a derived version of Blizz-ABS's original Path Finder. If you are using Blizz-ABS, please remove this script. Blizz-ABS has a Path Finder already built-in.
If you find any bugs, please report them here:
http://forum.chaos-project.comThat's it! Enjoy! =D