Announcement

Collapse
No announcement yet.

Smooth Sync: Sync your Transforms Smoothly across the network

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Samuel Brunner
    Smooth Sync will only replicate the position of replicated objects. It won't spawn anything.
    Sync your transforms Smoothly across the network.

    Comment


      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.
      Sync your transforms Smoothly across the network.

      Comment


        Hey fuestrine - 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?

        Comment


          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.
          Last edited by fuestrine; 08-14-2019, 05:17 PM.
          Sync your transforms Smoothly across the network.

          Comment


            fuestrine 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?

            Comment


              Aeries
              Sure. Let me know how to recreate it and I'll see what I can find out.
              Sync your transforms Smoothly across the network.

              Comment


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

                Code:
                [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!

                Comment


                  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.
                  Sync your transforms Smoothly across the network.

                  Comment


                    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?
                    Last edited by Syed; 08-27-2019, 05:28 AM.

                    Comment


                      Syed
                      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.
                      Last edited by fuestrine; 08-27-2019, 05:02 PM.
                      Sync your transforms Smoothly across the network.

                      Comment


                        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?

                        Comment


                          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.
                          Sync your transforms Smoothly across the network.

                          Comment


                            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?

                            Comment


                              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.
                              Last edited by fuestrine; 09-08-2019, 10:15 AM.
                              Sync your transforms Smoothly across the network.

                              Comment


                                fuestrine 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!

                                Comment

                                Working...
                                X