ig.CONFIG.

PATHFINDING

Pathfinding base configuration settings. IMPORTANT: Don't modify config directly! (see example)

Author:
  • Collin Hover - collinhover.com
Source:
// in order to add your own custom configuration to Impact++
// edit the file defining ig.CONFIG_USER, 'plusplus.config-user'
// ig.CONFIG_USER is never modified by Impact++ (it is strictly for your use)
// ig.CONFIG_USER is automatically merged over Impact++'s config

<static> ALLOW_DIAGONAL :Boolean

Whether to allow diagonal movement.

Default Value:
  • true
Source:

<static> AVOID_ENTITIES :Boolean

Whether to try to avoid entities in pathfinding.

Default Value:
  • true
Source:

<static> AWAY_FROM_DISTANCE :Number

How far of a distance to go when searching for flee path. IMPORTANT: it is not recommended to set this value very high, as it does not produce much better results and has a much higher performance hit.

Default Value:
  • 100
Source:

<static> AWAY_FROM_MAX_NODES :Number

Maximum number of nodes to check when searching for flee path.

Default Value:
  • 40
Source:

<static> AWAY_FROM_MIN_DISTANCE_PCT :Number

Minimum percent of search distance that path away from needs to go to be considered. IMPORTANT: set to 0 for no minimum.

Default Value:
  • 0.4
Source:

<static> BUILD_WITH_LEVEL :Boolean

Whether pathfinding is built with level. When disabled, will not build pathfinding grid, potentially saving on performance and memory footprint.

Default Value:
  • true
Source:

<static> DIAGONAL_REQUIRES_BOTH_DIRECT :Boolean

Whether diagonal movement requires both direct movements to be walkable.

Default Value:
  • true
Source:

<static> STRICT_SLOPE_CHECK :Boolean

Whether to do strict slope checking. This can sometimes help when pathfinding is getting stuck on strange slope layouts.

Default Value:
  • false
Source:

<static> TILE_DEF :Object

Default pathfinding tile definitions. Tip: settings map directly to the properties of ig.pathfinding.Node.

Properties:
Name Type Description
0 worst walkable
1 best walkable
2 good walkable
3 bad walkable
4 unwalkable
5 best jump
6 worst jump
Source:
Example
// tile definitions are plain objects
// with a variety of properties
ig.CONFIG.PATHFINDING.TILE_DEF[ 2 ] {
    // walkable state
    // when not present, assumes true
    walkable: false,
    // positive weight value
    // where higher is harder to walk
    weight: 1,
    // percent of base weight to apply
    weightPct: 0.5
};

<static> WEIGHT :Number

Base weight to apply to a node. Tip: the higher this is, the more likely a path will follow the pathfinding map.

Default Value:
  • 10
Source:

<static> WEIGHT_AWAY_FROM :Number

Base weight to apply to a node when fleeing and node would take us closer.

Default Value:
  • 2
Source:

<static> WEIGHTED :Boolean

Whether to use node weight in pathfinding.

Default Value:
  • true
Source: