Skip to content

Commit

Permalink
nyan: Document pathfinding types in API reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
heinezen committed Jul 28, 2024
1 parent f893634 commit f387702
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions doc/nyan/api_reference/reference_ability.md
Original file line number Diff line number Diff line change
Expand Up @@ -676,28 +676,6 @@ Temporarily replace the map terrain the game entity is positioned on with a spec
**terrain_overlay**
Terrain that is temporily replaces the existing map terrain.

## ability.type.Pathable

```python
Pathable(Ability):
hitbox : Hitbox
path_costs : dict(children(PathType), int)
```

Lets a game entity influence the pathing costs on the (static) pathfinding grid.

This ability should only be used for game entitie that never (or rarely) change positions as pathfinding grid recalculations are expensive. For dynamic pathfinding effects, using the `Collision` ability should be preferred.

**hitbox**
Hitbox around the game entity that affects the underlying pathfinding grids. All grid cells that are covered by this hitbox ae influenced by the cost definitions in the `path_costs` attribute.

**path_costs**
Costs of traversing the area defined by the `hitbox` attribute on the pathfinding grid.

Keys are `PathType` objects that are associated with a pathfinding grid in the pathfinder.

Values represent the pathing cost for the terrain on the pathfinding grid. Each value must be an integer between `1` and `255`. `1` defines the *minimum* possible cost and `254` represents the *maximum* possible cost. `255` signifies that the terrain is impassable for the specified path type.

## ability.type.PassiveTransformTo

```python
Expand All @@ -722,6 +700,28 @@ State change activated after `transform_time` has passed.
**transform_progress**
Can alter the game entity while the transformation is in progress. The objects in the set must have progress type `Transform`.

## ability.type.Pathable

```python
Pathable(Ability):
hitbox : Hitbox
path_costs : dict(children(PathType), int)
```

Lets a game entity influence the pathing costs on the (static) pathfinding grid.

This ability should only be used for game entitie that never (or rarely) change positions as pathfinding grid recalculations are expensive. For dynamic pathfinding effects, using the `Collision` ability should be preferred.

**hitbox**
Hitbox around the game entity that affects the underlying pathfinding grids. All grid cells that are covered by this hitbox ae influenced by the cost definitions in the `path_costs` attribute.

**path_costs**
Costs of traversing the area defined by the `hitbox` attribute on the pathfinding grid.

Keys are `PathType` objects that are associated with a pathfinding grid in the pathfinder.

Values represent the pathing cost for the terrain on the pathfinding grid. Each value must be an integer between `1` and `255`. `1` defines the *minimum* possible cost and `254` represents the *maximum* possible cost. `255` signifies that the terrain is impassable for the specified path type.

## ability.type.ProductionQueue

```python
Expand Down

0 comments on commit f387702

Please sign in to comment.