Skip to content
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

Island system #352

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

scripter01
Copy link

Island system: use in quick check passability from one polygon to another polygon (This system works on compares polygon island indices).

To activate this system you need uncomment define NAVMESH_ISLAND_SYSTEM in file: "DetourNavMesh.h".
To split a mesh into islands you must use a class dtIslandManager in the file: "DetourNavMesh.h".

Copy link
Member

@jakobbotsch jakobbotsch left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. I like this kind of functionality a lot, but I don't think this implementation quite gets us there. With an implementation of this we clearly need to document what the limitations are. The biggest being that it only works on static meshes. I have also noted that your implementation does not support unidirectional offmesh connections, which is a correctness issue.

The static mesh thing is pretty hard to resolve, but we can definitely support unidirectional offmesh connections. I have implemented this functionality before, and my approach was to compute strongly connected components of the mesh and then take the transitive closure. That would be an alternative strategy to try out, but we do need to support directed traversal.

There is also more low-hanging fruit when you have this kind of thing. One thing that I can think of is supplying variants of findNearestPoly -- findNearestNavigableToPoly and findNearestNavigableFromPoly -- which guarantee that the returned poly can be navigated to from some point, or can navigate to some point.

Detour/Include/DetourNavMesh.h Outdated Show resolved Hide resolved
Detour/Include/DetourNavMesh.h Outdated Show resolved Hide resolved
Detour/Source/DetourNavMesh.cpp Outdated Show resolved Hide resolved
Detour/Source/DetourNavMesh.cpp Outdated Show resolved Hide resolved
if (islandIndexFrom != islandIndexTo)
return false;
return true;
}
Copy link
Member

Choose a reason for hiding this comment

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

I have not checked your implementation closely, but I don't see how this can be correct. This will give symmetric answers, i.e. checkPathExists(a, b) == checkPathExists(b, a). But that is certainly not correct in the face of unidirectional offmesh connections.

Copy link
Author

Choose a reason for hiding this comment

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

My system not work with offmesh connections.

Copy link
Author

Choose a reason for hiding this comment

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

I think I will do this system with offmesh connections, but later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants