Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlapping navigation tiles do not pathfind with Navigation2D #45045

Closed
CyberFoxar opened this issue Jan 9, 2021 · 3 comments
Closed

Overlapping navigation tiles do not pathfind with Navigation2D #45045

CyberFoxar opened this issue Jan 9, 2021 · 3 comments

Comments

@CyberFoxar
Copy link

CyberFoxar commented Jan 9, 2021

Godot version: 3.2.3

OS/device including version: Windows 10 Version 10.0.19042 Build 19042
Not really graphic related, I'll add if needed.

Issue description:

When configuring a Navigation2D Node using a TileMap node, get_simple_path does not pathfind between tiles that have overlapping navigation polygons.

This is an issue especially with hexagonal or isometric tilemap.
A workaround is to have pixel-perfect navigation polygons, but this quite bothersome when lots of different tiles are involved.

Steps to reproduce:
Create a Navigation2D node and add a TileMap as a child.
Configure the tilemap through the TileMap editor, set the navigation polygon (or grid) to overlap between nearby tiles.
Debug with a Line2D the path generated by Navigation2D

Minimal reproduction project:

MinimalBroken.zip

The project is setup with an hexagonal grid. Each tile has a rectangular navigation polygon that overlap between the top and bottom rows. The line2D shows the plotted path. You can see that it can pathfind easily in the row (because navigation polygons do not overlap) but not between rows.
You can see the polygon by ticking debug>"View Navigation".

Sidenote:
Related to #43079, which was closed by its owner without reasons.

@KoBeWi
Copy link
Member

KoBeWi commented Mar 23, 2021

This is most likely fixed in 4.0 with the new navigation changes, but it's still an issue in 3.x (it was recently brought up by a user here https://godotforums.org/discussion/25471/how-to-visually-debug-tilemap-navigation)

@KoBeWi KoBeWi added this to the 3.4 milestone Mar 23, 2021
@Zireael07
Copy link
Contributor

... and it's also an issue in the 3d version in 3.x, too.

@akien-mga akien-mga modified the milestones: 3.4, 3.5 Nov 8, 2021
@smix8
Copy link
Contributor

smix8 commented May 21, 2022

This is no longer a problem for 2D and 3D in Godot 4.0 and 3.5 with the new NavigationServer when navmesh points / vertex overlap exactly or borders / edges are within edge_connection_margin and align so the NavigationServer considers them as connected for pathfinding.

There is still a specific issue with TileSets stored NavigationPolygon resources cause the TileSet Editor stores the NavigationPolygon wrong while normal NavigationPolygon resources created outside the TileSet work just fine. See issues
#30883 and #41349.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants