Amit Patel, a game programmer, hosts a long-running Stanford-hosted site of game programming pages, especially on A* pathfinding and heuristics.
HN commenters recommend his A* pages as a great introduction and the standard reference for game pathfinding.
Here are some benchmarks on sorting:
http://theory.stanford.edu/~amitp/rants/c++-vs-c/
Besides that, custom C vs. STL comparisons would need to be done case-by-case. Admittedly, an all-encompassing statement "STL is always faster than C" is unreasonable. It depends entirely on the situation and what you are trying to do. I'm simply saying that it is very difficult and probably more time consuming than it is worth (for MOST cases) to try to beat STL in C++. When I used to do lots of graphics programming I tried (mostly out of curiosity), but I always ended up just using STL.
But maybe your experiences are different? Do you write your own arrays, hash maps, and sorting algorithms each time you use them? There are times when code reuse is A Good Thing. Like when the difference is negligible and it enables you to dedicate time to more valuable things, like building product features that users want. When it comes down to it, everything is always a matter of time.
Please explain what you mean when you say "C++ doesnt enable code reuse, it merely encourages it". Just curious..
Nice! There's a few techniques that I remember when doing something similar. Subgoal graphs [0], using precalculated landmarks in the heuristic [1], and theta* [2] may be worth looking into. A bunch of other variations and techniques are on the Red Blob Games site [3]. Also the priority queue implementation you use can really impact performance if it's not done well.
[0] https://www.gameaipro.com/GameAIPro2/GameAIPro2_Chapter15_Subgoal_Graphs_for_Fast_Optimal_Pathfinding.pdf
[1] https://www.redblobgames.com/pathfinding/heuristics/differential.html
[2] https://web.archive.org/web/20190717211246/http://aigamedev.com/open/tutorials/theta-star-any-angle-paths/
[3] https://theory.stanford.edu/~amitp/GameProgramming/
Dijkstra’s algorithm is not what you would use for efficient path finding. See http://theory.stanford.edu/~amitp/GameProgramming/#pathfinding for details.
I think the biggest problem is collisions with other moving objects. I haven’t seen any library which solves this in a general manner for all kinds of games since they have different strategies. In Starcraft the most efficient way for a group of units to pass a bridge might not be the best one (e.g. sending fast and weak units first without any defense).
Nowadays I don’t know of any bigger game with particular bad pathfinding, though.
I feel like making this multithreaded is a bit overkill. Or at least it should have presented a situation with many more units.
I made an RTS in C++ a while ago and was able to build paths for many units per frame on a fairly large map. And even if I couldn't, there's many optimizations I would have considered before threading, like only building a partial path based on portals. Or building a "bad" path and simplifying it on future frames.
Here's a great A* references with a bunch of helpful tricks: http://theory.stanford.edu/~amitp/GameProgramming/
Nice and simple, but I’m a big fan of Amit Patel / Red Blob Games articles on the subject, and more. The interactive visualisations really drive the point home, and also tackle less usual stuff like hex grids and circular objects in dedicated articles.
Introduction:
https://www.redblobgames.com/pathfinding/a-star/introduction.html
Much, much more, with in depth notes, variants, optimisations, moving targets and obstacles...:
http://theory.stanford.edu/~amitp/GameProgramming/
And other intriguing articles:
https://www.redblobgames.com/
I was going to challenge you, since I thought that was going to be the older http://theory.stanford.edu/~amitp/GameProgramming/AStarComparison.html reference which I never found very helpful. The best intro I had to these was in a Game AI course and we basically implemented all these visualizations and more (bad screenshot: http://www.thejach.com/imgs/visibility_with_astar.png) to fully understand it. But the newer reference you linked is great and I'd agree it's the best public introduction.