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

Possibility to find a walkable path to approximately desired direction #45

Open
AqlaSolutions opened this issue Aug 13, 2015 · 8 comments
Assignees
Milestone

Comments

@AqlaSolutions
Copy link
Contributor

Consider a situation: a bot wants to move away (or step back) from a dangerous place. He knows that he should go somewhere back but no exact point is specified. The task is not about reaching a target but about finding a walkable path to approximately desired direction. We can't just search for random points behind the bot because path to those points actually can lead through the point that the bot wants to avoid. Can you implement something that will help in such scenarios?

I think it's related to #15 but still not duplicate because there could be a better way than just checking many many directions with Raycast method.

@AqlaSolutions
Copy link
Contributor Author

Example

@Robmaister
Copy link
Owner

Do you know the dangerous area ahead of time? If so you can define your own Area for those triangles when generating the navmesh and giving it a really high cost during pathfinding.

I haven't heard of anyone using that feature, so it may have a very bad API. I'll look into cleaning it up (or exposing it if some of it is currently private)

@Robmaister Robmaister added this to the 1.0 milestone Sep 3, 2015
@Robmaister Robmaister self-assigned this Sep 3, 2015
@AqlaSolutions
Copy link
Contributor Author

No, I don't know it ahead of time. It could be a hostile player or AoE.

@Robmaister
Copy link
Owner

Then what you're looking for is local steering, specifically an avoidance force.

The crowd management code (SharpNav.Crowds) has some related stuff, but the API is still very messy and potentially buggy. It's pretty much a straight port of Recast's crowd management code. I would look there.

This is also pretty much the highest level (in terms of AI) that SharpNav will cover. Anything higher level should be handled by other libraries or yourself. State Machines, Decision Trees, Behavior Trees, etc. are a massive project on their own.

@AqlaSolutions
Copy link
Contributor Author

@Robmaister of course, I understand the difference. This is not a universal AI library. The local steering implementation should properly deal with obstacles but the current NavMeshQuery API is not well suitable for steering so this task is exactly for navmesh library.

@Robmaister
Copy link
Owner

👍 NavMeshQuery is for path planning, which to me shouldn't include any steering. It should be layered on top of path planning.

I might also rename the Crowds namespace to Steering or move some of the functionality out to it.

@AqlaSolutions
Copy link
Contributor Author

@Robmaister it doesn't matter what the name is if it does what we need ))

I will look into it but can you also give any examples on using Crowds to make avoidance force?

@Robmaister
Copy link
Owner

I don't have any examples as of yet, it should be fairly similar to Recast's at the moment though:

http://masagroup.github.io/recastdetour/group__crowd.html

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