SAILORS Tutorial: Graph Search Algorithms
The content of this tutorial is from Amit Patel's
Introduction to A*.
Movement costs
So far we’ve made step have the same “cost”. In some pathfinding scenarios there are different costs for different types of movement. For example in Civilization, moving through plains or desert might cost 1 move-point but moving through forest or hills might cost 5 move-points.
| Terrain | Cost | |
| plain | 1 | |
| hill | 5 | |
| wall | Infinity |
We’d like the pathfinder to take these costs into account. Let’s compare the number of steps from the start with the distance from the start:
Number of steps
Distance