So basic approach to following someone else is to make a path between the follower and the target every time the target moves. However I can see this being very inefficient, so is there some best practice around doing this?
I assume there is a way to update an existing path to change its end points in some way but not sure what is the best way to do so? and even if there is if this is the best way to deal with this sort of thing.
Generally that is not a problem unless you have a huge number of characters.
Calculating a path usually doesn’t take more than a millisecond (depending on graph type and complexity it can vary quite a lot, check the debugging information logged in your game for the exact numbers). I usually set up characters to recalculate the path every 0.2-1.0 seconds (depending on the need), and since the system is multithreaded path calculation times is very seldom a problem unless you have lots of characters.
The built in ai scripts have support for recalculating the paths every [X] seconds.
To update an existing path without recalculating everything is possible technically, but the algorithms are quite complex and it is generally not worth the trouble.
The only reason I was thinking about the using existing path was because in the following scenario there is an assumption that the current path to date is still valid its just additional nodes on the end, although there is a chance they would backtrack which would make the path require previous node traversals.
If it is best practice to just re-calculate then I will just do that, is it better to destroy the current path and make a new one or just change the end point of the current path and refresh it all? (as I believe that is possible right?)
OH and also can you do multi target path without a seeker?