Isometric Pathfinding Bugs

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
Brah
Prole
Posts: 13
Joined: Tue Feb 01, 2022 7:43 am
Location: The Internet

Isometric Pathfinding Bugs

Post by Brah »

I have encountered two bugs using the Simple Tiled Implementation and the Jumper pathfinding library when using an isometric map. The first one is that only valid grid coordinates that I can move to when clicking on the map are 9,9. Everything else gives me:

Error
jumper/pathfinder.lua:331: Invalid or unreachable location [9, 1]
Traceback
[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'assert'
jumper/pathfinder.lua:331: in function 'getPath'
unit.lua:83: in function 'mousepressed'
main.lua:47: in function <main.lua:45>
[love "callbacks.lua"]:154: in function <[love "callbacks.lua"]:144>
[C]: in function 'xpcall'

The other is that Jumper doesn't consider map.layers[1].data in the map file to be a valid map for some reason so I'm using an table full of 1s as the grid.

My game:
https://github.com/BrahDesu/sti-jumper-isometric-test
User avatar
Brah
Prole
Posts: 13
Joined: Tue Feb 01, 2022 7:43 am
Location: The Internet

Re: Isometric Pathfinding Bugs

Post by Brah »

I solved the first problem by using math.floor. Would still like to know why Jumper doesn't want to use the tiled map table as it's grid.
User avatar
dusoft
Party member
Posts: 510
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Isometric Pathfinding Bugs

Post by dusoft »

Just a random pointer - do you provide map rows as subtables?

e.g.:

Code: Select all

local map = {
	{0,1,0,1,0},
	{0,1,0,1,0},
	{0,1,1,1,0},
	{0,0,0,0,0},
}
This will not work (or rather would be just one straight row of 20 columns):

Code: Select all

local map = {
	0,1,0,1,0,
	0,1,0,1,0,
	0,1,1,1,0,
	0,0,0,0,0,
}
User avatar
Brah
Prole
Posts: 13
Joined: Tue Feb 01, 2022 7:43 am
Location: The Internet

Re: Isometric Pathfinding Bugs

Post by Brah »

Yes they do. I didn't notice that
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 56 guests