Advertisement Jump to content
Sign in to follow this  

Unity Pathfinding : Jump Point Search - Straight Moves vs Diagonal Moves

This topic is 2428 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!