You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue description:
get_simple_path will navigate to a navmesh very far away, and cause the node navigating to go outside the current navmesh. I'm trying to have each node linger about it's dedicated island, but they keep navigating crazy paths. Here's an example
You can see one of the black dots (which are the nodes doing the navigation) navigate across navmeshes, doing a crazy long path, going outside the bounds of the navmesh, to a relatively close point inside the intended navmesh "island".
Even if I surround each island with other tiles, creating one large navmesh, it still does crazy paths: Example of this
A simple fix for this issue would be allowing the user to specify what navmesh the node is allowed to navigate on in the get_simple_path() function.
Steps to reproduce:
Create separate islands with a tilemap navmesh (different tiles per island), place several nodes who have a simple script creating paths and following them, but only tell the nodes to navigate to random tiles of the type they are dedicated to. In order to navigate to a tile inside their current tilemap, a path is generated to another island navmesh and back.
The text was updated successfully, but these errors were encountered:
I believe this is caused by Navigation2D::get_simple_path using Geometry::is_point_in_triangle, which returns false for points on the edges of triangles, leading to endpoints that intersect triangle edges within the navmesh to be counted as "outside the navmesh". It causes weird snapping issues. It can potentially be dealt with if you know exactly where those triangle boundaries are and you offset your endpoints slightly, but it's still a major pain in the ass.
@Calinou @akien-mga
This weird pathfing issue was for the old 2D navigation before 3.5 and is no longer valid.
In Godot 4.0 and 3.5 the 2D navigation uses the same navigationmesh based pathfinding as 3D behind the scene. As long as the NavigationPolygon is created correctly this pathfinding issue no longer happens. In fact the 2D paths have the same path optimization as 3D now.
Godot version:
3.2 stable
Issue description:
get_simple_path will navigate to a navmesh very far away, and cause the node navigating to go outside the current navmesh. I'm trying to have each node linger about it's dedicated island, but they keep navigating crazy paths. Here's an example
You can see one of the black dots (which are the nodes doing the navigation) navigate across navmeshes, doing a crazy long path, going outside the bounds of the navmesh, to a relatively close point inside the intended navmesh "island".
Even if I surround each island with other tiles, creating one large navmesh, it still does crazy paths: Example of this
A simple fix for this issue would be allowing the user to specify what navmesh the node is allowed to navigate on in the
get_simple_path()
function.Steps to reproduce:
Create separate islands with a tilemap navmesh (different tiles per island), place several nodes who have a simple script creating paths and following them, but only tell the nodes to navigate to random tiles of the type they are dedicated to. In order to navigate to a tile inside their current tilemap, a path is generated to another island navmesh and back.
The text was updated successfully, but these errors were encountered: