When I enable the Update Rate Optimization on the SkeletonMeshComponent, and then PIE for multiplayer. Once the simulated character enters the frame-skipping optimized state, characters with Motion Matching enabled exhibit a momentary incorrect rotation during turns. This issue can be reproduced in the official Game Animation Sample project.
After investigation, I found that the animation node “Offset Root Bone” triggers this problem. I suspect that when the character is under URO optimization, it fails to update the correct root bone’s rotation for the skipped frame. So the root rotation can only follow the rotation of capsule instead of driven by the root motion from motion matching animation.
How should this issue be resolved?
Hi, could you record a video of the issue that you’re seeing and attach it to this thread? I see some issues when running with URO enabled, but they’re more related to the pose of the character rather than the rotation of the root. There are also known issues with the character implementation in the game animation sample when running with replication because the facing direction of the capsule isn’t replicated by default. This can cause issues with the capsule position during banked turns. A video would make sure that I’m looking into the same issue that you’re hitting.
Hi, thanks for sending over the video. I did some further investigation into this and I see the issue that you’re running into. This isn’t actually limited to either motion matching, or networked characters. It can be reproduced on the player character in the game animation sample, if the URO code is altered to allow the update of player-controlled meshes to be throttled.
I’ve attached a video that shows the issue. At first, with URO set to update/evaluate every frame, the offset root bone is applying a counter rotation to keep the character root oriented forward consistently as the capsule facing direction changes. After I set the cvar to force a URO update/evaluate only ever 10 frames, you can see how the counter rotation is only applied every 10th frame. In between those frames, the root rotates with the capsule. So you get discontinuities every 10 frames when the offset root bone node runs.
Unfortuantely, there’s no easy solution to this. Effectively, the logic that applies the counter rotation (or translation) to the root bone needs to run every frame. Not just on the frames when the anim graph evaluates. That’s a fundamental issue with the current implementation of this logic since it lives within the anim graph. And we aren’t guaranteed to do an anim graph evaluation if URO (or the budget allocator) means that evaluations aren’t done every frame.
If you need a fix for this, one option would be for you to reimplement the offset root bone logic at the actor level, instead of within the anim graph node. If this logic lived within the actor blueprint, it would run every frame the actor was ticked so would avoid this issue.
The simpler workaround for this would be to change the Translation and Rotation Mode properties on the node when URO throttling the update/evaluate rate of a mesh. When that is the case, you could change the Translation and Rotation Modes to Release (rather than Accumulate as is the default). That should prevent the counter rotation/translation being generated by the node when URO is active. Alternatively, you could effectively turn the node off in the same way that we do in the Game Animation Sample with the OffsetRootBoneEnabled variable (although I think this is disconnected by default in the sample).
I’ll also make the dev team aware of this issue so they can think about what a longer term solution would be.
We’ll need to discuss this further internally and make a decision on what we want to do. It may be that the new animation system (AnimNext/UAF) removes the need for any kind of workaround since the hope is that performance will be good enough that systems like URO aren’t required. But we’re still a long way off from that system being production ready.
Anyway, I’ll close off this thread for now but you can always reopen it if you have further questions on this.
Video Link: https://www.youtube.com/watch?v=6K7cwmtMBFQ
We can see that the character’s rotation jumps for a few frames when turning back or Idle Turn. Everything is fine when I close the URO option.
And I found an other issue when I SetActorRotation directly. The mesh rotation would skip to the new rotation in one frame and then back to original rotation.
Thank you for you suppport!
Thank you very much! Hope that it will be fixed in future version.