Link2 + Avoidance bug

There is a strange bug with follower entities that enter a link2 node, they seem to suddenly try to avoid when they should not.

The setup:
Entities walking one behind the other at same speed with no avoidance occurring… as soon as the entity in front enters a link2 which should mean it is no longer contributing to the avoidance system - the entity behind the leader freaks out and changes their direction.

You can see this in the GIF below, all moving at a uniform speed yet soon as the first one enters the link2 the one behind diverts to it’s right - eventually causing complete chaos as all the ones behind also then avoid - essentially a traffic jam occurs.

This makes the idea of agents entering some kind of queue for example quite buggy and chaotic and just unusable. I have no idea how to fix the problem.

Can you please look into this bug they should not be reacting to entities that are entering a link2. I should note i tested this with Unity’s agents and they seem to behave fine but i hate Unity’s navmesh and avoidance solution in general so i can’t use it!

Hi

It might be that the agent is slowing down just before entering the off mesh link, and the agent behind it then immediately tries to avoid a collision with it?
It’s hard to tell from the gif, but maybe you can see if this is the issue?

According to the debug on follower entity component, the leading entity was always going 1.75m/s when they entered the link2, no slow down occurring (not sure why they would).

But i notice the entity behind the leader still tweaks out even if its further behind:

Notice how when they re-enter the link2 to go back, just as the leading entity enters the link2 the one behind does this weird sudden left sharp turn (see my mouse hovering over it). It’s really subtle but it happens every time on any node2 when the one in front enters.

If i turn local avoidance off on the entities the problem does not happen, which means avoidance is still actively doing something as an entity joins a node2, maybe the RVO is still present for one extra frame when it should not be before being disabled as it enters node2 - just a guess though as i don’t know much about your avoidance system handles it all.

Could you enable RVO debug drawing for one or both of the agents, to see why it’s doing that?

I assume you understand what this debug visuals mean as i have no idea how to interpret it:

It looks like as soon as the RVO in front disables by joining node2, the second entity’s recalculated velocity seems to recalculate incorrectly, it happens at the exact moment the RVO debug visuals turns off for the one in front.

How are you disabling Local Avoidance? If you haven’t tried yet I would “disable” it by changing priority to 0. I’d even go as far as making it so that priority slowly lerps to 0 as they either get closer to the link or after they enter the link. This may help by making units less twitchy by the sudden dropout of an agent that was previously affecting their velocity.

When they enter node2 links they auto disable avoidance, you would have to ask Aron about that, I’m not manually doing it.

@aron_granberg @tealtxgr

I made a simplified scene and found the bug is still present, maybe this visual is easier to see what’s going on, than my previous complex setup:

It should be pretty easy to reproduce, make two areas connect them by a link2 and have them path across whilst being relatively close to each other.