-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
4.0 NavigationServer 2D issues. #43704
Comments
So I made some investigations.
This will likely be solved by #45278, as I am rewriting the whole system and testing it.
Nope, this isn't supposed to work in fact. You need two edges to be similar for two regions to be considered as connected.
This is expected in your example project. In fact your two polygons have a their edges connected. They thus create, between the edges, a path. You would have to modify the Navigation map's edge_connection_margin for the edges not to be connected together. By default this is likely set to 100px, so the edges get connected. Edit: I'd like to implement a way to view the connected edges in the editor.
Same as the second point. I'll see what's happening. |
So it tested the project in 4.0 after fixing it due to being a little outdated by now. groud explained everything that was setup wrong already like the too much overlapping navigationpolygons. I could not find any bug or issue with the navigationpath or the navigationpolygon. |
Godot version: v4.0.dev.custom_build.6a683f801
OS/device including version: Mac Pro 2018/Big Sur (11.0.1)
Issue description: NavigationServer2D seems to have some issues with the following items from my testing and assumptions on how it should work. My assumptions could, however, be totally wrong 😁
TileMaps: Tiles with no navigation polygons seem to have "seams" that allow the pathfinding to plot a path along their borders, at least if they're a part of a tileset that has other tiles that are completely covered by a navigation polygon. This is not a problem in 3.2 stable.
NavigationServer2D/Map doesn't seem to combine overlapping regions into a single navigation polygon. It is my understanding from reading blogs/proposals about the new navigation system that that was one of the main feature of the new system 😄
NavigationServer2D seems to generate paths between two regions with a path that goes outside these regions. I would expect this not to be the desired behaviour.
NavigationServer2D sometimes generates a visible inefficient path on what seems to be really straightforward path in Tilemaps. This could be related to how TileMaps seem to generate its navigation polygon
Steps to reproduce:
I attached the same project for 3.2 and 4 with this ticket. It demonstrates what I assume are issues. It's a simple 2d scene with a navigation2d node. The node contains:
Right mouse button allows you to move the godot sprite to the current mouse position.
Left mouse button uses get_simple_path to draw a line from the current sprite position to the current mouse position
Maybe I'm not understanding the new Navigation system, or setting things up wrong, or have the wrong assumptions, but after messing around with this while playing around with a prototype for a game this seems like genuine bugs to me.
Best Regards,
NavigationTest_3_2.zip
NavigationTest_4.zip
The text was updated successfully, but these errors were encountered: