-
Notifications
You must be signed in to change notification settings - Fork 26
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
Agent takes an unnecessary longer path when there's a direct straight path to the target #452
Comments
FI tested on the C++ demo an it has the same issue Found this similar issue on recast repo From what I understand it might be a side effect of how pathfinding computes traversal costs using mid-edge points on polygons. One suggested solution is to do a direct raycast between the start and end point, but not sure if I can use this solution and keep using Agent/Crowds at the same time; in other words I need to override the path corridor that the agent need to take |
For anyone encountering the same issue, I ended up with trying a direct raycast first, if success then I use I tried Another possible alternative is to use |
Exposing setCorridor shouldn't be difficult - I'm happy to find some time for that if it's going to be useful! |
Hi @isaac-mason thanks for your reply. Actually I don't think it's necessary, there're other cases direct raycast can't solve (eg taking the longer detour to go around a wall). I remember reading somewhere on Mikko's blog that for scenes with big open spaces tiled meshes should be preferred, since solo ones tend to create large polygons next to small ones, for which A* doesn't perform well. I'm taking a look back at tiled meshes (had some issues with them in the past) |
For sure, tiled navmeshes should at minimum greatly limit the severity of these issues. Also, thanks again for submitting a fix for the tiled navmesh issues you ran into! |
Using the following model and the default generation params on the generator website.
scene (7).glb.zip
the agent is not taking the obvious direct path to the target.
Screen.Recording.2024-12-11.at.12.42.09.mov
The text was updated successfully, but these errors were encountered: