-
Notifications
You must be signed in to change notification settings - Fork 173
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
perf: Add path height correction on world load #1178
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I am seeing more successful queries when using a X and Z halfExtents of zero. about 5% more successful queries from before. |
This is resulting in 100% successful queries now. |
ran around quite a bit in gnarled forest, crux prime, return to venture explorer and saw no issues with enemies teleporting. |
The poly height always matching the one from rhe nearest reg is further reinforced by the lookup now being directly vertical with so variance in the x or z axis. This ensures you find the correct height or find nothing |
- Only go up and down, do not deviate from the point you are on - As a backup, use the nearestPoint on the nearestPoly, should detour be able to find one. - Add a debug assert to fail the program should toReturn differ from nearestPoint[1]. Update dNavMesh.cpp Update dNavMesh.cpp
eb7fc24
to
8da23df
Compare
Re-tested without capturing the res return from getPolyHeight and actually returning the correct value and no changes except from the expected path fixes. |
3277201
Because many waypoints for movement place the Y at some height far below the map, we need to correct this height to match that of the navmesh. Doing this at runtime is very expensive as some maps are very tall and so the halfExtents would need to be very large. Doing this at world load is a far more ideal place to take care of this as this only really needs to be done once so that at runtime, more approximate heights can be calculated with the same halfExtents as currently.
Tested that there are no changes aside from the height being changed at world startup. This may resolve issues with some AI being unable to find a close waypoint on the navmesh due to their waypoint height being far too low for the halfExtents to allow finding of the nearest poly.