TLpath library gone

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Baggef
Prole
Posts: 20
Joined: Fri Aug 23, 2019 7:30 pm
Location: USA
Contact:

TLpath library gone

Post by Baggef »

When clicking the download link for the TLpath library, here, it comes up with a Dropbox 404 page. Other path-finding libraries I've tried for Love are a little too complicated for me. Was hoping to try this one in case it was simpler. If it's not available anymore I'd appreciate the easiest path-finding library, I'm pretty bad at this stuff :cry:

BTW: The game I'm making is tile-based, so don't worry about the "scalability" of the library.
gaeem defelpmint is maiy pashin
Itch: Freakman
User avatar
Varkas
Citizen
Posts: 83
Joined: Mon Mar 09, 2020 2:26 pm

Re: TLpath library gone

Post by Varkas »

This one is really simple to implement:

https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm

In tiled games, each node of the graph always has 4 (or 8 if you allow diagonal move) neighbors. Costs (the numbers at the edges) depend on the terrain. You can use 1 if all moves have an equal cost.

There is pseudo code on the page which should be fairly easy to translate to Lua.

Edit: Lua example:

https://rosettacode.org/wiki/Dijkstra%27s_algorithm#Lua

Edit 2: A* is more efficient in the average case for games, but harder to understand. Still, if you want something better than Dijkstras, A* is it.

An open source implementation in Lua: https://github.com/lattejed/a-star-lua

MIT License allows all sort of usage, including commercial usage. But google will give you plenty more, A* is something many games use.
In soviet russia, code debugs you.
Post Reply

Who is online

Users browsing this forum: No registered users and 55 guests