Open tones31 opened 6 years ago
Hmm, maybe the visualizer is old code? Because diagonalMovement : PF.DiagonalMovement.Always
actually allows this...
Yes, the visual representation uses an build that is actually a few days older than the last change to DiagonalMovement in Pathfinding.js and there is a commit message for the DiagonalMovement-change, so without cloning and rebuilding the code I assume you are right.
I cloned the code and tested it. The visual editor calls the AStarFinder with "diagonalMovement" set to undefined, "allowDiagonal" to 1 and "dontCrosscorners" to false, so the logic here sets diagonalMovement to "IfAtMostOneObstacle" (3) instead of "Always" (1). I suggest it should be changed in the visual editor to be a drop-down instead of checkboxes so the user set diagonalMovement and we should remove "allowDiagonal" and "dontCrossCorners ", because they are marked as deprecated.
Yes - also in the main github readme, both of those deprecated properties are used.
I didn't know how to word the question, but with this image its easy to understand: I think there is an inconsistency here when using diagonal path finding. If you wall off a vertex other than two open walls, the pathfinding will work and even use diagonal pathing. If however you leave only one open wall, the pathfinding will no longer work.
My expected result for these two examples would be the same. Is there some option to be set that allows going through walls diagonally? See pic: