28.10.2014, 01:13
(
Последний раз редактировалось Mauzen; 28.10.2014 в 02:10.
)
Quote:
|
It's kinda explainable, as the A* algorithm keeps searching until a paths is found OR all nodes have been accessed, considering the gta map is about 6000x6000m, divided into small pieces, that can take some little more memory and CPU to process. As for Dijkstra algorithm it doesn't matter, the searching time is consistent because it always checks all nodes.
![]() |
Nodes are generated in-time, as it recursively adds neighbors to the pool. A closed and disconencted roof would only contain a tiny amount of nodes compared to an open road, so there isnt much to check and it should rather be faster.
I didnt take a look at his algorithm yet in the new version, but it wasnt such a drastic difference in the previous version. So Id guess theres some kind of bug.
Edit: Manual backtracking seems to help in case of small disconnected areas. Swapping the start and destination, so it finds the way the other way round, and so will run out of nodes much faster when starting in the disconnected area. Just needs some extra attention as youll need to add the final node / original target point yourself, as the starting point of the calculation normally doesnt have to be added to the resulting path nodes.
Depends on what you use it for though which way would be faster on average.



