Luafinding is an A* module written in Lua with the main purposes being ease of use & optimization. Feel free to open any issues you find and make pull requests.
https://github.com/GlorifiedPig/Luafinding
Performance Tests
To run a performance test yourself, see "performance/performance.lua". Move "luafinding.lua", "vector.lua" and "heap.lua" to that folder and run "performance.lua" in your console. Here are my performance results:
Code: Select all
> luajit performance.lua
Using seed 1614795006
Building 100 x 100 sized map.
Generating 2000 random start/finish positions.
Finding 1000 paths.
Done in 0.309 seconds.
Average of 0.000309 per path.
Not to mention that a lot of Love2D implementations also feature a lot of O(n) for tables instead of indexing. When testing "lua-star" in Love2D, it ran at about 2 seconds per path - whereas Luafinding, on my machine, runs at 0.00034 seconds per path. That's an entire 99.98% decrease in computing time.
Love2D Implementation
To see an example of how this is implemented in Love2D, navigate to the "love2d-example" folder in the GitHub repo.