Right now, we perform a full pathfinding operation each update. We should instead just verify the path is still good most of the time.
E.g., every two seconds we do a full pathfinding operation. Every other update, we trace the path waypoints until we're at least one second away. We then do a pathfinding operation to said node. If it matches, we continue on our path. If it does not match, we recalc the entire path.
Right now, we perform a full pathfinding operation each update. We should instead just verify the path is still good most of the time.
E.g., every two seconds we do a full pathfinding operation. Every other update, we trace the path waypoints until we're at least one second away. We then do a pathfinding operation to said node. If it matches, we continue on our path. If it does not match, we recalc the entire path.