Need help about path finding in iso TileMapLayer

Godot Version

Godot 4.4

Question

Hi, I’ve started creating a game in Godot in isometric 2D (32px; 16px), but I’m having a problem. Godot’s Path Finding A* is, how to put it, unsuitable and doesn’t work in isometric. I’m trying to do path finding without diagonals, but sometimes Godot’s A* doesn’t work. Following this, I tried creating my own path finding method, but even though it works better, sometimes it doesn’t find the shortest path or doesn’t find any path at all. I’d like to know if anyone has a solution. Thanks! ^^

Have you tried using NavigationAgent2D and NavigationRegion2D? It’s a lot simpler to use than making your own navigation methods using A*.

I’ll look into it and see what I can do. I’m new here, so I don’t know much. Thanks for your reply.

1 Like

So, after some experimentation, the NavigationAgent2D works well, but the cell list I get (after conversion with local_to_map) gives me the correct cells, but it includes diagonals, which isn’t what I want. I tried to work around the problem, but without success…

For exemple this path :

image

give me this : [(-1, -1), (-1, -1), (-1, -3), (-1, -3)]

but I want this : [(-1, -1), (0, -2), (-1, -3)]

Play around with the settings of the minimum line segment, as well as other settings on the Agent and Region.

So (sorry for the delay, between the holidays and being sick I haven’t had much time to test these last few days) I’ve done some research and changed a lot of parameters, but I haven’t been able to do anything else. Do you have any other solutions?