Jumper
What's this ?
Jumper is a pathfinding library designed for uniform-cost 2D grid-based games. It aims to be lightning fast and lightweight. It also features a clean public interface with chaining features which makes it very friendly and easy to use.
Technical notes
Jumper implements the Jump Point Search algorithm (tight along with A-star running on the background). It also implements a lighter implementation binary heaps module to maintain its open list of nodes while performing a search.
A benchmark program running in console is available on Github. It features a set of 132 maps from the 2012 Grid-based Path Planning Competition. You might want to try this program to witness the performance of Jump Point Search algorithm.
Usage
Jumper is easy to use. Here is a basic example using the latest version available.
-- A collision map.
-- We assume here that 0 represents walkable tiles
local map = {
{0,0,0,0,0},
{0,0,1,0,0},
{0,0,1,0,0},
{0,0,1,0,0},
{0,0,0,0,0},
}
local walkable = 0
local Jumper = require ('Jumper') -- Calls the library
-- We init our pathfinder instance, passing it the map,
-- and defining what are the walkable tiles
local pathfinder = Jumper(map,walkable)
-- Gets the path from location (1,1) to location (5,5)
local path, length = pathfinder:getPath(1,1,5,5)
Jumper offers a lot more options to customize the pathfinding behavior. Please, kindly check out the Readme to figure them out.
Feedback
If you have any question, proposal, idea to improve, or if you are just using Jumper in a project, I would love to hear your feedback. Issues/suggestions can be posted on the project issue tracker on Github, or by e-mail.