Announcement

Collapse
No announcement yet.

Smooth Sync: Sync your Transforms Smoothly across the network

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

    fuestrine How can I get Smooth Sync to work with crouching?

    The problem I have now, is that the capsule has a delayed movement. The following video is using Unreal's built in crouch functions:
    https://youtu.be/6OgkeMF4dtc

    I tried to implement a custom crouch where I shrink the capsule half height and teleport the capsule down by the amount it shrank, but I get similar problems with the capsule movement being delayed for simulated proxies.

    Comment


      GuacFrog
      It sounds like you'll want to set that up through Smooth Sync with a new variable (on SmoothState() I believe). I've been wanting to get to animation support but it's just not something I've had the time for (which is why I don't advertise it).

      Check our SerializeState() where it serializes it to send out and ServerSendsTransformToEveryone_Implementation() where it deserializes for receiving.
      Figure out whatever variable determines the crouch and then stick it in those places. Make sure to serialize and deserialize in the same exact order.
      Probably just check out MovemementMode syncing and copy that as that might give you an idea of when to assign it to your character so it shows up on your non-owners at the right time (or clients if no owner).

      Let me know if you have any questions or if I misunderstood the issue.
      Sync your transforms Smoothly across the network.

      Comment


        Hey, fuestrine! amazing plugin! I added it to my base advanced vehicle blueprint, and finally, for the first time ever, all clients on Steam were experiencing perfectly smooth gameplay! The only issue I had as the server was one car or another would come to a halt for a few seconds, and then jump to where the client is located. I guess it's "typical" lag, but I would love to know what I need to adjust to hopefully clean up that lag. I left everything at default and just added your component to my Base Vehicle blueprint. That's it. There are so many options I'm not sure what to adjust! Thanks!

        Comment


          ksimpson1986
          It could be normal lag.
          It could also be that Unreal sets the default bandwidth limits very low.

          Copy/paste about bandwidth limits:
          You are probably hitting your bandwidth limit.
          Smooth Sync is better than the built-in, but the limit is still relatively small for any serious networking game.
          Change these files to have the following and google Unreal Bandwidth Limit (https://www.google.com/search?q=unre...hrome&ie=UTF-8) for more information.
          I offer no validity on these exact settings, just some random ones I pulled from Google.

          DefaultEngine.ini
          [/Script/OnlineSubsystemUtils.IpNetDriver]
          MaxClientRate=50000 MaxInternetClientRate=50000
          [/Script/Engine.Player]
          ConfiguredInternetSpeed=500000
          ConfiguredLanSpeed=500000

          DefaultGame.ini
          [/Script/Engine.GameNetworkManager]
          TotalNetBandwidth=600000
          MaxDynamicBandwidth=80000
          MinDynamicBandwidth=4000

          If you don't think it's any of that, let me know.


          Sync your transforms Smoothly across the network.

          Comment


            Originally posted by fuestrine View Post
            ksimpson1986
            It could be normal lag.
            It could also be that Unreal sets the default bandwidth limits very low.

            Copy/paste about bandwidth limits:
            You are probably hitting your bandwidth limit.
            Smooth Sync is better than the built-in, but the limit is still relatively small for any serious networking game.
            Change these files to have the following and google Unreal Bandwidth Limit (https://www.google.com/search?q=unre...hrome&ie=UTF-8) for more information.
            I offer no validity on these exact settings, just some random ones I pulled from Google.

            DefaultEngine.ini
            [/Script/OnlineSubsystemUtils.IpNetDriver]
            MaxClientRate=50000 MaxInternetClientRate=50000
            [/Script/Engine.Player]
            ConfiguredInternetSpeed=500000
            ConfiguredLanSpeed=500000

            DefaultGame.ini
            [/Script/Engine.GameNetworkManager]
            TotalNetBandwidth=600000
            MaxDynamicBandwidth=80000
            MinDynamicBandwidth=4000

            If you don't think it's any of that, let me know.

            Thank you for the reply! the DefaultEngine.ini were already set to these settings, but I didn't have the GameNetworkManager code in there. We'll do another Steam test tonight and see how it works. Thank you!

            Comment


              Hi fuestrine. It seems like your plugin can be really helpful for me, but i want to be sure whether it actually fits the issue.

              I'm developing a racing game. Pawn is represented by a simple physical object (static mesh). Control is physic-driven. Throttle and steering are implemented by applying of impulse and torque to the mesh correspondingly. There is no something like "movement component" so it's quite similar to UE Flying example. Actor and mesh component are replicated and "Replicate Physics to Autonomous proxy" is also enabled for mesh. This setup seemed quite straightforward, but when i've tested it on dedicated server the actual problem have appeared.

              There are recordings of how it works on both listen and dedicated server. Dedicated server is built from source without any custom options and hosted on my pc where i run clients.

              Movement on listen server is ok, but on dedicated server it looks quantized a lot even for owning client himself due to the physics is server-side simulated. I've tried to tweak Net Update Frequency - decreasing gains quantized effect (as expected), increasing to 1000+ takes no visible effect (and it's impossible and wrong to increase this very much).

              Can this plugin help me in solving this issue?

              PS. However, it feels suspicious that such "simple" physics cause problems (and works different depending on server type). Maybe there are some hidden options for server must be tweaked?

              Comment


                Jeremie Boga
                I'm going to say no just to be safe. I think the main reason your dedicated server looks bad is the low and highly variant fps you have happening.
                Smooth Sync also wouldn't work well unless you are only applying the forces to the owner (or server if no owner). Your collisions wouldn't be good with Smooth Sync also unless you wanted to RPC over some AddForce() or something similar to the owner (or server if no owner).

                Let me know if I didn't answer anything or if you have any questions.
                Sync your transforms Smoothly across the network.

                Comment


                  Why are the component transforms so inaccurate? I'm sending locations and rotations for a few components and compression is not enabled, yet the differences between clients and server are offset enough to notice.

                  Comment


                    Trandana
                    This could be for a few reasons:
                    1. Networking can't be perfect. Play a game like Fortnite next to another instance of that game and you will see the differences are offset enough to notice. This is just because of the nature of how the internet is physically not instant.

                    2. You aren't syncing anything. Are you using SetSceneComponentToSync() to sync your components? If you want to sync not the root, you'll need to use this. Removed ReplicatesMovement? Put on Smooth Sync? There's not many steps but it can be confusing if people are new to Unreal.

                    3. If the above doesn't answer your question, about how far off would you say it is? If it's easy for you, can you make a short video showing the issue? I typically use OBS and an unlisted youtube video for quick and dirty videos like this.
                    Last edited by fuestrine; 11-21-2020, 11:40 AM.
                    Sync your transforms Smoothly across the network.

                    Comment


                      I'm having a problem with smoothsync working with clients, it works fine when I run in simulation, but when I try to connect and play in an actual build none of the clients can move around, which suggests to me that they dont have ownership in some way causing this, any advice?

                      I did the normal, disabled replaces movement, enabled replication on the smooth sync component, not sure what to do now.

                      Comment


                        SteamPunkProgrammer
                        I don't think you enable replication on the Smooth Sync component. Isn't that on the parent or something? Check out the video on the Marketplace page for the few steps to make any of the templates work with Smooth Sync.

                        You can use SetOwner() to change owner too if you don't think owner is set up. I'd make sure that your movement is only happening on the owner as well.

                        Let me know how it goes.
                        Sync your transforms Smoothly across the network.

                        Comment

                        Working...
                        X