Steering Behaviors
My new variant of the A* algorithm is 2x faster. I never saw anything faster among Java codes available on Internet. Only a conversion to C could perform better but it's fast enough in Java for almost all needs.
I also added a few things to customize even more the algorithm.
v2.3 (for donors only):
- I greatly improved the performance of the A* algorithm in SB_PathFinder;
- I added HEURISTIC_CHEBYSHEV to SB_PathFinder;
- I added HEURISTIC_NONE to SB_PathFinder (turns the A* algorithm into a Dijkstra algorithm);
- I added a DiagonalMove parameter to SB_PathFinder.CreateGrid;
- I added TotalCost to SB_PathFinder to get the total cost of a path;
- I replaced COST_GRID by COST_GRID_DIAG_DOUBLE, COST_GRID_DIAG_SAME and COST_GRID_DIAG_SQRT in SB_PathFinder.