Knob

Path cost

You might say: movement cost, traversal cost, danger cost

The accumulated price assigned to a route, including distance, terrain, time, danger or other tactical preferences.

What it does
Makes the shortest route mean the route the AI actually wants, not merely the route with the fewest graph steps.
Ask
What should this unit prefer, avoid or pay extra for along the route?
Typical
Distance-only costs, terrain and traversal costs, or combined costs that include danger and tactical preferences.
Trouble
A cheap route crosses an obvious hazard, a small weight dominates every choice, or costs change without invalidating the route.

What to look for

  1. A heatmap of terrain costs
  2. A route that avoids danger despite being longer
  3. A cost breakdown beside the chosen path

Sources

  1. Amit Patel, Introduction to the A* Algorithm, Movement costsIn some pathfinding scenarios there are different costs for different types of movement.
  2. Amit Patel, Introduction to the A* Algorithm, Movement costsMovement costs can also be used to avoid or prefer areas based on proximity to enemies or allies.

Use it on your project

teardown-apply: hold "Path cost" (path-cost) from the teardown at https://teardownatlas.com/game-ai/ against my project

Paste it into a coding agent that has the teardown skills.

An AI agent wrote this map with the teardown skill. It can contain errors: check the sources before you rely on a part. About and legal