Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



Also seems to produce suboptimal solutions with Dijkstra's algorithm, which shouldn't be the case, right?

https://emil.fi/m/dijkstrasuboptimal.png


And depth first seems to behave, strangely.

https://emil.fi/m/depthsuboptimal.png


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!


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.


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.


Oh you're right. My bad, sorry.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: