@aron_granberg
Hello, I’m using RVOController for local avoidance (v4.3.84), and I found that I get the best results when I enabled the flag ‘Lock When Not Moving’, however I did notice a few bugs. I’ve attached a gif showing them, and a repro project (use scene Example2).
Local avoidance is inherently local. It does not do any global path planning.
There are some improvements I have been thinking of (pretty complex, though), but ultimately locked agents are not a replacement for pathfinding around obstacles.
I’m not quite sure why Scenario 1 happens, though.
The RVO algorithm relies on all agents being able to move. Locking agents is not something that it likes.
okay, do you suggest I refrain from locking the agents then? The reason why I lock them is because I don’t want them to be moved anymore, they would be performing some actions e.g. attacking, casting a spell, etc. and they need to remain still.
For Scenario 3, is there a way we can randomize which way the agent decides to turn, so that it doesn’t turn right all the time and get stuck? This is by far the biggest issue I’m encountering, when having many agents, they all try to turn right and end up getting stuck against the edge of the terrain.
If I can randomize which way the agents turn, left or right, I think that will ease off a lot of my agents being stuck.
@aron_granberg sorry to bump this, For Scenario 3, is there a way we can randomize which way the agent decides to turn, so that it doesn’t turn to the right all the time and get stuck? In my project (RTS style game) these objects are akin to units, so they’re not really obstacles per say, that’s why I’m using RVO.
Really the problem I’m facing is for some reason the RVO always makes them turn to the right, while that can work sometimes, what ends up happening is a whole bunch of units get stuck.
It’s essentially exactly like Scenario 3 pictures it, there’s a clear path on the left side of the units forming a line, but by turning right, the moving unit ends up being stuck against the line of units in front of it and the terrain.
Have you updated past 5.0 yet? This project is on 4.3.84 and it looks like 5.0 shipped with major changes to local avoidance:
New local avoidance algorithm
The new local avoidance algorithm based on ORCA (Optimal Reciprocal Collision Avoidance), leads to nicer movement in most cases.
It’s also faster! Not only due to the new algorithm, but also because now everything is powered by burst and the unity job system. Local avoidance is up to 10x faster than in 4.2.x.
Takes the navmesh into account. The local avoidance system now takes the navmesh into account automatically, and with good performance. Previously, the RVONavmesh component has been used for a similar result, but it had much worse performance, and it was not as robust.!
Okay I think I’m “caught up” on this thread- not just the question, but also the reasoning behind Aron’s previous answer, and also the context of your need for the randomization.
I think you might wanna look into Writing Modifiers. You’d be able to write a modifier to randomize the pathing. You could probably get even more wild than just “going another direction” with your own modifier.
I don’t believe the path is the issue, it’s the way RVO controls the agents, I’m afraid even if I make a modifier to randomize the path (which I already tried), the RVO will still cause the same problem.
I also tried making it so that agents add a penalty to the ground beneath them, this makes the pathing seek paths that won’t intersect with agents, this is fine but does not solve the RVO issue as shown in Scenario 3.
The issue is simple, RVO is always making the agents turn right to get past blocking agents, while this is perfectly fine when agents have lots of room to maneuver, as soon as space gets constricted, with say walls or terrain, you start seeing deadlocks with this approach, as seen in Scenario 3.
I need to randomize the direction RVO tells agents to turn, or be able to somehow tell the RVO that look, in Scenario 3, turning right will make you hit the edge of the terrain and you’ll get blocked, you must turn left.
If Modifiers can help me solve Scenario 3, could you please tell me how, could you please write a modifier that will fix Scenario 3, it would be much appreciated
Please correct me if I’m wrong but all the scenarios I’ve shown in the repro projects are actual issues with RVO, right?
Sorta- less “issues” in the sense that it is local avoidance being broken, but more this is just a limitation of local avoidance. Kinda like how a car that can’t fly isn’t a broken plane, it’s simply not used for that, as silly of a metaphor as that is.
Earlier in this thread, Aron said:
Which kinda sums it up pretty well. As the system is now, it just doesn’t do “okay Fred and Mike are actually blocking the way, I need to go the other way”, it gives units shoulder space.
I think using penalties would work pretty well- did it just never work for you, or was it just not working in a way you’d like? If you give me some more details on that, I’d love to help workshop a solution to get that working