Well, im having some problem, i have a hero which i controll and have some minions in the game, its like a MOBA game, when i click to move my hero and nobody is requesting a path its perfect, but when the minion gets close to the hero, he stop following the path and go for the hero direction, but if the hero gets a distance, the minion request a new path and if i try to move my hero in this time, the hero only get a new path when all minions get a path, and sometimes its something around 1-2 seconds, i have the pro version, i tought the multithread would help that.
Hi
Not sure how many minions you have, but it really sounds like you should change your graph structure. If you are using a grid graph, consider changing to a recast graph or to reduce the resolution of it.
Multithreaded will indeed help, but it cannot solve everything.
You can put in priority requests to the AstarPath.StartPath method. There is a parameter called “pushToFront”, if that is true, then this path request will bypass the queue.
However it is not exposed through the seeker interface, so either you can modify the seeker code slightly to add that parameter to the Seeker.StartPath method, or you can request a path directly from AstarPath.StartPath and then call Seeker.PostProcess (path) to do the stuff the seeker usually does (applies modifiers and similar).
Hi Aaron,
I am having the same issue . Can you please show how to modify the seeker to accomplish this? Wouldn’t it be easier to have a public priority field within the seeker?
Hi
The Seeker requests a path using the AstarPath.StartPath call. That method has an optional argument called pushToFront. If that argument is true, then the path will be calculated before every other path. Note that it is usually best to just let it be a queue since otherwise some other path requests might get very large delays.
If you are not using multithreading (A* inspector -> Settings), then I strongly suggest that you enable that to get better performance.
Thanks I did not notice! That surely helps.
I set it to automatic low to cover most machines.