Page 6 of 10

Re: Jumper : 2D Pathfinder with Jump Point Search (v1.5.1.2)

Posted: Tue Oct 16, 2012 5:27 pm
by Roland_Yonaba
Hi everyone.

Just want to give heads up about the current progresses on this.
I've been working the past hours on another possible way to represent grid tiles regards to these conditions:
  • Tiles can either be fully walkable/fully unwalkable.
  • Tiles can be partially walkable, meaning that they can be crossed in specific directions.
  • The overall should remain simpler.
At this point, I needed a way to represent all tiles and their "passability" (i.e how each node can be traversed). Thanks to some help with the geniuses @StackOverflow, I could hopefully overcome this issue.

As Lua (5.1) do not have a native bitwise operations library (and I didn't want to rely on an external C lib), I used David Manura's bit.numerlua module, from wich I ripped some functions i needed (bit.band, bit.bor, see file attached - note that I don't know much of bitwise operations, i'll be happy to have some feedback about that, thanks).

I made lots of changes internally. Well the algorithm remains the same (A* + Jump Point Search), but on the top of that, some rules to discard expanding search process on nodes that cannot be crossed in specific directions.

The results are clearly awesome. See the relevant screenshots below.

On this first series of screenshots, you can see the pathfinder in action, with diagonal moves allowed. Note that on the second screenshot, one tile was found passable following the north-south direction, then the pathfinder chooses it.
Image Image

Here is the same situation, with only straight moves allowed.
Image Image

Side note, I haven't released this modified version yet, as i'm actually trying to design a simple public interface that will let the user alter easily tiles passability rules, without having to mess with bitwise ops... Once I get this done, i'll be pushing it on a separated branch on Github repository.

Thanks reading.

Re: Jumper : 2D Pathfinder with Jump Point Search (v1.5.1.2)

Posted: Tue Oct 16, 2012 5:53 pm
by Karai17
This is quite brilliant! I look forward to your next release. :)

Re: Jumper : 2D Pathfinder with Jump Point Search (v1.5.1.3)

Posted: Thu Oct 18, 2012 9:18 am
by Roland_Yonaba
Hi all,

I've just pushed the experimental branch. The OP was updated with new links, too.
So you can now try to play with one-way tiles (to simulate walls, doors) for instance.
Happy bug hunting!

Side note, this experimental version is...ahem...experimental. Things may not work (I already know about 2-3 issues). Anyway, if you run into a problem, i'll be happy to have your feedback. Also, please pay attention to the Readme, because some things works differently now ( and because I spent lot of time writing it ... :huh: ).

Feedback about the interface would be appreciated, also. How do you find it ? Way much complicated than before ? Simple enough to deal with ? I'll be happy to know about that.

Find also a *.love demo for this experimental version. I hope you'll find it easy-to-use. Basically, you click on a button, then you click on a grid cell to perform the relevant task.
Open Ways and Close Ways buttons works in a *bit* different manner: you click on any of them, then you click on a grid location to select a cell, then you type a key (on your keyboard) to open/close a way of entrance for this cell.

Image

Thanks reading!

Re: Jumper : 2D Pathfinder with Jump Point Search (v1.5.1.3)

Posted: Thu Oct 18, 2012 9:15 pm
by Kadoba
I get this error when I run your experimental .love

Re: Jumper : 2D Pathfinder with Jump Point Search (v1.5.1.3)

Posted: Thu Oct 18, 2012 9:32 pm
by Nixola
Strange, it works here

Re: Jumper : 2D Pathfinder with Jump Point Search (v1.5.1.3)

Posted: Thu Oct 18, 2012 9:38 pm
by Karai17
Works for me too

Re: Jumper : 2D Pathfinder with Jump Point Search (v1.5.1.3)

Posted: Thu Oct 18, 2012 10:07 pm
by Roland_Yonaba
Hi Kadoba,
First, thanks trying.
You should not encounter such an issue.
Would you please download and give it a try again ?

Re: Jumper : 2D Pathfinder with Jump Point Search (v1.5.2)

Posted: Thu Oct 25, 2012 10:34 pm
by Roland_Yonaba
Hi folks,

Little update. Indeed, that was a bugfix.
The problem occuring was a sort of "tunneling" issue, so that when the goal node was neighbouring the start node,
the pathfinder would always return the straight line, even if this would have implied going through walls, as shown in the following picture:

Image

With the latest bugfix, I had to add an extra function that acts as a validator routine between the online jump node search process and the regular a-star evaluation. When a jump point is found, and happened to be the goal node, this routine evaluate if the pathfinder can actually enter the goal node heading straight, through this function. If not, it will choose for another possible way. All this extra-process is called internally only for diagonal mode, and on the first jump point expanded. As a result, you might no longer encounter such an issue:

Image

Feel free to try it (Github repo).
Note that i have only updated the default branch, not the experimental version (as this might require a bit more thinking).

Thanks reading.

Re: Jumper : 2D Pathfinder with Jump Point Search (v1.5.2.1)

Posted: Sat Oct 27, 2012 7:17 pm
by qaisjp
What does OPEN/CLOSE ways do?

Re: Jumper : 2D Pathfinder with Jump Point Search (v1.5.2.1)

Posted: Sat Oct 27, 2012 7:57 pm
by Roland_Yonaba
qaisjp wrote:What does OPEN/CLOSE ways do?
Say you want to model a door on your 2D grip map (a one-way tile).
You want the corresponding tile to be entered only from left/right, for instance, and not from any other direction.
Select the "CLOSE WAYS" button, then select the tile you want to modify, then "close" the directions you do not want the pathfinder to enter on this tile typing the matching keys.

Hope this is explicit enough ?