Dynamic Obstacle Avoidance« Back to Previous Page

How can I make AI Avoid walking through other AI and Dynamic Objects?
Posted by Chris Taylor (Questions:1, Answers:1)
Asked on February 17, 2022 5:25 am
0

Prime how do you stop path finding? For example, if my character is on a waypoint route and moving to the next node, I want to stop and move to another MoveLookTarget position and then resume to the waypoint I was headed. Is this don’t via PathFindAction.Stop()??

Posted by CodersExpo (Questions:0, Answers:17)
Answered On March 16, 2022 5:34 am #
0

I don’t have a great answer for you, because all solutions have problems. You may want to consider using a custom motor with raycasting. Whenever you decide you need to avoid something, just ignore the path and move directly toward your avoidance point. Then once you are either at the avoidance point or no longer in danger of colliding, resume path following.

Posted by prime (Questions:2, Answers:127)
Answered On February 21, 2022 1:37 am #
0

If there were a really straightforward answer for that, the solution would already be in RAIN

I was hoping that Rain had it built in

The simplest approaches will use raycasting to detect upcoming collisions and redirect AI movement to avoid the collision.

How do I reroute the path if a collision is detected?

Posted by Chris Taylor (Questions:1, Answers:1)
Answered On February 18, 2022 6:06 pm #
0

Hey Chris,

If there were a really straightforward answer for that, the solution would already be in RAIN

The simplest approaches will use raycasting to detect upcoming collisions and redirect AI movement to avoid the collision. It gets tricky when
a) there are multiple objects to avoid,
b) the other objects are avoiding you too,
c) you want to stay on the navmesh while you do your avoidance

It gets even tougher when you want the results to be realistic. Should you slow down and stay on your path? Should you speed up? Should you go around? Compute an entirely new path? Stay on course and wait for the other guy to go around?

Here’s what we’re currently working to add to RAIN:
1) Adding lanes to waypoints. This will allow AI to choose unoccupied lanes and avoid each other when walking similar paths.
2) Supporting real-time navmesh adjustments and localized repathing. This is our primary solution and involves creating forward velocity colliders and recalculating/restitching the navmesh rapidly.
3) Supporting static nav mesh updates for longer lasting navmesh changes (like a tree falling to block a path or a bridge exploding).

We’re still trying to perfect these solutions and don’t have a scheduled release date yet.

Posted by prime (Questions:2, Answers:127)
Answered On February 17, 2022 2:45 pm #