Page 1 of 1

Isometric Pathfinding Bugs

Posted: Sun Jan 21, 2024 8:05 am
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

Re: Isometric Pathfinding Bugs

Posted: Sun Jan 21, 2024 8:31 am
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.

Re: Isometric Pathfinding Bugs

Posted: Sun Jan 21, 2024 4:00 pm
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,
}

Re: Isometric Pathfinding Bugs

Posted: Sun Jan 21, 2024 11:58 pm
by Brah
Yes they do. I didn't notice that