4 ms·
I think there's a "bug" (a bad heuristic?) in the A* code, since it produces easy suboptimal "solutions". https://emil.fi/m/astarsuboptimal.png https://emil.fi
by emilfihlman 4y ago
I think there's a "bug" (a bad heuristic?) in the A* code, since it produces easy suboptimal "solutions".
https://emil.fi/m/astarsuboptimal.png https://emil.fi/m/astarsuboptimal.png
- emilfihlman 4y agoAlso seems to produce suboptimal solutions with Dijkstra's algorithm, which shouldn't be the case, right? https://emil.fi/m/dijkstrasuboptimal.png https://emil.fi/m/dijkstrasuboptimal.png
- emilfihlman 4y agoAnd depth first seems to behave, strangely. https://emil.fi/m/depthsuboptimal.png https://emil.fi/m/depthsuboptimal.png
- honzaaap 4y agoThat'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!
- emilfihlman 4y agoHere's one a friend generated on his machine with Dijkstra. https://emil.fi/m/dijkstrasuboptimalfriend.png https://emil.fi/m/dijkstrasuboptimalfriend.png Seems like there's a bug or more.
- jhomedall 4y agoThe top (selected) path is 23 hexes from start to finish, but the winding closer path is 24 hexes.
- emilfihlman 4y agoNot 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.
- jhomedall 4y agoOh you're right. My bad, sorry.