Optional
avoidOptional
avoidAutomatically populates cost matrix with structure positions.
Optional
avoidBy default, portals are used for travel if they are the shortest path. Set this to true to avoid using portals for travel.
Optional
avoidAlways path around Source Keeper-protected resources.
Optional
avoidGradient 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.
Optional
avoidTargets for dynamic avoidance - will re-route to path around avoidance regions if they intersect with creep's current path
Optional
cacheCaching strategy to use to save paths. Defaults to HeapCache.
Optional
creepCreep used capacity and body, used to calculate default terrain costs.
Optional
defaultDefault cost for a room in findRoute callback (may be overridden if routeCallback is provided). Defaults to 2.
Optional
fleeInstead 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.
Optional
heuristicWeight 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.
Optional
highwayCost for a highway room in findRoute callback (may be overridden if routeCallback is provided). Defaults to 1.
Optional
ignoreBy 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.
Optional
keepIf target range would extend out of the target room, trim to keep target in room
Optional
maxThe 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.
Optional
maxThe 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.
Optional
maxThe 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.
Optional
maxThe maximum allowed rooms to search. The default (and maximum) is 16.
Optional
plainCost for walking on plain positions. The default is 2.
Optional
priorityMovement priority (higher-value moves override lower-value moves). The default is 1.
Optional
repathNumber of ticks to wait for a creep to become unstuck before repathing with the fallbackOpts. Default is 3.
Optional
reuseNumber of ticks to save a cached path before repathing. If undefined, cached path will be reused indefinitely. Default is undefined.
Optional
roadCost for walking on road positions. The default is 1.
Optional
routeThis callback works like the builtin findRoute
and will override
the default values for highway/source keeper room cost unless you
return undefined
.
Optional
sourceCost for a Source Keeper room in findRoute callback (may be overridden if routeCallback is provided). Defaults to 2.
Optional
swampCost for walking on swamp positions. The default is 10.
Optional
visualizeIf set, will visualize the path using provided styles.
Optional
roomRequest 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.
Generated using TypeDoc
Automatically populates cost matrix with creep positions.