Hello guys,
I am coming back. Now I am working on some optimization stuff.
My Cooperative pathfinding starts working pretty *decently* at the moment.
But One problem still persists, is when the corridor is seriously congested and there is no way out.
One of the agents would keep looking at the opened list non-stop. As
It keeps deleting node and re-inserting the same node where
the current path score is better than the neighbour's score.
It keeps spinning and it doesn't seem to think it's time to give up.
I don't know, my opened list always has about 1000 elements inside.
I think there should be a decreasing number where less and less nodes
are usable. In fact, after 150000 iterations, it still has 1000 usable nodes
in the opened list which is quite hairy. I think it should have given up at a earlier time.
I use raft's code where for optimization purposes, I got 1 set for ranking and 1 linear array
for searching. It's good and on average just takes about 1 sec to solve a path.
What I did was when the score of the current node + the neighbour cost is less than the neighbour g score,
I delete that node and update it and add it back in. How can I make TimeAStar stop running at a reasonable amount of time
I don't want the thread to freeze while just waiting on one agent.
Just wondering for the closed list, I can reuse the timeastar id when the pool is not empty. The pool is accumulated from the usedNodes.
So there will be some nodes to be reused on every iteration.
So timeastar id will not rise rapidly anyways. and sometimes, the closed list will be skipped because of that...
But is the opened list the same? the Opened List seems to be checking the identity of the object.
Is that right?
BTW: Do I have to clear the pool anyways for each iteration? I find the closed list skips keep accumulating for agent after agent.
Thanks
Jack