Hello guys,
i have made a cat & mouse mobile game where you the player need to run away from the killer and try to not get caught, the killer is an ai killer that has some Marker2D’s around the map which are his patrol points.
And in Godot Version 4.4.1 the path finding worked just fine, my killer has his NavigationAgent2D and the maps have their NavgiationRegion2D Node with a valid NavigationPolygon Map that excludes all my collision accordingly which looks quite well.
Now the problem i have is since i updated to Godot Version 4.5 my killer is isn’t finding correct paths anymore (he is just going a bit to the left and then a bit to the right → the navigation path is very short and almost exactly next to the killer → so it looks like he is jiggling at his position forever)
I have read the changelog of Version 4.5 and read the migration document from 4.4.1 to 4.5 but couldnt find any information for what i need to change to get the pathfinding running again in Version 4.5.
Do you have any ideas?
If you need any more information let me know..
I have the same problem: NavigationServer2D.map_get_path() no longer works. The returned path always contains only 2 points, leading to the nearest navigation mesh edge, regardless of whether the optimize parameter is set to true or false.
idk my code from 4.4.1 has now massive issues because of the updte to 4.5 and i just can’t find any information to what exactly changed and what functions i should use now instead of old ones for example..
except for the github logs there is nothing for documentation reference ..
tomorrow i can post my previously working code from 4.4.1.
maybe you can spot the issue.
You shouldn’t need to update anything. The NavigationServer2D is now independent to the NavigationServer3D but that’s it. The API should stay the same.
This video shows two clips: In Godot 4.4.1, the pathfinding works correctly. After migrating the same unchanged project to Godot 4.5, the pathfinding no longer works as expected.
The code is identical in both cases – only the engine version has changed.
Recalculate the Navigation Mesh. Maybe that’s enough to solve your problem.
Delete the NavigationRegion2D and create a new one in 4.5, reparenting any nodes as necessary. See if that solves the problem.
Delete and re-add all nodes in the scene that contain a NavigationAgent2D. See if that solves the problem.
Delete the actual NavigationAgent2D in the nodes themselves, then add new ones and see if that solves the problem.
If you find a solution, post a bug in the Godot GitHub issue tracker along with the solution. Because you’re right - it should just work. Also, if you can’t get it working, you should also log a bug.
Okay i tried your points and none of these worked, but when i was just about to log the bug on github i already found a log thats already related to this problem and i found out this:
smix8 said in the bug log:
Please do not ignore navigation map or region rasterization errors showing up in debug.
When edges are merged wrong or not at all due to layout issues the pathfinding will be broken, no exception.
You likely had the very same issue in Godot 4.4.1 but just did not notice because other edges were affected. The rasterization logic has not changed, only order has.
And i found myself with that error in Godot 4.5:
E 0:00:01:611 _build_step_find_edge_connection_pairs: Navigation region synchronization error. More than 2 edges tried to occupy the same map rasterization space. This is a logical error in the navigation mesh caused by overlap or too densely placed edges.
<C+±Fehler> Condition “pair.size >= 2” is true.
<C+±Quelle> modules/navigation_2d/2d/nav_region_builder_2d.cpp:211 @ _build_step_find_edge_connection_pairs()
so i guess maybe it actually is fixeable if i knew what i need to fix.
If that’s the case, they’ll probably roll a 4.5.1 to fix it. One of the realities of the releases is that people try the first dev release, the first beta release, and the first release candidate release. Then everyone jumps on the new release. But in between the number of people using it is less. They mentioned this in their podcast. So it may be that not that many people were using this feature until the new release.
However the response that it’s overlapping edges would indicate that you are drawing your own polygons somewhere. If that’s the case, then step 5 of my things to check would be redrawing all the polygons so they don’t overlap.
I hope (if they even fix this bug) they release the Bugfix before November 1st… because that is when i will not be able to update my game on Google Play Store anymore, since the pathfinding doesnt work in 4.5 but i need the 16KB page size option of Godot 4.5…
does anyone have another idea how i can maybe keep using 4.4.1 while they are working on a fix but still be able to compile with 16KB page size?
BR