mkyc / go-jps

Jump point search algorithm go implementation
MIT License
4 stars 1 forks source link

Can I get a short path? #1

Open wangle254373723 opened 2 months ago

wangle254373723 commented 2 months ago

It works well, but sometimes it has a little problem, the path is not the shortest, sometimes it takes a detour,Can this be fixed?

mkyc commented 1 month ago

Hi @wangle254373723 can you please provide example map you have problem with? Something like this?

wangle254373723 commented 1 month ago

Is this picture okay? map

wangle254373723 commented 1 month ago

The red box is problematic in this part 1725897954(1)

mkyc commented 1 month ago

hi @wangle254373723 sorry for slow response, was bit busy. Do I understand correctly that one "white diamond" shape in your picture is single "cell" in your map? I assume it's just isometrical view, isn't it? Can you please provide pure 2d version, with one pixel being one point? As you can see in this readPNG function in tests I basically use this kind of files to feed tests.

I think I'd like to improve tests while working on your issue, but I'd appreciate if you send me this data in a form that I do not need to draw it manually :)

wangle254373723 commented 1 month ago

Hi @MKYC, I'm sorry, I didn't understand what you mean at first, I used the generateImage interface you provided to generate a map, the file also includes, my waypoint information, I don't know if this can achieve the purpose of your test, but from the generated graph it is obvious that the path is indeed not the shortest, see ZIP for details map_output.zip