Support Forum

Shaking / jittering when units are standing

Hi, I’m seeing shaking when the RVO agents are just standing still. What could be the cause?

Here’s a video of what’s happening.
Jittering

This is pretty much the code.

 private void Update () {
        Vector3 pos = transform.position;
        if (path != null && path.Count > 0) {
            pos = path[pathIndex];
        }
        rvoController.SetTarget(pos, speed, speed);
        var delta = rvoController.CalculateMovementDelta(transform.position, Time.deltaTime);
        transform.position = transform.position + delta;
}

Hi

What frame rate have you specified on the RVOSimulator component?

Hi thanks for getting back to me.
These are the current settings. But even if I change the desired FPS to 60 I get just a faster jittering.
When I look at the example RTS project, it is really smooth. I have no idea what I’m doing wrong.

Are you recalculating the path often?

The path is calculated at the once. But the path doesn’t even need to be calculated for the jitter to occur, meaning that the jittering is present even before the unit has be told to move. It’s like RVO CalculateMovementDelta which is constantly updating in the Update method cannot undecided about where the units should be standing. There is no collision/intersection between RVOController either as the radius is quite small and there is plenty of space between units… and yet they jitter. When instructed to move, the path is calculated but as units push other units out of the way and move along their paths, both pushing and pushed units jitter. I’ve stripped all code down to just the Update method I mentioned previously (above post), and still they jitter. There is literally nothing other than the Update code above and path creation.

Could you post your RVOController settings?

Here are the settings (image). I even created a brand new project and tested it and was still getting the same jittering when the units move. If required I could also share the simple test project.

Try reducing the agent time horizon to 0.5. I don’t think that should have such a huge effect, but it can be worth a try.

Sadly, I tried all the settings but they seem to do absolutely nothing to help solve the issue.
As I said, I created a quick test project away from my main project to make sure that no other code is getting in the way. And while the jittering is not apparent when units are still, as they move they jitter around trying to find their route through one another. It doesn’t move at all like the examples (video linked below).

Jittery movement

I have no idea. But you say the example scenes in the same project do work?