Announcement

Collapse
No announcement yet.

Smooth Sync: Sync your Transforms Smoothly across the network

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

    fuestrine I have a question.

    I'm trying to make it so that when the player collides with a physics actor, he takes ownership of that actor so that he can push it around smoothly and replicate the position to other clients. My solution doesn't seem to be working.

    What I am doing:
    1) Player collides
    2) Player takes ownership (SetOwner(CollidedPlayerController) gets called on server)
    3) Physics simulation get's disabled on server and enabled on collided client

    This produces really weird teleportation glitches with the object. Any idea as to why?

    Comment


      GuacFrog
      You may still get a bit of teleporting, but try calling SmoothSync.clearBuffer() on each instance of the actor after you change ownership.

      Let me know if that makes it any better or not for you.

      Other methods you may need (though none related to ownership changing besides clearBuffer()) are listed here at the bottom: https://noblewhale.com/smooth_sync_unreal/
      Sync your transforms Smoothly across the network.

      Comment


        Yeah, I call clear buffer on the client and server every time the owner changes.

        When the client character collides with the box on the server, the server set's the box's owner to that client's player controller, calls clearBuffer(), disables server physics for that box, then calls and RPC to the client which enables physics for that box.

        https://youtu.be/zW7J_UK28vY

        The description of the video explains exactly what is going on in the video.

        Comment


          fuestrine Any ideas? Maybe it's just a problem with physics being enabled for the smooth sync actor?

          Comment


            GuacFrog
            Haha, that's definitely messed up looking.

            I'll have to look into that to try to recreate it on my side and see what's going wrong.

            It's just a default third person controller and a physics box?
            Sync your transforms Smoothly across the network.

            Comment


              Originally posted by fuestrine View Post
              GuacFrog
              Haha, that's definitely messed up looking.

              I'll have to look into that to try to recreate it on my side and see what's going wrong.

              It's just a default third person controller and a physics box?
              Yep. I will try to re create the issue as well.

              Comment


                fuestrine My bad. I forgot to mention that the video was capture with a simulated 150 ping round trip. You may not be able to reproduce the error without simulated ping.

                Comment


                  Hi again,
                  I keep revisiting this thread because I think this really addresses the shortcoming of UE4 simple and smooth movement networking (which is major one!).

                  I have already bought this plugin but I keep experiencing ghost collision and teleporting.. This only happen in the second etc loading (not the first) of level ie load a level: ok. And then exit and the load again, here this problem. And also, the actor with smoothsync is always spawned and destroyed (not kept in pool). I read above that SmoothSync need to be reset but does this also apply to my case?

                  Comment


                    Syed
                    I'll take a look and see if I can recreate the issue. Thanks for bringing it to my attention.
                    Sync your transforms Smoothly across the network.

                    Comment


                      Syed
                      And if you are spawning an actor completely new and not changing the owner at runtime, you shouldn't need to do any resetting.
                      Sync your transforms Smoothly across the network.

                      Comment


                        Yes .. all actors are spawned and then destroyed.. I guess there could be 'leftover variables' somewhere..

                        Comment


                          fuestrine Any updates on the client replication problem?

                          Comment


                            fuestrine Empty level, cube actor with smooth sync on it. When client and server push around cube, it works fine (server owns cube, client can push it). The player does NOT have smooth sync, just default replicate movement.

                            I SetOwner to client controller from server, and it doesn't change anything. I want SetOwner to make the client control the position locally. Any ideas?

                            Comment


                              fuestrine I shouldn't say SetOwner does nothing. It actually just causes movement glitches like in the video.

                              Comment


                                fuestrine Okay here's my idea. I should use smooth sync on my player so he is locally controlled. When the client is near a cube, he takes control of that cube. However, when two players are near a cube, I want the cube to be controlled by the server. Of course, smooth sync is not capable of this as the clients won't be able to move the cube because no client prediction. So what is the solution to switching between client and server owned physics?

                                I was thinking I could disable smooth sync on the clients and enable replicate movement on the clients in this situation. What do you think?

                                Comment

                                Working...
                                X