Re:Show HN: Pathfinding Visualizer
by emilfihlman on Saturday June 25, 2022 @02:36PM
(#31877591)
Also seems to produce suboptimal solutions with Dijkstra's algorithm, which shouldn't be the case, right?
Re:Show HN: Pathfinding Visualizer
by emilfihlman on Saturday June 25, 2022 @02:41PM
(#31877634)
And depth first seems to behave, strangely.
That's weird, I am unable to recreate these bugs but it could be something with screen size, since I generate tiles according to window size. I'll look into it. Thanks!
Re:Show HN: Pathfinding Visualizer
by emilfihlman on Saturday June 25, 2022 @03:17PM
(#31877900)
Here's one a friend generated on his machine with Dijkstra.
https://emil.fi/m/dijkstrasuboptimalfriend.png
Seems like there's a bug or more.
The top (selected) path is 23 hexes from start to finish, but the winding closer path is 24 hexes.
Re:Show HN: Pathfinding Visualizer
by emilfihlman on Saturday June 25, 2022 @03:32PM
(#31878027)
Not the issue here, look at the end of the selected path, where the cursor is. If you go down where the cursor is instead of right the path is 1 step shorter.
https://emil.fi/m/astarsuboptimal.png