Interface MoveToConfig

Hierarchy

  • MoveToConfig

Properties

Algorithm to use for pathfinding.

considerCosts?: boolean

Only considered by A* algorithm. If set to true, pathfinding will consider costs. Costs are set via tile properties.

Default

false
ignoreLayers?: boolean

If set to true, pathfinding will only be performed on the char layer of the start position. If you don't use char layers, activating this setting can improve pathfinding performance.

Default

false
isPositionAllowedFn?: IsPositionAllowedFn

Function to specify whether a certain position is allowed for pathfinding. If the function returns false, the tile will be consindered as blocked.

It can be used to restrict pathfinding to specific regions.

Beware that this method can become a performance bottleneck easily. So be careful and keep it as efficient as possible. An asymptotic runtime complexity of O(1) is recommended.

maxPathLength?: number

If this is set, the algorithm will stop once it reaches a path length of this value. This is useful to avoid running out of memory on large or infinite maps.

noPathFoundMaxRetries?: number

Only relevant if noPathFoundStrategy is set to RETRY.

It sets the maximum amount of retries before giving up.

noPathFoundRetryBackoffMs?: number

Only relevant if noPathFoundStrategy is set to RETRY.

It sets the time in milliseconds that the pathfinding algorithm will wait until the next retry.

noPathFoundStrategy?: NoPathFoundStrategy

Determines what happens if no path could be found. For the different strategies see NoPathFoundStrategy.

pathBlockedMaxRetries?: number

Only relevant if pathBlockedStrategy is set to RETRY.

It sets the maximum amount of retries before giving up.

pathBlockedRetryBackoffMs?: number

Only relevant if pathBlockedStrategy is set to RETRY.

It sets the time in milliseconds that the pathfinding algorithm will wait until the next retry.

pathBlockedStrategy?: PathBlockedStrategy

Determines what happens if a previously calculated path is suddenly blocked. This can happen if a path existed and while the character was moving along that path, it got suddenly blocked.

For the different strategies see PathBlockedStrategy.

pathBlockedWaitTimeoutMs?: number

Only relevant if pathBlockedStrategy is set to WAIT.

It sets the number of milliseconds that the pathfinding algorithm will wait for the path to become unblocked again before stopping the movement.

targetLayer?: string

Char layer of the movement target. If there is no targetLayer provided, the current char layer of the moving character is used.

Generated using TypeDoc