erodozer / FF1-Battle-System

A simple recreation the FF1 Battle System in java for my design patterns class.
29 stars 6 forks source link

Pathfinding #19

Open erodozer opened 12 years ago

erodozer commented 12 years ago

Add a simple pathfinding system using Dijkstra's algorithm for npcs to use.

When called it should generate the optimum path from a passability adjacency matrix from tiles and npcs. Only time it should reupdate before the npc reaches the end of their path is if going to the next tile in the optimum path it is suddenly blocked (usually caused by another npc stopping on the path) but make sure to wait a tick first in case the other npc would move off in that time before recalculating the optimum path.

Optimum path should be saved into a list, popping each location after moving. If recalcuating occurs, just take the first and last index and run dijkstra's from that start to end point.