Closed sylva-nia closed 5 years ago
I think Navigation2D expects you to map the walkable area, rather than the unwalkable area (though this might change in later versions).
If you look at the screencap, I did that - the green (walkable) areas are navigation polygons, and the red/other colors are collision polygons.
@niodyn Ouch, sorry, I assumed the opposite...
The polygon points have to match for the connectiin to happen. I was thinking maybe this could be improved to detect edge overlaps instead
On Feb 6, 2017 13:59, "Bojidar Marinov" notifications@github.com wrote:
@niodyn https://github.com/niodyn Ouch, sorry, I assumed the opposite...
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/7732#issuecomment-277743888, or mute the thread https://github.com/notifications/unsubscribe-auth/AF-Z29808tw24WNyvi0fwto_-dqtBsD7ks5rZ1FzgaJpZM4L3pmR .
@reduz Ahh, I see. That's counter-intuitive, but certainly something I can work around. Yes, I think edge overlaps would make more sense to most people. Any ideas about the !nm.linked message, is it directly related to the edges not matching up?
@niodyn It comes from scene/2d/navigation2d.cpp:147
. I guess it happens when a navpoly has absolutely no common points with the rest of the tree, or something like that.
Hmm... Is it really necessary to constantly output it as an error, then? It bogs down my game and floods the debugger...
Is there a way to suppress certain errors?
First of all thank you for your report and sorry for the delay.
We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to.
We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us. Could you check if the issue that you described initially is still relevant/reproducible in Godot 3.0 or any newer version, and comment about its current status here?
For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors.
Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed.
Thanks in advance.
Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it.
Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed.
As there was no update since the previous post, we close this issue.
If it is still relevant in the way it was described and discussed above, please comment to ask for it to be reevaluated. If it is only partly relevant, or if the original issue has changed, it would be better to open a new issue (potentially referring to this one) focused on the current state.
Operating system or device - Godot version: Windows 10 / GD 2.1.2
Issue description: Pathfinding using Navigation2D with a child TileMap whose tiles contain NavigationPolygons+Instances: When invoking get_simple_path from the character (RigidBody2D > AnimationPlayer, 2 Sprite layers, CollisionShape2D, RayCast2D), any tiles which are not fully open are ignored. EG: In a build where stair tile NavPolygons did not include the leftmost and rightmost pixels (x of -8 or 8, leaving a 14 x 16 px NavPoly), function returned an empty path. Still happens with left/right and top/bottom bordered tiles, which use similar NavPolygons. My project uses 16x16 map tiles and a 16x16 character. Shrinking the character sprites to below 14x14 did not solve the issue.
Possibly related is this error, which appears in the log/terminal when the function fires: "ERROR: Navigation2D::_navpoly_unlink: Condition ' !nm.linked ' is true. At: scene\2d\navigation2d.cpp:147"
Additional Information: Both the character sprites and tilemap are set to scale 2x2, though the issue still occurred at 1x1. Tiles also contain StaticBody2D and CollisionPolygon2D to prevent accidentally crossing over navigation boundaries and allow physics interactions. As get_simple_path produces some less-than-efficient paths when there are no obstacles, I'm using the RayCast to check for collisions to target and just setting the path to the target point if there aren't any. Oddly enough, since I'm creating the Nav and Collision polygons programmatically in a tool script, they don't actually appear in the scene graph.)