Pathfinding : Jump Point Search - Straight Moves vs Diagonal Moves,
Members - Reputation: 127
Posted 27 May 2012 - 02:58 AM
I'm new here, so please be gentle...
Planning working on a 2D RTS, I tried to learn how Astar works.
Indeed, I found articles explaining how Astar could be optimized coupling it with binary heaps,
and algorithms taking advantages of Path symmetry, like Jump Poin Search algorithm.
I made my own implementation and it happened to run fine.
I even made some benchmarks tests with maps from MovingAI Labs.
Yet there is a problem. Everything runs fine when diagonal moves are allowed.
When disabled, no path is returned when the case it involves a diagonal move....
It may be linked to the way I implemented it, then I'm all asking...
In general, how would you oblige the algorithm (JPS) to search for path involving only straight moves (not diagonals moves) to reach a goal ?
Thanks in advance!
Members - Reputation: 119
Posted 28 May 2012 - 07:56 AM
If so, there exists no path containing of only vertical and horizontal movements that get you from point A to point B, so your algorithm is correct to return no path.