Cost function supplied by the game. Called for each candidate move.
Return Infinity (or any non-finite value) to mark a cell as impassable.
Costs must be non-negative.
IMPORTANT: findPath's A* heuristic assumes every step costs at least 1.
If your cost function can return values below 1 (e.g. cheap roads at 0.5),
pass that minimum as minMoveCost in FindPathOptions — otherwise returned
paths may not be optimal.
Cost function supplied by the game. Called for each candidate move. Return
Infinity(or any non-finite value) to mark a cell as impassable. Costs must be non-negative.IMPORTANT:
findPath's A* heuristic assumes every step costs at least 1. If your cost function can return values below 1 (e.g. cheap roads at 0.5), pass that minimum asminMoveCostin FindPathOptions — otherwise returned paths may not be optimal.