Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (808)
Games in Android Showcase (239)
games submitted by our members
Games in WIP (872)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  A* pathfinding library for libgdx  (Read 2716 times)
0 Members and 1 Guest are viewing this topic.
Offline mudlee
« Posted 2018-09-04 06:52:00 »


Is there a pathfinding library available somewhere? I know gdx-ai, but it's not maintained and PRs are not accepted for a year now. It's needed for a top-down tilebased game.

Of course, I might implement it by myself, but if anyone has a good library, I would use that for now instead Smiley
Offline ral0r2
« Reply #1 - Posted 2018-09-04 09:33:24 »

Slick2D has a pathfinding covered, it is an entire engine though.
You could simply program your own pathfinding or just extract the code of slick.

Source (might be not the newest version of slick2d):
Offline mudlee
« Reply #2 - Posted 2018-09-04 17:55:08 »

Cmon, this code is also 10(!) years old Smiley I’m not saying that the A* implementation should be different, but I’m looking for a maintained lib, or if I have to implement it myself, I’ll use the latest code available (gdx-ai) as a resource Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven

« JGO Overlord »

Medals: 1371
Projects: 4
Exp: 16 years

Hand over your head.

« Reply #3 - Posted 2018-09-04 18:09:01 »

Some libs are quite good at what they do, and don't require that much maintenance. If I were you I'd grab anything that works, and modify the code for my purposes. Whether or not the repo is active, is of minor concern.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline mudlee
« Reply #4 - Posted 2018-09-05 05:04:22 »

Yeah, it's a good point what you're saying. Probably I stick to gdx-ai then and I'll make it transparent so if I find something newer, I'll be able to replace it. thx!
Offline bmanmcfly
« Reply #5 - Posted 2018-09-12 06:17:54 »

Yes, has a A* pathfinder.

It requires a node; position and other information relevant to the terrain.
The nodes are connected to other nodes, so you need to define the connections.
then, a graph of all the nodes and the relevant connections.
finally, a heuristic to calculate how close to the destination each node is

then it is as simple as : or connection)path(start point, end point, heuristic, graphpath the array of nodes that will be the shortest path or null);

it is annoying to setup because it requires 4 linked classes, but once it is working, the worst is adjusting the weighting of terrain to get paths to not be funky... depending, you may want to use a path shortening algorithm the checks the line of sight point to point.  that is good, but instead of say 20 nodes, it might reduce to 3.
Offline mudlee
« Reply #6 - Posted 2018-09-12 06:30:29 »

Yes, I already solved it and I use gdx-ai. It was not hard tough, I would say it was easy.

The question was only about that as it's not maintained anymore, is there any other libraries. But as the answer is possibly no, I chose gdx-ai then.
Offline Gornova
« Reply #7 - Posted 2018-09-13 19:32:09 »

Cmon, this code is also 10(!) years old Smiley I’m not saying that the A* implementation should be different, but I’m looking for a maintained lib, or if I have to implement it myself, I’ll use the latest code available (gdx-ai) as a resource Smiley

you should try it. Used for many projects, even with libgdx, without any problems so...

Blog | Last game Number+
Pages: [1]
  ignore  |  Print  

Riven (847 views)
2019-09-04 15:33:17

hadezbladez (5795 views)
2018-11-16 13:46:03

hadezbladez (2603 views)
2018-11-16 13:41:33

hadezbladez (6211 views)
2018-11-16 13:35:35

hadezbladez (1499 views)
2018-11-16 13:32:03

EgonOlsen (4734 views)
2018-06-10 19:43:48

EgonOlsen (5793 views)
2018-06-10 19:43:44

EgonOlsen (3276 views)
2018-06-10 19:43:20

DesertCoockie (4175 views)
2018-05-13 18:23:11

nelsongames (5501 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!