Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Understanding the Jump Point Search algorithm


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Markk   Members   -  Reputation: 107

Like
1Likes
Like

Posted 20 June 2012 - 02:04 AM

Hi! I'm trying to implement the Jump Point Search algorithm into Java, but having a hard time understanding one part of it.The algorithm is explained in this paper, and I'm using the source of this JPS implementation as an example.

When using my example implementation with to find the path around a wall, I get this:
Posted Image

The green and red squares represent the start and end "tiles", gray is wall, blue and lightgreen are jump points (I guess the lightgreens are in the open list, blue in the closed). Now, I get why the tiles at the green arrows came out as jump points, since they all got one forced neighbour, but can someone explain to me why the tiles at the red arrows are jump points?

Thanks!

Sponsor:

#2 bloodisblue   Members   -  Reputation: 137

Like
0Likes
Like

Posted 20 June 2012 - 08:37 AM

It seems like the algorithm used is this g(y) = g(x) + dist(x; y) so it would always attempt to go diagonally first and than level off because that would shorten the distance to the target earlier in the program. This is why the first thing the algorithm would do is go diagonally until it reaches either the end of the wall or the goal node and than continue going horizontal.

#3 pithlit   Members   -  Reputation: 179

Like
1Likes
Like

Posted 27 June 2012 - 12:03 AM

Hi Markk,

Consider what would happen if the blue nodes were not jump points: you would continue to recurse diagonally away from the current node and miss a potential turn of the optimal path. To avoid this problem JPS only recurses diagonally if it determines there are no jump points in a vertical or horizontal direction. If it finds such a node, the recursion stops and the current node returned as a jump point.

#4 kruncher   Members   -  Reputation: 354

Like
0Likes
Like

Posted 06 November 2012 - 10:07 AM

Hello Markk

jump-node-explained.png

The above image was derived from images from the whitepaper: http://grastien.net/...s/hg-aaai11.pdf

Please see lines 8-11 on Algorithm 2 (function jump) for the logic behind this. I hope that this helps you to understand why the successor node is forced in this particular scenario.
Rotorz Limited (http://www.rotorz.com)

Check out our latest game Munchy Bunny!
Editor Tool: Rotorz Tile System (for Unity 3D)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS