How to make this metapolygons, where you connect multiple polygons together?
pathfun: a pure Lua library for 2D pathfinding, with editor
Re: pathfun: a pure Lua library for 2D pathfinding, with editor
You can use the visual editor to easily create something like that, or just create the polygon map by hand by creating a table containing all the inner polygons. The polygon map passed to the library can contain any number of convex polygons, and they are allowed to be disjoint. You only need to use multiple polygon maps if you are planning to dynamically turn on/off some of them.
Re: pathfun: a pure Lua library for 2D pathfinding, with editor
Thank you for sharing this! Just...wish I had a better grasp of how the whole thing actually works...
A few questions if you don't mind :
1: Are the paths calculated using some sort of "bounding box" for each point, or just the "x,y" coordinants?
2: Is there a way to update each path more in "real time", so that the points can "chase" or "follow" a constantly moving target?
3: Aside from integrating this with some sort of physics library (or just Box2d) and having a "priority queue" or something, any suggestions for how one would go about getting the points to move around each other as well (like "herds"), or would that simply be too complicated?
Again, thank you! I haven't come across many polygon based pathfinding libraries, so this is just what I was looking for. It's also a lot of fun watching all those little dots move about various polygon maps.
A few questions if you don't mind :
1: Are the paths calculated using some sort of "bounding box" for each point, or just the "x,y" coordinants?
2: Is there a way to update each path more in "real time", so that the points can "chase" or "follow" a constantly moving target?
3: Aside from integrating this with some sort of physics library (or just Box2d) and having a "priority queue" or something, any suggestions for how one would go about getting the points to move around each other as well (like "herds"), or would that simply be too complicated?
Again, thank you! I haven't come across many polygon based pathfinding libraries, so this is just what I was looking for. It's also a lot of fun watching all those little dots move about various polygon maps.
Re: pathfun: a pure Lua library for 2D pathfinding, with editor
zingo wrote: ↑Mon Jan 16, 2023 10:55 am 1: Are the paths calculated using some sort of "bounding box" for each point, or just the "x,y" coordinants?
2: Is there a way to update each path more in "real time", so that the points can "chase" or "follow" a constantly moving target?
3: Aside from integrating this with some sort of physics library (or just Box2d) and having a "priority queue" or something, any suggestions for how one would go about getting the points to move around each other as well (like "herds"), or would that simply be too complicated?
- the paths are calculated by first finding the "shortest" polygonal path between two points, that is a sequence of polygons, each sharing an edge with the next one, with the first polygon containing the starting point and the last polygon containing the target. Shortest here is with respect to the sum of the distances between the centroid of each polygon and the next one.
- You can simply rerun the algorithm at each update by using the current position as the starting point and the position of the moving point as the target.
- I'm not sure what moving around each other means here. Is there a fixed point that another point should move randomly around, constrained within the polygon map, or are both points moving?
Re: pathfun: a pure Lua library for 2D pathfinding, with editor
Thanks for the reply. What I mean by "move around each other" is that each point (or entity) would avoid "colliding" with another as they all navigate towards the target (rather than simply overlap or "bottleneck", as they do now)...sort of like units would in the classic Warcraft...(if that makes sense).
Re: pathfun: a pure Lua library for 2D pathfinding, with editor
I suspect that kind of thing is best achieved with a different kind of navigation system. Pathfun is not really designed to deal with movable obstacles in its current form.
Re: pathfun: a pure Lua library for 2D pathfinding, with editor
Ah, that's okay. I may experiment with the points acting as "guides" for other entities that employ physics, so those could potentially "slide" around each other (provided the body shape is circular, and there's little or no friction), or simply have them form a "queue" until those closer to the target are out of the way...will have to see. In any case, Pathfun would be excellent for a "point n' click" game reminiscent of "Monkey Island" , "Space Quest", "Sam and Max", "Day of the Tentacle" etc. Had a blast playing those back in the day, and would love to see what people here come up using it, or anything you may be working on at the moment.
Re: pathfun: a pure Lua library for 2D pathfinding, with editor
Indeed, pathfun is a standalone part of my LÖVE point and click adventure game engine (that I hope at some point will be in a releasable state) and I used in 2 such games so far
Re: pathfun: a pure Lua library for 2D pathfinding, with editor
Hi everyone! I would like to ask is it possible to have a version of the editor with a customizable reference system? So being able to change the position of the origin of the axis and perhaps the scale. This would help me a lot with conversions from monitor to game reference system and would drastically speed up small edits! Thank you <3
Re: pathfun: a pure Lua library for 2D pathfinding, with editor
That doesn't sound complicated, but I'm not sure I fully understand what you're after. Can you provide more information on how you're planning to do things? Do you need this in order to create the polygon maps starting from your game data?aleperry wrote: ↑Thu Apr 20, 2023 8:56 am Hi everyone! I would like to ask is it possible to have a version of the editor with a customizable reference system? So being able to change the position of the origin of the axis and perhaps the scale. This would help me a lot with conversions from monitor to game reference system and would drastically speed up small edits! Thank you <3
Who is online
Users browsing this forum: Ahrefs [Bot] and 9 guests