Source character.
Target point/character.
Minimum distance between points such that REA* should be applied.
Simple A* is actually more efficient for short paths depending on the room size.
Recalculates the path to the target.
Graph on which to calculate the path.
Whether to apply fallback behavior (i.e. plain A*).
Determines whether to recalculate the path.
Generated using TypeDoc
Standard path following strategy.
This strategy controls the path discovery from a Game_Character source to either a point or Game_Character target.
It will use REA* when possible to generate better-than optimal paths and fallback to simple A* when it fails to derive a full path from that approach.
This strategy completes once the source character reaches the desired target EXACTLY. Touching an event does not count as completing the full path. It will keep looking for paths until it is completed.
To avoid running the full pathfinding algorithm at every frame, the strategy will only recalculate it when it receives a failure signal (i.e.
onFail
) or the target's position changes (so be cautious when using it on moving events).Paths are limited to 128 steps for REA* and 32 for plain A* to avoid lagging. Some optimizations are applied to avoid running to far when the target is close to the source.
LoopingStrategy