Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@zz2108828
Copy link
Contributor

Because span.smax is always > 0, bot > 0 as well, and (-walkableClimb - bot) is always < -walkableClimb. Furthermore, as long as minNeighborHeight < -walkableClimb' at least once, there is no need to continue the traversal.

Because span.smax is always > 0, bot > 0 as well, and (-walkableClimb - bot) is always < -walkableClimb. Furthermore, as long as minNeighborHeight < -walkableClimb' at least once, there is no need to continue the traversal.
Because span.smax is always > 0, bot > 0 as well, and (-walkableClimb - bot) is always < -walkableClimb. Furthermore, as long as minNeighborHeight < -walkableClimb' at least once, there is no need to continue the traversal.
@zz2108828 zz2108828 closed this Oct 29, 2023
@zz2108828 zz2108828 reopened this Oct 29, 2023
Revise Comment
@zz2108828 zz2108828 changed the title Code cleanup and minor refactor in RecastFilter.cpp rcFilterLedgeSpans Code cleanup and small optimizations in RecastFilter.cpp rcFilterLedgeSpans Oct 31, 2023
if (neighborBot < accessibleNeighborMinHeight) accessibleNeighborMinHeight = neighborBot;
if (neighborBot > accessibleNeighborMaxHeight) accessibleNeighborMaxHeight = neighborBot;
}
else if (accessibleNeighbourHeight < -walkableClimb)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to break out of the loop here? minNeighborHeight might not get set correctly if there are multiple adjacent walkable areas that overlap more than walkableClimb with the walkable area above the current span.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh nvm I guess since iteration order is bottom to top it's fine

@grahamboree
Copy link
Member

Ty!

@grahamboree grahamboree merged commit 3e94c3b into recastnavigation:main Dec 31, 2023
ikpil added a commit to ikpil/DotRecast that referenced this pull request Jan 1, 2024
…eSpans (recastnavigation/recastnavigation#672)

- recastnavigation/recastnavigation@3e94c3b

* Code cleanup and minor refactor in RecastFilter.cpp rcFilterLedgeSpans

Because span.smax is always > 0, bot > 0 as well, and (-walkableClimb - bot) is always < -walkableClimb. Furthermore, as long as minNeighborHeight < -walkableClimb' at least once, there is no need to continue the traversal.

* Code cleanup and minor refactor in RecastFilter.cpp rcFilterLedgeSpans

Because span.smax is always > 0, bot > 0 as well, and (-walkableClimb - bot) is always < -walkableClimb. Furthermore, as long as minNeighborHeight < -walkableClimb' at least once, there is no need to continue the traversal.

* Update RecastFilter.cpp

Revise Comment
ikpil added a commit to ikpil/DotRecast that referenced this pull request Jan 1, 2024
…eSpans (recastnavigation/recastnavigation#672)

- recastnavigation/recastnavigation@3e94c3b

* Code cleanup and minor refactor in RecastFilter.cpp rcFilterLedgeSpans

Because span.smax is always > 0, bot > 0 as well, and (-walkableClimb - bot) is always < -walkableClimb. Furthermore, as long as minNeighborHeight < -walkableClimb' at least once, there is no need to continue the traversal.

* Code cleanup and minor refactor in RecastFilter.cpp rcFilterLedgeSpans

Because span.smax is always > 0, bot > 0 as well, and (-walkableClimb - bot) is always < -walkableClimb. Furthermore, as long as minNeighborHeight < -walkableClimb' at least once, there is no need to continue the traversal.

* Update RecastFilter.cpp

Revise Comment
@elsid
Copy link
Contributor

elsid commented May 10, 2024

This PR changed the result of navmesh generation. Does not look like it broke something but it's unclear if this was intentional. If this is an optimization of the generation process it should not affect the data. One more reason to do #678 .

What exactly has been changed in the navmesh data requires additional investigation but the change is visible because different paths are generated for the same input (to recast to generate navmesh to be used by detour). In a test case where I've noticed this just one point is added in the middle of the path and it looks legitimate.

@zz2108828
Copy link
Contributor Author

zz2108828 commented May 11, 2024

This PR changed the result of navmesh generation. Does not look like it broke something but it's unclear if this was intentional. If this is an optimization of the generation process it should not affect the data. One more reason to do #678 .

What exactly has been changed in the navmesh data requires additional investigation but the change is visible because different paths are generated for the same input (to recast to generate navmesh to be used by detour). In a test case where I've noticed this just one point is added in the middle of the path and it looks legitimate.

Thank you for your investigation. Could you please send me the problematic test cases (3D models along with their corresponding parameters)? Also, could you specify where the Navmesh encountered issues?

I'm really sorry. I might not be able to guarantee solving this problem right now because my current schedule doesn't allow for in-depth investigation. If there are issues with the walkability of the edge span, then it indicates there might be a problem with my PR. If different situations occur, they are very apparent in the Walkable Voxels view. This function only handles the edge parts of the span, detecting walkable spans around it (above, below, and adjacent) based on the Agent's Max Climb and Height. If there are significant drops around the span (cliffs, overhangs, window sills, steep slopes, etc.), it marks the span as impassable.
image

@elsid
Copy link
Contributor

elsid commented May 11, 2024

Thank you for your investigation. Could you please send me the problematic test cases (3D models along with their corresponding parameters)? Also, could you specify where the Navmesh encountered issues?

It's not very simple to share the exact model. The problem appears in a scene composed out of many models and the contents is protected by the license not allowing to share it (it's not owned by me). Basically you need to buy the game. Although the program using the content to generate navmesh and find paths is open source. If you're interested I can share more details.

I'm really sorry. I might not be able to guarantee solving this problem right now because my current schedule doesn't allow for in-depth investigation.

I'm interested if the change was intentional or expected. If it does not break anything, no need to worry.

Here is how it looks like:

recastnavigation_before

recastnavigation_after

@zz2108828
Copy link
Contributor Author

I'm interested if the change was intentional or expected. If it does not break anything, no need to worry.

This PR shouldn't modify the Navmesh.
Can you display a visual debugging mode similar to the "Walkable Voxels" in RecastDemo?

@elsid
Copy link
Contributor

elsid commented May 11, 2024

Can you display a visual debugging mode similar to the "Walkable Voxels" in RecastDemo?

Not without writing code. I can try but this might take some time.

@elsid
Copy link
Contributor

elsid commented May 20, 2024

Here are the screenshots with rendered walkable voxels (duDebugDrawHeightfieldWalkable) from different view point:

before:

recast_heightfield_before

after:

recast_heightfield_after

There is at least one voxel with no longer walkable surface now.

Mauler125 added a commit to Mauler125/r5sdk that referenced this pull request Aug 22, 2024
Merge recastnavigation/recastnavigation#672

Actually improves the filtering of ledge spans as they are now a lot firmer against their limits, this is also beneficial for traverse link generation as we get more accurate ledge spans to work with (making the offsetting math do its job better since it assumes accurate ledge spans).

There was a report further down this pull request that pathing results differed after this change, along with a new one at recastnavigation/recastnavigation#729. I was however not able to replicate it, nor did any behavior change in-game on a navmesh generated on kings canyon.

// Skip neighbour if the gap between the spans is too small.
if (rcMin(top, neighborTop) - rcMax(bot, neighborBot) > walkableHeight)
if (rcMin(top, neighborTop) - rcMax(bot, neighborBot) >= walkableHeight)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the comparison is changed from > to >=?

elsid added a commit to elsid/recastnavigation that referenced this pull request Apr 13, 2025

// Skip neighbour if the gap between the spans is too small.
if (rcMin(top, neighborTop) - rcMax(bot, neighborBot) > walkableHeight)
if (rcMin(top, neighborTop) - bot >= walkableHeight)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the comparison is changed from >to >=?

elsid added a commit to elsid/recastnavigation that referenced this pull request Apr 13, 2025
recastnavigation#672 changed
comparison operators from > to >= in 2 places for unclear reason which
changed how navmesh is generated
(recastnavigation#729).

Add test case affected by this change.
elsid added a commit to elsid/recastnavigation that referenced this pull request Apr 13, 2025
recastnavigation#672 changed
comparison operators from > to >= in 2 places for unclear reason which
changed how navmesh is generated
(recastnavigation#729).

Add test case affected by this change.
elsid added a commit to elsid/recastnavigation that referenced this pull request Apr 13, 2025
recastnavigation#672 changed
comparison operators from > to >= in 2 places for unclear reason which
changed how navmesh is generated
(recastnavigation#729).

Add test case affected by this change.
elsid added a commit to elsid/recastnavigation that referenced this pull request Apr 13, 2025
recastnavigation#672 changed
comparison operators from > to >= in 2 places for unclear reason which
changed how navmesh is generated.

Add test case affected by this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.