This demo is designed to find a path between a Start and End node. The path is calculated using the lowest scoring value of a node. The score is calculated by adding the cost and heuristic values of a node.
If there are two or more nodes with a similar score, then a random node is selected.
In this demo there is also dead end detection where if the start or end node are surrounded by blocks the pathfinding will not continue resulting in an error.
Along with this there are water and mud nodes which have higher cost values. The pathfinder tries to avoid the water and mud nodes if there is lower costing node to get to the destination. However, if there is no other way to travel, then the path traversal is slowed down based upon the cost of the water or the mud node. This demo was created using C#. Please click the link below to download a copy of this demo. Enjoy!
Download Demo
|