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

Navmesh.clampMovement with Vehicle flocking behaviours #13

Closed
Glidias opened this issue Nov 8, 2019 · 4 comments
Closed

Navmesh.clampMovement with Vehicle flocking behaviours #13

Glidias opened this issue Nov 8, 2019 · 4 comments

Comments

@Glidias
Copy link

Glidias commented Nov 8, 2019

I have trouble Navmesh.clampMovement to play nicely with a various Vehicle flocking/[path behavious among multiple agents this to work (or maybe it's due to other things). Based on your experience, is this possible? Would be nice to have an example of it.

@Glidias Glidias closed this as completed Nov 8, 2019
@Glidias Glidias reopened this Nov 8, 2019
@Mugen87
Copy link
Owner

Mugen87 commented Nov 9, 2019

Based on your experience, is this possible?

I've actually not used Navmesh.clampMovement() in context of a flocking steering behavior so far. But in general, steering behaviors like flocking or wander can look weird if they are combined with some sort of wall/obstacle avoidance or movement clamping. In certain scenarios, it's better not to just correct the steering force or the final position but give the agent a hint to move in a different direction.

In this way, the same collision is definitely avoided in the upcoming simulation steps (so the agent does not try to steer over and over again into the same wall).

@Glidias
Copy link
Author

Glidias commented Nov 10, 2019

Yes, I don't just use flocking . I use some constrain to navmesh behaviour like flowfield as well. However, I had to use a seperate collision approach instead of clampMovement because the current one doesn't seem to work too well, and it seems it only checks a single closest edge and may not account for large velocities where multiple potential edges are involved? I don't see any conservative swept aabb or radius sphere used in the query for edges

@Mugen87
Copy link
Owner

Mugen87 commented Nov 10, 2019

The idea is to us a spatial index in combination with the nav mesh. It is evaluated in NavMesh._getClosestBorderEdge(). In this way, you only check border edges of adjacent regions.

because the current one doesn't seem to work too well

Can you please explain in more detail what you mean by that? It's best to describe your expected and actual behavior. Otherwise such statements are not really useful for the project.

@Mugen87
Copy link
Owner

Mugen87 commented Nov 19, 2019

Closing for now. Feel free to reopen the issue when you can provide more details.

@Mugen87 Mugen87 closed this as completed Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants