Character are jittery when using DetourCrowd vs AIController

I’m trying to get some AI characters chasing after the player, but I’m not having much luck getting this to look good.
I don’t think it makes too much of a difference, but I’m using C++ not blueprints.

If I use the AIController and move them with MoveToActor() using RVO, I get quite nice smooth motion and rotations and the AI movement looks quite nice. However, sometimes the AI will get stuck if it’s pushed off the navmesh.

If I switch the AI Controller Class to DetourCrowdAIController and turn off RVO, they don’t seem to get stuck anymore and find more interesting paths between each other, however the rotation is very jittery with the characters shaking right and left.

How can I get smooth rotation with the DetourCrownAIController?

1 Like

Hello, I would also like to know, have you found any way to stop this?

No, unfortunately I never did find a solution for this. At the moment it’s on my list of things to fix latter by writing my own movement code.

Try turning off “Use Controller Rotation Yaw” (Under Pawn Settings) when using DetourCrowd AiController it is instantly snaps rotation of the pawn to whatever DetourCrowd solved.
Then go to Character Movement Component (in case you are using Character as Base class) and play around with “Rotation Settings” Set rotation rate to something resonable like 180 Yaw and tick Use Controller Desired Rotation/Orient Rotation To Movement (i think they are exactly the same values in this particular case)

5 Likes

image
try modifying this variable on movement component.

2 Likes

I know this is an old post, but it was something that I was stuck on for ages and this is the first post that comes up when googling. In your animation graph, do a print string on your speed as well as your rotation. You will probably find that, as the detour controller, is working, the speed is dropping from, say, 195 to 0 every few frames. This causes your blend space to jump between your idle animation and your run animation, causing jittery animations. I’m not using a 2d blend space, but I imagine something similar is happening with rotation. The solution I used is twofold- add a buffer. So when the frames drop to 0 frames, I carry on using the previous speed for 0.2 seconds before actually allowing a speed of 0 through. This gives a bit of a buffer for those sudden drops. I then also use “fInterp To,” to smooth out any changes in speed.

1 Like