This demo shows a dynamic weighted abstraction. The underlying map is abstracted for pathfinding speed. The
abstraction is updated dynamically as the map is changed. In the abstraction, terrain types are explicitly
represented in the abstraction, making it possible to plan for any cost algebra without changing the
abstraction. That is, each type of character can have different costs for different types of terrain traversal
but use the same abstraction for planning.
For simplicity, you can plan with the following cost models:
Human: Road < Ground < Water < Trees = Swamp
Jesus: Road = Water < Ground < Trees = Swamp
Sheep: Road = Ground < Trees < Water = Swamp
Deer: Trees < Ground < Road < Water = Swamp
Choose a terrain type and paintbrush size to draw on the map
Toggle whether the abstraction is drawn
Choose a cost model and a path to see resulting paths
The red path is the optimal path on the map. The purple path is the optimal path in the abstraction.
(In practice the abstract path is refined into a smoother path on the map, but, for clarity of visualization, this step is not drawn.)