Godot: Pathfinder and 2D isometric tilemaps dont find path between side cells

Created on 25 Oct 2020  路  6Comments  路  Source: godotengine/godot

Godot version: 3.2.2.stable

OS/device including version: Manjaro / Nvidia Rtx 3090 / Core I9 / 64GB

Issue description:

I am configuring the Navigation2D node in my project, which is using a TileMap node configured for isometric visualization. When debugging, I realized that it only generates its way on the tile where it is already positioned, never to other places.

I've tried to increase the size of the navigation borders in the tilemaps editor, but it just doesn't work.
I tried to make the mesh match perfectly, and it didn't work.

Steps to reproduce:

Create a Navigation2D node and add a TileMap as a child.
Configure the tilemap through the TileMap editor.
Debug with a Line2D the path generated by Navigation2D

Peek 25-10-2020 14-25

image

image

extends Line2D

onready var nav : Navigation2D = get_parent() as Navigation2D
onready var player : Node2D = get_parent().get_node("Player") as Node2D
func _ready():
    InputBehavior.connect("clicked", self, "_input_clicked")

func _input_clicked(position : Vector2) -> void:
    points = nav.get_simple_path(nav.get_closest_point(player.get_global_transform().get_origin()), nav.get_closest_point(position))

extends Camera2D


func _input(event):
    if event is InputEventMouseButton and not event.pressed:
        InputBehavior.clicked(get_global_mouse_position())
navigation

Most helpful comment

If it's an issue of polygons having to be pixel perfect, it's an already reported issue that applies to both 2D and 3D navmesh/navpoly.

Yes, merging overlapping polys would be an obvious improvement, but no one did it in at least a year that passed since I last saw the issue reported.

All 6 comments

@schweigert Do you have any custom properties on the tiles?

It seems like you have the navigation debug on in the screenshot, hard to see when it's so green.

I tested navigation with a isometric tilemap and I had no issues.

No, I didn't add any attributes to the tile @erictuvesson .

image

I found it strange because in other examples I saw, navigation appears united in debugging. In my case, it displays several separate blocks, and I cannot understand why it is not merging the navigations.

Can you share the project? I am not sure how you are making the tiles offset as there are multiple ways.

Unfortunately not because it is a commercial project.

I managed to make it work, but it really needs to be pixel perfect between the tiles' polygons, which when we have several tiles in separate sprites is difficult to test.

Peek 28-10-2020 09-04

I found it strange that if two mesh polygons are overlapping, it does not mix both to create a unique navmesh. Perhaps it is a possible improvement in this system. What do you think?

If it's an issue of polygons having to be pixel perfect, it's an already reported issue that applies to both 2D and 3D navmesh/navpoly.

Yes, merging overlapping polys would be an obvious improvement, but no one did it in at least a year that passed since I last saw the issue reported.

I found the issues: https://github.com/godotengine/godot/issues/12275, https://github.com/godotengine/godot/issues/17118 and a duplicate was closed as fixed with the 4.0 navigation server feature (but it's still an issue in 3.x)

So they're waaay older than I thought, explains why I couldn't find them when writing the previous comment.

Was this page helpful?
0 / 5 - 0 ratings