Open horoman opened 10 years ago
I noticed that as well, but I wouldn't really see this as a bug. JPS in general only works when diagonal jumps are allowed, so the "bug" for me is not that it's not working, but rather that there's no warning/error message or something like that.
You are right it works. But it works like AStar. There are no jumps. But there should be. I think I see at least three errors, whereof two are bugs in my eyes and one is just a "Unterlassung". Will write it into the lines (not right now but at least this week).
Made the comments into the initial commit. But when I have now read your comment again, I am not sure anymore if I am right with my comments.
JPS in general only works when diagonal jumps are allowed
Have to think about that again.
JPS in general only works when diagonal jumps are allowed
This is a question of definition. In case of diagonal moves are forbidden, I have to perfom a search to the left and right in case of a vertical/horizontal move (with diagonal moves this is not necessary). Then it should work again. We can just try it and see if it works.
Here the proof. Note that it really jumps at the start and the end.
Yeah. Looking at the picture, I realise two things:
The algorithm does not know how the map looks like, it comes from the start and searches for a path. It also does not know where the area with wheat is narrow to pass it. Therefore whenever it hits this area, this is a possible point to pass the area. Thought this is a jump point and added to the bin. If the path goes through such a point, then it shows up as a point in the path, means that it is not jumped over it.
The function jump of Yonaba'y JPS contains some errors when allowDiagonal is false. It will then not jump at all.