• Stars
    star
    590
  • Rank 72,816 (Top 2 %)
  • Language
    Lua
  • License
    MIT License
  • Created over 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Fast, lightweight and easy-to-use pathfinding library for grid-based games

Jumper

Join the chat at https://gitter.im/Yonaba/Jumper

Build Status

Jumper is a pathfinding library designed for grid-based games. It aims to be fast and lightweight. It features a wide range of search algorithms, built within a clean interface with chaining features which makes it very friendly and easy to use.

Jumper is written in pure Lua. Thus, it is not framework-related and can be used in any project embedding Lua code.

Installation

The current repository can be retrieved locally on your computer via:

Bash

git clone git://github.com/Yonaba/Jumper.git

Download (latest)

  • Development version: zip | tar.gz ( please do not use this! )
  • Latest stable release (1.8.1): zip | tar.gz ( Recommended! )
  • All stable releases: tags

LuaRocks

luarocks install jumper

MoonRocks

luarocks install --server=http://rocks.moonscript.org/manifests/Yonaba jumper

Installing Jumper

Copy the contents of the folder named jumper and its contents and place it inside your projet. Use require function to import any module of the library.

A Simple Example of Use

Here is a simple example explaining how to use Jumper:

-- Usage Example
-- First, set a collision map
local map = {
	{0,1,0,1,0},
	{0,1,0,1,0},
	{0,1,1,1,0},
	{0,0,0,0,0},
}
-- Value for walkable tiles
local walkable = 0

-- Library setup
local Grid = require ("jumper.grid") -- The grid class
local Pathfinder = require ("jumper.pathfinder") -- The pathfinder class

-- Creates a grid object
local grid = Grid(map) 
-- Creates a pathfinder object using Jump Point Search
local myFinder = Pathfinder(grid, 'JPS', walkable) 

-- Define start and goal locations coordinates
local startx, starty = 1,1
local endx, endy = 5,1

-- Calculates the path, and its length
local path = myFinder:getPath(startx, starty, endx, endy)
if path then
  print(('Path found! Length: %.2f'):format(path:getLength()))
	for node, count in path:nodes() do
	  print(('Step: %d - x: %d - y: %d'):format(count, node:getX(), node:getY()))
	end
end

--> Output:
--> Path found! Length: 8.83
--> Step: 1 - x: 1 - y: 1
--> Step: 2 - x: 1 - y: 3
--> Step: 3 - x: 2 - y: 4
--> Step: 4 - x: 4 - y: 4
--> Step: 5 - x: 5 - y: 3
--> Step: 6 - x: 5 - y: 1

Specs

Specs tests have been included.
You can run them using Telescope with the following command from the root folder:

tsc -f specs/*

Credits and Thanks

License

This work is under MIT-LICENSE
Copyright (c) 2012-2013 Roland Yonaba.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Bitdeli Badge githalytics.com alpha

More Repositories

1

Moses

Utility library for functional programming in Lua
Lua
604
star
2

30log

30 lines library for object orientation in Lua
Lua
413
star
3

awesome-one-person-games

🎮 A curated list of successul games, made (quite) entirely by a lone gamedev.
352
star
4

delaunay

Delaunay triangulation for convex polygon
Lua
102
star
5

Lua-Class-System

Lua Class System (LCS) is a small library which offers a clean, minimalistic but powerful API for (Pseudo) Object Oriented programming style using Lua.
Lua
62
star
6

Allen

An utility library to manipulate strings in Lua
Lua
45
star
7

strictness

Tracks accesses and assignments of undefined variables in Lua
Lua
36
star
8

love2d-assets-loader

Assets Loader for Löve2D Framework
Lua
36
star
9

FloodFill

Various floodfill algorithms implementation
Lua
18
star
10

Binary-Heaps

Implementation of binary heaps data structure in pure Lua
Lua
18
star
11

guard.lua

Minimalistic library providing Elixir-style guards for Lua
Lua
16
star
12

Steering-Behaviors

Steering behaviors algorithms for autonomously moving agents and flocks implemented in Lua
Lua
15
star
13

broad-phase-algorithms

Lua Implementation of space-partitioning techniques for broad-phase collision detection
Lua
14
star
14

Jumper-Benchmark

Benchmark tests for the pathfinding library Jumper featuring 2012 GPPC map set
Lua
12
star
15

tuple.lua

Minimal implementation of ordered n-tuples class in Lua
Lua
11
star
16

Raytracer

A basic raytracer written in Lua
Lua
11
star
17

Jumper-Examples

Demos and examples of use for the pathfinding library Jumper with various Lua frameworks and game engines
11
star
18

dijkstra-map

Demo illustrating the use of dijkstra map for turn-based pathfinding for multi agents on weighted grids
Lua
10
star
19

yonaba.github.com

Personal DevBlog Pages
CSS
7
star
20

character-physics-demo

A technical demo (made with Löve2D) implementing physics-based movement and jump with various time integration methods
Lua
7
star
21

Java-samples

Collection of Java snippets implemented for learning purposes
Java
7
star
22

uplink-psp

A small clone of Uplink Hacker Elite written in Lua for PSP
Lua
6
star
23

luigi-world

An old and minimalist platformer game with Luigi written in Lua for PSP
Lua
5
star
24

PiL3

Going through the exercices of the book Programming in Lua, Third Ed.
Lua
5
star
25

30logclasscommons

Plugin for compatibility between 30log and Class-commons
Lua
4
star
26

Starz-Puzzle

A small Lua puzzle game written for the sake of LÖVE
Lua
4
star
27

SOR

Library for solving linear equation system using Successive Over Relaxation method
Lua
4
star
28

pascal-exercises

Collection of maths problems implemented in pascal programming language for learning purposes
Pascal
4
star
29

smallpt-lua

Lua
4
star
30

adventofcode

My attempt at solving AdventOfCode Problems with Lua, on my spare times
Lua
3
star
31

lua-travis-coveralls

Getting Lua 5.1, 5.2 and LuaJit 2.0 specs to work with integration with Travis-CI and Coveralls.io
Shell
3
star
32

xcorr.bas

Adds cross correlation and autocorrelation functions to Microsoft Excel
VBA
3
star
33

treap.lua

A simple treap data structure implemented in Lua
Lua
3
star
34

Win64-Installer-ArcView3.x

ISS Script to generate A Windows x64 compatible setup of ESRI's ArcView3.x
Shell
2
star
35

lua-system-shell

Small old homebrew Lua shell written in Lua for PSP
Lua
2
star
36

hokuto-no-ken

Small old homebrew Lua game written in Lua for PSP
Lua
2
star
37

danzeff-lua-keyboard

Emulating Danzeff's Keyboard for LuaPlayerHM
Lua
2
star
38

Hydraulics

VB macros to evaluate hydraulics parameters. Exposes solvers as functions to Excel API
FreeBasic
2
star
39

mario-kart

A small and minimalist Mario Kart homebrew game written in Lua for PSP
Lua
2
star
40

Excel-Pour-Reseaux-Ramifies

Macro VBA associée à un classeur Excel pour le calcul et l'analyse de réseaux hydrauliques ramifiés.
Visual Basic
2
star
41

covid19_clustering_africa

Attempt at clustering African countries using country-level variables and COVID-19 prevalence
R
1
star
42

2ie-master-thesis-csl-style

CSL Style developed for 2iE students Master thesis
1
star
43

ID-em

Create unique identifiers for each entity in a ESRI Shapefile
1
star
44

the-labyrinth

A small technical raycasting demo written in Lua for PSP
Lua
1
star
45

ET0_Analysis_Burkina_Faso

R scripts for Figures and Data Analysis Accompanying an academic paper on reference evapotranspiration analysis in Burkina Faso
R
1
star
46

sivakumar.bas

A VBA module to calculate the rainy season onset/ending dates and the count of occurences of dry spells
VBA
1
star