News for hackers. Stuff that matters.
Re:Show HN: Pathfinding Visualizer by karussell on Saturday June 25, 2022 @04:06PM (#31878301)
Re:Show HN: Pathfinding Visualizer by honzaaap on Saturday June 25, 2022 @04:43PM (#31878578)
Looks cool! Thanks for sharing :)
Re:Show HN: Pathfinding Visualizer by mxmlnkn on Saturday June 25, 2022 @10:51AM (#31875756)
Interesting to watch but some explanations on the website might be useful.

Choosing "Prim's Algorithm" uses up 20GB in a few seconds before it gets killed.

Re:Show HN: Pathfinding Visualizer by emilfihlman on Saturday June 25, 2022 @02:31PM (#31877559)
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

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?

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

Re:Show HN: Pathfinding Visualizer by emilfihlman on Saturday June 25, 2022 @02:41PM (#31877634)
And depth first seems to behave, strangely.

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

Re:Show HN: Pathfinding Visualizer by honzaaap on Saturday June 25, 2022 @02:53PM (#31877712)
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.

Re:Show HN: Pathfinding Visualizer by jhomedall on Saturday June 25, 2022 @03:30PM (#31878012)
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.
Re:Show HN: Pathfinding Visualizer by jhomedall on Saturday June 25, 2022 @09:54PM (#31880365)
Oh you're right. My bad, sorry.
Re:Show HN: Pathfinding Visualizer by phailhaus on Saturday June 25, 2022 @01:39PM (#31877139)
This is great! Very juicy visualization. One bit of feedback though: some of the algorithms take a while to complete, and it doesn't seem like I can "stop" or "reset" while it's running?
Re:Show HN: Pathfinding Visualizer by BatFastard on Saturday June 25, 2022 @12:50PM (#31876754)
Makes me wonder why anyone would use anything but A* or greedy algorithm. Fun to play with and watch!
Re:Show HN: Pathfinding Visualizer by littlestymaar on Saturday June 25, 2022 @04:44PM (#31878584)
Factorio had a blog post a while ago explaining why basic A* didn't work for them. On my phone right now so I can't find it easily but I'm pretty sure it was posted in HN.

Edit: found it. https://news.ycombinator.com/item?id=21294354

Re:Show HN: Pathfinding Visualizer by mef on Saturday June 25, 2022 @01:31PM (#31877060)
very cool!

tiny nit: solid grey blocks are paths and gradient tiles are walls, but my expectation is reversed

Re:Show HN: Pathfinding Visualizer by omoikane on Saturday June 25, 2022 @02:59PM (#31877755)
I wish the gradient walls were replaced by solid color tiles instead. Currently the top part of the grid seems lacking in contrast between paths and walls.
Re:Show HN: Pathfinding Visualizer by tonetheman on Saturday June 25, 2022 @10:47AM (#31875717)
Needs instructions