This is cool as heck!
This is cool as heck!
Hi, I have a little observation to do. When you click inside a polygon and the closest point outside the polygon to the mouse is outside the screen, it would be nice if the pathinding doesn't take this into consideration and redirects to the point closest to the mouse inside the screen. If it were easy to do, I think it would be a great improvement.
P.s. I have started to mount the pathfinding in my game and it continues to work great, and I never encountered any bugs yet!![]()
@ ciaciosacchetti
Great!. Please If you don't mind sharing your pathfinding. I need it for my adventure game
That's actually quite a bit of work to do properly. I made a simple fix here though:
https://1drv.ms/u/s!Atq7cUIJ7uextB6m...vnVFB?e=GZBIJO
(there are some other very minor changes, such as updated comments that now actually match the code!)
Note that you MUST place a node wherever a polygon exits the screen:
Any wall where one or both end nodes lie outside the frame, will be ignored (exactly on the edge counts as inside).
So in the example above, walls 1>2 and 4>5 are okay, but walls 2>3 and 3>4 will be ignored.
I tried it quickly because today I had very little time, but your simple fix is better than anything I could do, and it works great!
As usual thank's a lot for everything.
@Mehrdad, i really don't understand what you mean, maybe is my english, but for my game I use MuddyMole's pathfinding, so is simply here![]()
@ciaciosacchetti
Sorry, I think you made another pathfinding. And maybe I'm wrong but @MuddyMole example use surface object and it's not cross-platform, right?
The surface object is only for debugging purposes, so that you can easily check you have your polygons set up correctly - you can safely remove it without affecting the pathfinding at all.
The only objects that are essential for it to work are Active, Array and List objects, so it should work with any and all exporters, though I personally don't have a means of testing that.
Since several people have asked me now, I've made yet another slight modification here:
https://1drv.ms/u/s!Atq7cUIJ7uextB8q...E6Efs?e=78ZMoJ
The only changes are to the debug mode.
It now uses scaled & rotated actives to draw the polygon outlines, so even if you delete the Surface object (the only object in use that isn't supported by all exporters), the debug mode is still fully functional - it's just that the polygon won't be filled.
Also, if you mouseover a node, all other nodes that are directly reachable from it will be highlighted, which is handy for spotting issues (very small polygons with very acute angles can occasionally be problematic - after adding this feature, I noticed that it was possible to sail right through the Isle of Wight in previous versions, for example!).
Great!!!. I test it on Android now and works perfectly for me. Mush appreciated!. Great engine.
And I have two different questions please: I need it for an adventure point and click.
1) How can use graphic left /right/up/.... for the player?
2) Is it possible "turn before walking" too?