Smooth Sync: Sync your Transforms Smoothly across the network

[USER=“3251812”]Samuel Brunner[/USER]
Smooth Sync will only replicate the position of replicated objects. It won’t spawn anything.

@tschmi22
Sorry I don’t know of any way. You can try to copy and paste the code out into new scripts that you make in your projects though.

Hey @ - love this plugin. It’s working very well. I have an issue, however, I’m hoping we can resolve. I’ve set up a root motion character and I’ve plugged in the smooth motion component. Almost everything works brilliantly right ‘out of the box’, except that when latency scales up, the component seems to fall behind in syncing transforms. So in-engine, I can run from A to B with no ping latency just fine. Add a latency of 500, and the animations will play to move and stop just fine as I’d expect, but the component doesn’t start nor stop syncing until almost a full second after the anim events, causing a delay on clients from start, and a ‘slide’ effect after the player anims appear to stop moving. Thoughts?

@Aeries
Try increasing the TimeCorrectionSpeed variable. The higher that is, the quicker it will react to changes in latency, too high and it will jitter from normal movement though. Let me know if that helps. If it doesn’t, I’ll have to try to recreate the scenario and see what I can find.

@ that didn’t help. If you like, I can DM you how I created this particular locomotion system and see if you can recreate the issue?

@Aeries
Sure. Let me know how to recreate it and I’ll see what I can find out.

Hey @ ,
My project is crashing, and the message logs seem to show this error:


[2019.08.22-10.21.18:554][288]LogPhysics: Warning: UpdateKinematicBonesToAnim: Trying to set transform with bad data Rotation: Pitch 8.477944 Yaw 130.352570 Roll -111.029167
Translation: -nan -nan -nan
Scale3D: 0.700000 0.700000 0.700000
 on PhysicsAsset 'SK_Veh_Car_Medium_01_PhysicsAsset' in SkeletalMesh 'SK_Veh_Car_Medium_01' for bone 'SM_Veh_Car_Medium_01'
[2019.08.22-10.21.18:554][288]LogPhysics: Warning: UpdateKinematicBonesToAnim: Trying to set transform with bad data Rotation: Pitch 0.145572 Yaw 147.404251 Roll -111.029152
Translation: -nan -nan -nan
Scale3D: 0.700000 0.700000 0.700000
 on PhysicsAsset 'SK_Veh_Car_Medium_01_PhysicsAsset' in SkeletalMesh 'SK_Veh_Car_Medium_01' for bone 'SM_Veh_Car_Medium_01'
[2019.08.22-10.21.18:635][290]LogPhysics: Warning: UpdateKinematicBonesToAnim: Trying to set transform with bad data Rotation: Pitch 0.178746 Yaw -126.172890 Roll -0.015490
Translation: -nan -nan -nan
Scale3D: 0.700000 0.700000 0.700000
 on PhysicsAsset 'SK_Veh_Car_Small_01_PhysicsAsset' in SkeletalMesh 'SK_Veh_Car_Small_01' for bone 'SM_Veh_Car_Small_01'
[2019.08.22-10.21.18:636][290]LogPhysics: Warning: UpdateKinematicBonesToAnim: Trying to set transform with bad data Rotation: Pitch 0.169621 Yaw -109.397362 Roll -0.015246
Translation: -nan -nan -nan
Scale3D: 0.700000 0.700000 0.700000
 on PhysicsAsset 'SK_Veh_Car_Small_01_PhysicsAsset' in SkeletalMesh 'SK_Veh_Car_Small_01' for bone 'SM_Veh_Car_Small_01'
[2019.08.22-10.21.18:657][292]LogPhysics: Warning: UpdateKinematicBonesToAnim: Trying to set transform with bad data Rotation: Pitch 0.051035 Yaw -132.987137 Roll -0.391541
Translation: -nan -nan -nan
Scale3D: 0.700000 0.700000 0.700000
 on PhysicsAsset 'SK_Veh_Car_Small_01_PhysicsAsset' in SkeletalMesh 'SK_Veh_Car_Small_01' for bone 'SM_Veh_Car_Small_01'
[2019.08.22-10.21.18:658][292]LogPhysics: Warning: UpdateKinematicBonesToAnim: Trying to set transform with bad data Rotation: Pitch 0.162647 Yaw -132.498154 Roll -0.391633
Translation: -nan -nan -nan
Scale3D: 0.700000 0.700000 0.700000
 on PhysicsAsset 'SK_Veh_Car_Small_01_PhysicsAsset' in SkeletalMesh 'SK_Veh_Car_Small_01' for bone 'SM_Veh_Car_Small_01'
[2019.08.22-10.21.18:669][293]LogPhysics: Warning: UpdateKinematicBonesToAnim: Trying to set transform with bad data Rotation: Pitch -0.099598 Yaw 33.704178 Roll 0.275303
Translation: -nan -nan -nan
Scale3D: 0.700000 0.700000 0.700000
 on PhysicsAsset 'SK_Veh_Car_Medium_01_PhysicsAsset' in SkeletalMesh 'SK_Veh_Car_Medium_01' for bone 'SM_Veh_Car_Medium_01'
[2019.08.22-10.21.18:669][293]LogPhysics: Warning: UpdateKinematicBonesToAnim: Trying to set transform with bad data Rotation: Pitch -0.123852 Yaw 29.297504 Roll 0.275139
Translation: -nan -nan -nan
Scale3D: 0.700000 0.700000 0.700000
 on PhysicsAsset 'SK_Veh_Car_Medium_01_PhysicsAsset' in SkeletalMesh 'SK_Veh_Car_Medium_01' for bone 'SM_Veh_Car_Medium_01'
[2019.08.22-10.21.18:670][293]LogPhysics: Warning: UpdateKinematicBonesToAnim: Trying to set transform with bad data Rotation: Pitch 0.126598 Yaw 150.383041 Roll -0.738056
Translation: -nan -nan -nan
Scale3D: 0.700000 0.700000 0.700000
 on PhysicsAsset 'SK_Veh_Car_Medium_01_PhysicsAsset' in SkeletalMesh 'SK_Veh_Car_Medium_01' for bone 'SM_Veh_Car_Medium_01'
[2019.08.22-10.21.18:670][293]LogPhysics: Warning: UpdateKinematicBonesToAnim: Trying to set transform with bad data Rotation: Pitch 0.641601 Yaw 149.833832 Roll -0.737628
Translation: -nan -nan -nan
Scale3D: 0.700000 0.700000 0.700000
 on PhysicsAsset 'SK_Veh_Car_Medium_01_PhysicsAsset' in SkeletalMesh 'SK_Veh_Car_Medium_01' for bone 'SM_Veh_Car_Medium_01'
[2019.08.22-10.21.18:713][297]LogPhysics: Warning: UpdateKinematicBonesToAnim: Trying to set transform with bad data Rotation: Pitch 0.566086 Yaw 64.584778 Roll -0.046906
Translation: -nan -nan -nan
Scale3D: 0.700000 0.700000 0.700000
 on PhysicsAsset 'SK_Veh_Car_Medium_01_PhysicsAsset' in SkeletalMesh 'SK_Veh_Car_Medium_01' for bone 'SM_Veh_Car_Medium_01'
[2019.08.22-10.21.18:713][297]LogPhysics: Warning: UpdateKinematicBonesToAnim: Trying to set transform with bad data Rotation: Pitch 0.210855 Yaw 33.287903 Roll -0.064026
Translation: -nan -nan -nan
Scale3D: 0.700000 0.700000 0.700000
 on PhysicsAsset 'SK_Veh_Car_Medium_01_PhysicsAsset' in SkeletalMesh 'SK_Veh_Car_Medium_01' for bone 'SM_Veh_Car_Medium_01'
[2019.08.22-10.21.18:959][318]LogPhysics: Warning: UpdateKinematicBonesToAnim: Trying to set transform with bad data Rotation: Pitch 0.460915 Yaw 85.651772 Roll 0.222979
Translation: -nan -nan -nan
Scale3D: 0.700000 0.700000 0.700000
 on PhysicsAsset 'SK_Veh_Car_Van_01_PhysicsAsset' in SkeletalMesh 'SK_Veh_Car_Van_01' for bone 'SM_Veh_Car_Van_01'
[2019.08.22-10.21.18:959][318]LogPhysics: Warning: UpdateKinematicBonesToAnim: Trying to set transform with bad data Rotation: Pitch 0.368400 Yaw 41.207272 Roll 0.216637
Translation: -nan -nan -nan
Scale3D: 0.700000 0.700000 0.700000

Could this be due to Smooth Sync?
Thanks!

@e3pojedi
Smooth Sync does set rotation so it could be an issue with Smooth Sync.

If it’s easily repeatable, turn off Rotation Syncing and see if you still get the issue.

If you don’t get the issue when turning Smooth Sync’s Rotation Syncing off, let me know how you are causing the issue and I’ll see if I can fix it up.

Hi,
I can probably answer this myself by doing experiments (cant afford to read all 13 pages post here lol), but here is the question:

  1. What happened to ‘Set Owner To Server’?

  2. This is just typical situation. A blueprint that I want the transform send from a particular client to server and then replicated to the rest… So how to differentiate between normal replication (using server values, replicated to all clients) vs this case?

@Syedhs

  1. It now handles unowned actors differently. It works as follows:
    Owned Actors: Sends transform from owner to non-owners.
    Unowned Actors: Sends transform from from server to clients.

  2. Use Unreal’s SetOwner() function to set the owner to the client that you want to determine the position.

Let me know if you have any questions.

So I started with this default rolling ball template. Set “Number of players” = 2, checked “Run dedicated server”, as well dropped additional “Player start” component in the map. So I realized nothing is replicated trough the network. So what I did was adding:

UFUNCTION(Server, Reliable, WithValidation)
void ServerAddTorque(FVector Torque);

to run physics on server side, so its then replicated on all clients. And it worked, but when I really play around with the balls I can see them Laging (getting stuck and jumping to next pos). So my question is:

  1. What is this LAG? I mean, it’s all on same machine!
  2. Can “Smooth Sync” help to correct this and how?
  3. And how it really works? The doc says just drop the component to the actor. But how then does it know what to sync and what not?

@trshman

  1. I’m not entirely sure how Unreal does their syncing. I’m pretty sure Unreal’s syncing doesn’t keep a buffer of states though like Smooth Sync does, so if there’s an FPS drop or something I could see Unreal’s syncing having issues. Also I don’t think the position is solely determined by a single system, so your objects can become out of sync then it will correct to what it thinks it should be.
    Smooth Sync doesn’t get out of sync in the same manner that Unreal’s syncing does.

  2. I’m not sure if you are doing something wrong and if it’ll fix your specific issue but Smooth Sync does work with rolling ball template. There’s no one complaining about lag and the rolling ball template is shown with Smooth Sync in the tutorial video too.

  3. It works by sending positions over the network and lerping between them. For Owned Actors it sends transform from owner to non-owners (owner determined transform). For Unowned Actors it sends transform from from server to clients (server determined transform).

Let me know if you have any other questions or if you want more explanation on anything.

a) Can you explain the concept behind Owned and not owned actors. By what is is determinated?

b) Can I still use “UFUNCTION(Server, Reliable, WithValidation) void ServerAddTorque(FVector Torque);” forcing the physics being done server side? Or is is it different scenario when using this plugin?

@trshman
**a) **I’m a little rusty on my Unreal concepts but basically, you can only replicate variables or call RPCs from owner actors to non-owner actors or from non-owner server actors to non-owner clients actors.

I’m not sure exactly how it’s determined in Unreal. I found this online that seems correct but I’m not entirely sure:
“If I gather the information from this question correctly, anything spawned on the server outside of a PlayerController is considered Server owned. Everything spawned inside of a PlayerController (also on server side) is considered player owned. I’m only left to assume parts of persistent maps are unowned actors.”

You can also use SetOwner() to set the owner manually after spawning.

b) Yes, you can use that to move the ball on the server. Or you can move it on the server any other way you like.

@ I am interested in your plugin. I have a couple of questions about it.

The game that I am making takes place in a large warehouse with around 10 connected players (listen server), and there are potentially thousands of objects that simulate physics on the server. My issue with the default UE4 replicate movement is the fact that clients see and get teleported around when interacting with physics objects.

My solution to this problem would be simulating physics on the client and the server, and having the server send the client the actor’s’ position and the client “nudges” the actor’s position towards the server position. This way there is no teleporting as the client simulates everything, but it also means that the location and rotation of every object is the same across client and server.

Does your plugin work in this manner? And will it be able to handle a large amount of objects? I planned on making optimizations such as only replicating the actor’s transform if the player is within certain distance or looking the a certain direction.

Let me know your thoughts, thanks!

@ Another quick question. Does this plugin support 4.23?

@GuacFrog
I don’t think it would work for exactly what you are trying to do.

Smooth Sync works by having one client (or non-client server) determine the position of an actor. If the actor tries to deviate from this on the non position determining client (or non-client server) the object will not move.

I wouldn’t count on Smooth Sync being able to handle potentially thousands of objects. It does seem to handle more objects at a lower send rate than Unreal’s position replication does (like shown in the Smooth Sync trailer), but I wouldn’t expect it to handle any super large amounts. Smooth Sync does take into account Unreal’s Net Cull Distance Squared though for network optimization.

Let me know if that helped at all.

@GuacFrog
We haven’t updated to 4.23 yet but we are planning on it when we get time. I’d expect we’d be able to get to it within a week.

If you want to be notified when we release a 4.23 version, let me know.

Oh, I see. I assumed that this plugin allowed replication of physics objects without lag / jumps.

@GuacFrog
It does. I’m just not sure about thousands of objects at once. Also all of the physics objects would need to be determined by the same system. A game like Rocket League has all physics determined by the server, but they also have a fair bit of player-prediction/client-prediction which makes it seem like it isn’t, which Smooth Sync doesn’t have.