Animation jitter when far away from world origin

This can apparently be fixed by using world origin rebasing, too bad I can’t use it because the game is supposed to be a multiplayer game.

The weapon is attached to the hand_r bone and hand_r bone is transformed so that the rotation matches view rotation (using set bone rotation in world space).

Distance from origin 3 km: - YouTube

Distance from origin 8 km: - YouTube

50 meters from origin: - YouTube

I can’t have any precise animation driven aiming of weapons because of the floating point precision errors when you’re far away from the origin. I wouldn’t mind if this would happen with 3rd person anims only, but since it’s a first person view the stuttering is very noticeable. The error is too great even at just 3 km away from the origin.

Are there any plans to fix/improve this, or am I doing something wrong? Should I try to fix world origin rebasing so that it works online too? I think all animations and rendering should happen relative to the current active camera, so that the camera location is the world origin for rendering and animation work.

Hi jonimake:

If I understand your question correctly, the following paragraphs answer your question *from the documentation located here: World Composition

World Origin Shifting

The World Composition editor supports shifting of the world origin by some arbitrary amount. Shifting the world origin results in adding an offset vector to all registered Actors in the world. Each Actor has an ApplyWorldOffset function which can be overridden in the child classes to do additional things. In case you have created a new AActor derived class and store absolute position values in it, you have to override ApplyWorldOffset function to make it work correctly with world origin changes and shift your absolute values in it. Rendering and physics primitives will be shifted in parallel to Actors in game thread.

Big Worlds and Multiplayer

Right now world origin shifting is not supported in the multiplayer games. Here are two solutions that can be imWoplemented for your specific needs:

  1. Implement your own server solution. MMO licensees mostly do this.
  2. Implement some layer between clients and unreal dedicated servers which will transform shifted absolute positions from the clients and route them to the right dedicated server, which only holds part of the world where client is.

However if you disable world origin shifting, you can run a tiled world with a dedicated server. Dedicated servers will load all distance dependent levels, and each connected client will work as usual loading only level that satisfy streaming distance settings. A server holds a list of visible levels for each client and filters Actor replication by this list.

Ah, I my post might’ve been a bit hard to read, I accidentally deleted the old one and wrote that one hastily.

The main problem that prevents me from working on the game is the animations breaking apart like in the videos. I need the animations to be smooth with the first person mesh, but they aren’t like you can see in the videos.
The weapon is attached to the character mesh hand, and the hand is transformed so that its world space rotation matches camera rotation. That way the weapon sights are aligned properly. The animation starts to break apart when the player is only 3 km away from the origin, like you can see in the video. The player can’t aim with weapons if the weapon sights don’t point the same way the camera does. The broken animations are clearly evident when the player moves even further away from world origin like in the 8 km video I posted.

I only mentioned world origin shifting because it fixes the animation jittering (by setting world origin to the camera location), but I can’t use it because the game is supposed to be a multiplayer game.

If I can’t use world origin shifting due to game being a multiplayer game (and I lack the know-how to make origin shifting work in multiplayer), how can I fix the animations so that they don’t break when the player is far away from world origin?

Are there any planned fixes for this?

Hi jonimake,

I have not been able to reproduce this effect using the 1st person blueprint template, maxing the “floor” plane out to the corners of the default grid. Can you send your file so we can observe this issue here? You can provide your project in a zip file as an attachment here, if small enough, or via dropbox, or as an attachment in a private message to me on our .

Providing your files would be a great help in isolating the cause of this issue.
-Thanks

Sent you a PM on the . I’m personally not convinced that I’m not doing something wrong with the anims though. I’m setting the world space translations and rotations of bones so I guess that could cause the problem I’m having. Are there any animation best practices guides or something, rather than just purely technical guides about the editor tools?

The best source I can point to is The Shooter Game project. I have moved the character to exteme parts of the map without experiencing the jittering that you see with the way you have your character set up. My advice would be to examine the way the character is set up emulate it as close as possible.

We are having this same exact problem and it appears to be something with attaching meshes to objects. How is your gun attached? For us it is the optics that causes issues and the gun movement is smooth but the optics jiggle around on the gun itself even though they were properly attached.

Can’t see how this has been resolved. I think it’s correct to say the Shooter Game project doesn’t rely on animation based aiming, which is when camera / weapon alignment starts to suffer. I suspect any project attempting “true first person” will run into this issue with precision or the 1-frame lag experienced with attachments / mesh space transformations.

I don’t expect these issues to be fixed any time soon - don’t know that they could really be called bugs. Would just like to request robust support for screen space animation.

Can’t see how this has been resolved. I think it’s correct to say the Shooter Game project doesn’t rely on animation based aiming, which is when camera / weapon alignment starts to suffer. I suspect any project attempting “true first person” will run into this issue with precision or the 1-frame lag experienced with attachments / mesh space transformations.

It’s moving away from a bug fix, but there should be support for screen space coordinates / transforms that would allow “animation driven” 1st person views to at least function at parity with systems where the 1st person meshes have been parented to the camera.

Hi BobJoel,

This issue was reported as a bug and determined not to be a bug, so in that sense it is resolved. In which case if the user (or anyone else) wanted further support on the correct way to set this up, they would need to add a new post under “Using UE4” or “Everything Else.”

As it happens, while looking into this I ran across this video that I believe explains how to achieve what you are trying to accomplish with animation based aiming: https://www.youtube.com/watch?v=haA6vYgbEw0

If it does not, as I mentioned above, please start a new post in the appropriate AnswerHub section and call it something like “The best way to set up animation based aiming.”

Thanks,

So are there any plans to improve the precision of animations when the player isn’t close to the origin? I mean, the game “Squad” (http://joinsquad.com/) is also suffering from the jittering when player isn’t near the world origin. I read that it’s making it hard to use gun sights because they jitter around.

Also, I did post this under “Using UE 4”, but nobody ever answers there. Bone rotation jitter after aim offset + transform bone - Character & Animation - Unreal Engine Forums

Are there any plans to improve the precision of animations when the player isn’t near the world origin? Do you understand the problem that is happening? The fact is that the floating point precision of the FTransform class, that is used for everything, isn’t high enough when player isn’t near origin. The imprecision causes the jittering. This jittering happens even if you just attach a mesh to the player, it doesn’t have to be animated.

The answer to the initial question is, as stated above, “Right now world origin shifting is not supported in the multiplayer games.” It has been hinted that this will change in the future, but no timeline has been set. As for the second part of the question, “Should I try to fix world origin rebasing so that it works online too?” -This would be great, if possible, and could even be released on the Marketplace as a plug in (for incentive).

Focusing on single player games, the value was changed from being around 3.5-4 km from the world origin to 20 km from the origin in UE 4.8, so if you are experiencing an issue with your animation based aiming jittering within these parameters, please re-examine your set up as this has been proven to work for UE4.8 on.

However, if you feel this feature is not functioning as expected, please provide steps to reproduce the bug on our end and we will investigate to see if World Origin Shifting has regressed and needs to be corrected for single player mode in current releases of the engine.

Finally, since this thread is getting long, and away from the initial question, please start a new thread to discuss the proper set up for Animation Based Aiming for true first person. Here’s one solution posted by a user on reddit that I feels addresses the issue:

https://www.reddit.com/r/unrealengine/comments/2znb6k/creating_aiming_for_true_fps_project/

While discussion of this and other solutions is encouraged, please start and discuss this on a new post so those solutions won’t be “buried” within this thread.

-Thanks

Here https://.unrealengine.com/showthread.php?109335-Pull-Request-World-Origin-Shifting-in-MP some solution for multiplayer and world origin shifting.

For future reference, here is the official “World Origin Shifting for Multiplayer” feature request: JIRA [UE-13079].

Just for completion’s sake, anyone reading this should be aware: origin shifting has been partially implemented for multiplayer. That PR was eventually merged into 4.14. There are still limitations but they go beyond the old ones apparently.

Sorry guys for necro posting, but i have faced the same issue, my weapon attached to camera is shaking when my pawn is far from world origin. Is there a way to fix it?
My world is not so big 6km, and i experience those jitterings even on small values like 1km.

World origin shifting has been woeking for years.
Just enable it.

Peobably figure out how to set it to rebase at a shorter than default distance.

The latest engines have really bad coding, there were noticiable floating point issues particularly with animations as close as 100m from origin…

Hello, how do i enable world origin shifting? Is this is a feature? Or do you mean i have to move origin of the world and every object by my own code???

Set custom new world origin.

Some actors are missing after executing this command, only static meshes keep its positions.