pathfun: a pure Lua library for 2D pathfinding, with editor

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
darkfrei
Party member
Posts: 1204
Joined: Sat Feb 08, 2020 11:09 pm

Re: pathfun: a pure Lua library for 2D pathfinding, with editor

Post by darkfrei »

Is it possible to limit the length of the line and use it as a worms-style rope? Here Worms is a good old game: https://en.wikipedia.org/wiki/Worms_Armageddon
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
apicici
Prole
Posts: 29
Joined: Wed Dec 18, 2019 9:25 pm

Re: pathfun: a pure Lua library for 2D pathfinding, with editor

Post by apicici »

darkfrei wrote: Fri May 05, 2023 1:30 pm Is it possible to limit the length of the line and use it as a worms-style rope? Here Worms is a good old game: https://en.wikipedia.org/wiki/Worms_Armageddon
I'm very familiar with Worms :)

I don't think something like that would work with this library because of the way the pathfinding works: it uses the funnel algorithm on polygonal meshes, so it first finds a path of adjacent polygons and then uses string-pulling to make it as short as possible. In order to limit the length I think it would have to be a fully vertex based approach, where each vertex is a node in a graph and nodes are connected if they are in line of sight (I may be wrong, though).
aleperry
Prole
Posts: 2
Joined: Thu Apr 20, 2023 8:46 am

Re: pathfun: a pure Lua library for 2D pathfinding, with editor

Post by aleperry »

I apologize for the delay, I try to be as clear as possible, currently the steps to create a map are:

1) I open the game map.
2) I place the editor on the map and adjust the transparency with a third party tool.
3) I trace the map trying to be more accurate as possible.
4) with a lua script I flip the coordinates (on an x=y axis) and apply an offset to the coordinates to switch from the editor's default reference system to the game one.
5) with a last script I transform the coordinates from the proportions of the editor (monitor resolution) to those of the game.
6) I open the map in the editor and I check that I haven't screwed up things :crazy: .

Unfortunately every correction is made by roughly modifying the map and recalculating the coordinates with the scripts, since I can view the game coordinates it would be much easier to be able to set the origin of the axes and the scale (or the proportions of the map). I have attached an image to try to explain better.
Example
Example
Enhaced.png (219.13 KiB) Viewed 6917 times
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 3 guests