OptionalavoidOptionalavoidAutomatically populates cost matrix with structure positions.
OptionalavoidBy default, portals are used for travel if they are the shortest path. Set this to true to avoid using portals for travel.
OptionalavoidAlways path around Source Keeper-protected resources.
OptionalavoidGradient for avoid targets - by default, tiles within an avoidTarget will be set to 254, but if a gradient is set, the cost will decrease by (gradient * range) for each tile away from the target.
OptionalavoidTargets for dynamic avoidance - will re-route to path around avoidance regions if they intersect with creep's current path
OptionalcacheCaching strategy to use to save paths. Defaults to HeapCache.
OptionalcreepCreep used capacity and body, used to calculate default terrain costs.
OptionaldefaultDefault cost for a room in findRoute callback (may be overridden if routeCallback is provided). Defaults to 2.
OptionalfleeInstead of searching for a path to the goals this will search for a path away from the goals. The cheapest path that is out of range of every goal will be returned. The default is false.
OptionalheuristicWeight to apply to the heuristic in the A* formula F = G + weight * H. Use this option only if you understand the underlying A* algorithm mechanics! The default value is 1.
OptionalhighwayCost for a highway room in findRoute callback (may be overridden if routeCallback is provided). Defaults to 1.
OptionalignoreBy default, portals will be blocked in the cost matrix if we aren't traveling through them to avoid ending up somewhere random. Set this to true to ignore portals in the cost matrix. This does not affect travel through portals.
Warning: This only applies to intrashard portals. Intershard portals will not be automatically blocked in the cost matrix regardless of this setting.
OptionalkeepIf target range would extend out of the target room, trim to keep target in room
OptionalmaxThe maximum allowed cost of the path returned. If at any point the pathfinder detects that it is impossible to find a path with a cost less than or equal to maxCost it will immediately halt the search. The default is Infinity.
OptionalmaxThe maximum allowed pathfinding operations. You can limit CPU time used for the search based on ratio 1 op ~ 0.001 CPU. The default value is 2000.
OptionalmaxThe maximum allowed pathfinding operations per room (if maxOps is higher for a short path, PathFinder will use the lower). You can limit CPU time used for the search based on ratio 1 op ~ 0.001 CPU. The default value is 2000.
OptionalmaxThe maximum allowed rooms to search. The default (and maximum) is 16.
OptionalplainCost for walking on plain positions. The default is 2.
OptionalpriorityMovement priority (higher-value moves override lower-value moves). The default is 1.
OptionalrepathNumber of ticks to wait for a creep to become unstuck before repathing with the fallbackOpts. Default is 3.
OptionalreuseNumber of ticks to save a cached path before repathing. If undefined, cached path will be reused indefinitely. Default is undefined.
OptionalreverseOptionalroadCost for walking on road positions. The default is 1.
OptionalrouteThis callback works like the builtin findRoute and will override
the default values for highway/source keeper room cost unless you
return undefined.
OptionalsourceCost for a Source Keeper room in findRoute callback (may be overridden if routeCallback is provided). Defaults to 2.
OptionalswampCost for walking on swamp positions. The default is 10.
OptionalvisualizeIf set, will visualize the path using provided styles.
OptionalroomRequest from the pathfinder to generate a CostMatrix for a certain room. The callback accepts one argument, roomName. This callback will only be called once per room per search. If you are running multiple pathfinding operations in a single room and in a single tick you may consider caching your CostMatrix to speed up your code. Please read the CostMatrix documentation below for more information on CostMatrix.
The name of the room the pathfinder needs a cost matrix for.
Automatically populates cost matrix with creep positions.