I'm curious what your results would be if you switched to A*. The heuristic could be as simple as geographic distance, which would still allow for optimal paths but might reduce the amount of searching you do in the opposite direction of your destination.
What heuristic distance function is being used? If it were using Euclidean distance, wouldn’t it be a lot more efficient and not pursue paths that are going in literally the opposite direction as the destination?
Yeah, Dijkstra is more for graph search where maybe you have weights but not actual vectors. But this does give a nice visualisation of how far you can get from a single point in a given time.
At my university, one of the homework exercises was implementing A* on real map data. Really gave a perspective on the speed of computers, from what I remember, it was megabytes of map data of the UK, but calculating the best path from London to Edinburgh was within tens of milliseconds.
And I gotta agree, raylib is cute lil' library.
And I love the fact that it has bindings to so many languages, and e.g makes making games in Common Lisp a joy. Or any language, that one would want to use.. well not all, but a lot.
This is very cool! I compiled it on m2 with no problems.
Istambul is an excellent choice. I enjoyed watching the algorithm take for ever to find a route from the most northern part of the river to the other side :)
Raylib is the best visual library for C! You can do whatever you'd like, as long as you can program it, which is always the most interesting part of the day.
What would be the best way to generate custom maps for use with an algorithm like Dijstra's or A*? I have seen some methods using various game level editors to output to a grid, but is there an easy way to draw custom maps, such as indoors locations, and create your node map with additional JSON data visually?
You can try one of the Quickstart guides on that page. Just type in "San Francisco" in the search bar on the map on this page: https://overpass-turbo.eu/ and then run your search query (drinking fountains by default). The bounding box should be whatever is in view of the map on the right. Then you can click the Data tab to see exported XML.
Unfortunately I don't think the Redditor shared their code.