-
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache pathfinding results to speed up calculations #1541
Conversation
…athfinding-array # Conflicts: # src/fheroes2/maps/maps_tiles.cpp
Hi @idshibanov , is it ready for review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @idshibanov , looks great! Could you please take a look into my comments and discuss if you have any questions?
It is ready now. Removed the old and debugging code as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @idshibanov , I left just one comment. Could you please take a look into it?
…2.git into pathfinding-array
Hi @idshibanov , I tested the changes. I can see a noticeable delay when I switch to a hero which can walk for a long distance. I'm just curious: can we make a usage of distance in this case? For example, once we switch to a hero we calculate every possible path based on a current area to show, then we add more and more points when we try to calculate longer distance... I'm just curious. From what I see in the code most likely it's not possible. |
Before the change amount of move points hero had directly affected the distance and slowness of the algorithm. Right now, it calculates everything which was reasonably fast in my tests. I can limit amount of max iterations. I think once road check will be replaced with the boolean speed of calculation will improve dramatically. |
…2.git into pathfinding-array
Hi @idshibanov , thanks a lot for your valuable contribution to the project! |
Using Djikstra-style implementation. Path/distance calculation is constant after cache initialization.