Hi, I just noticed this bug with my root motion animations, that they move my character actors in multiplier over twice the distance compared to single player.
At first I thought it could be caused by the root motion being applied twice on the client, but after doing some more digging I confirmed that it in fact happens on the dedicated server instead and the clients are simply correctly matching the actor transform.
Can you point us in the right direction figuring out why this is happening please?
Kind regards,
Marcin
Hi Marcin,
So a very basic overview of it is:
- Root motion is extracted from animations and accumulated on the anim instance during the update step.
- Root motion is taken from the anim instance via ConsumeExtractedRootMotion and accumulated on the character movement component (in UCharacterMovementComponent::TickCharacterPose)
- Root motion is applied to the character in the character movement component update code.
So first step would probably be to verify the root motion at each of these points to make sure it is what is expected.
I’ve noticed in the the movement component there is a GetAnimRootMotionTranslationScale(). Obviously it would be worth making sure that is set to what you expect it to be.
Also it is worth noting, if you are using “Root motion from Everything”, that this is not intended to work in network games. (See Root Motion in Unreal Engine | Unreal Engine 5.1 Documentation )
Hope that is in some way helpful to you, we’ve had no other reports of an issue with root motion on servers, either internally or externally, so it would be good to know what exactly is going wrong for you.
Cheers
Martin
Hi Martin,
Thank you very much for the pointers. First of all, we are definitely using “Root motion from Montages Only”, so that’s not the problem in our case.
I’ll have a look at the steps you mentioned with one of our programmers and let you know what we find.
Kind regards,
Marcin
Hi Martin,
We went through the code and after a few hours we were able to confirm that the dedicated server extracts far greater numbers from the animation than the standalone version. In single player, the root motion transforms extracted were logging out values of up to 0,586,0 (tick time was about 0.4 here because of debug editor, so it’s no wonder it’s so big), where the dedicated server was extracting transforms of up to 0,1375,0 from the same animation within the same tick time.
From our point of view it looks like an engine bug.
Kind regards,
Marcin
Ok we will look into it on our end and see what we can come up with. Thanks for the info!
Additionally, your question says you are on 4.8 is that accurate?
Hi Martin,
yes that is accurate. We’ve been trying to upgrade to 4.11, but we are struggling to get past the upgrade to 4.10 which completely breaks our game, and we’re still in process of marking all Set Timer blueprint nodes, which are likely to vanish after upgrade to 4.11.
Kind regards,
Marcin
Hi Marcin,
Internally we have been unable to reproduce the behaviour described. It’s possible that this is either because the issue no longer exists in latest or that our test case does not sufficiently match your setup. Could you provide more details about the setup that is giving you problems, or indeed if possible a minimal reproduction project that you can send us that exhibits the same behaviour?
Cheers
Martin
Hi Martin,
I tried to recreate the issue in a clean version of public 4.11.2 and I was unsuccessful as well. It truly might have already been fixed. Thanks for your help. I’ll let you know if it so happens that the problem still occurs for us when we upgrade our main branch to 4.11.2 in the future.
Kind regards,
Marcin