Pathfinding : Jump Point Search - Straight Moves vs Diagonal Moves

Started by
1 comment, last by PhilLiu 11 years, 10 months ago
Hi community,
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!
Advertisement
Noone ?
Your question is not very clear. It seems that you are trying to generate a path from point A to point B when B is only accessible from A via a diagonal jump?

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.

This topic is closed to new replies.

Advertisement