0

I discovered jumper.lua which is an incredibly fast and easy to use pathfinding library for grid-based maps.

However, it is giving me problems.

I am going to use this library with a procedurally generated map: as the player moves, a new 32 x 32 piece of terrain appears when needed.

This could make the map look non-rectangular of course. The problem is that when I try to create a Grid out of a non-rectangular map, the jumper.grid module warns ne with a Bad argument #1. Not a valid map. error.

Is there a way to bypass this while still making the library work? Or should I search for another library?

c0der
  • 18,467
  • 6
  • 33
  • 65
user6245072
  • 2,051
  • 21
  • 34
  • You could store the unexplored space as wall until you explore it. – DavisDude May 24 '16 at 13:06
  • @DavisDude the map is theoretically infinite - I couldn't create an infinite wall map. – user6245072 May 24 '16 at 13:20
  • Also I've removed the `assert` causjng the error, now it works with my map, I just want to be sure it's still 100% safe to use it with non-rectangular maps. – user6245072 May 24 '16 at 13:21
  • Unless you're very familiar with the code in question, removing the `assert` is asking for trouble; its whole point to unsure that the program does proceed if a condition is met. Typically, it's used to make the program fail in an obvious way if an unexpected condition occurs. This suggests that jumper.lua was not designed to handle non-rectangular & processing them may invalidate assumptions made by the pathfinding code, thus you cannot assume the output is correct. – Pikalek May 25 '16 at 01:11

0 Answers0