Search Unity

[RELEASED] Smooth Sync - Smoothly network rigidbodies and transforms while reducing bandwidth

Discussion in 'Assets and Asset Store' started by Fuestrine, Aug 4, 2017.

  1. TCROC

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    230
    Awesome! Thanks for the response! I really appreciate the honesty and not "my tool can do everything attitude." I have been absolutely loving it for the stuff I have been using it for tho! :)
     
  2. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @TufanMeric
    Yes, I do have a drop-in PUN2 version of Smooth Sync that I would say works way better than PUN2's built in network transform. One way it is better is that we keep an array of States so that if you hit a lag spike, your game is still smooth. Let me know if you have any specific questions.
     
    Last edited: Apr 5, 2019
  3. linkzao

    linkzao

    Joined:
    Mar 29, 2019
    Posts:
    1
    Hello!

    Whenever I import the SmoothSync script in my project I get the following error:

    Assets\Smooth Sync\Mirror\Smooth Sync Asset\SmoothSyncMirror.cs(1679,17): error CS0120: An object reference is required for the non-static field, method, or property 'NetworkClient.RegisterHandler<NetworkStateMirror>(Action<NetworkConnection, NetworkStateMirror>)'

    Can someone enlight me please? Thanks!

    EDIT: Nevermind, removed, updated and re-added Mirror to the project and everything is now working just fine! Thanks! Awesome Asset!
     
    Last edited: Apr 10, 2019
  4. Poon-Moon

    Poon-Moon

    Joined:
    Jan 27, 2015
    Posts:
    8
    I have a big delay on fielding input to stuff moving - not sure I've wired up Smooth Sync correctly
     
  5. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @Poon-Moon
    By default, Smooth Sync puts things 0.1s in the past to handle lag spikes. Try lowering SmoothSync's InterpolationBackTime to .04 and see if that helps. You can also try raising the EasingSpeeds to 1.0 to get more reactivity.

    If that doesn't help, take a look at the example scene and let me know if that also has the same issue for you.
     
    Last edited: Apr 12, 2019
  6. toyhunter

    toyhunter

    Joined:
    Mar 5, 2018
    Posts:
    76
    @Fuestrine

    Hihi :), Just updated SmoothSync and extract PUN package, found 5 errors as below (am I missing something before unpack it?):

    Could I NOT extract the PUN package if I am using PUN2? Thanks :)

    Assets/Ztore/Smooth Sync/PUN/Smooth Sync Asset/SmoothSyncPUN.cs(28,34): error CS0246: The type or namespace name `PunBehaviour' could not be found. Are you missing an assembly reference?
    Assets/Ztore/Smooth Sync/PUN/Smooth Sync Asset/SmoothSyncPUN.cs(28,48): error CS0246: The type or namespace name `IPunObservable' could not be found. Are you missing `Photon.Pun' using directive?
    Assets/Ztore/Smooth Sync/PUN/Smooth Sync Example Scene/Resources/SmoothSyncExamplePlayerControllerPUN.cs(17,53): error CS0246: The type or namespace name `PunBehaviour' could not be found. Are you missing an assembly reference?
    Assets/Ztore/Smooth Sync/PUN/Smooth Sync Asset/SmoothSyncPUN.cs(1939,43): error CS0246: The type or namespace name `PhotonStream' could not be found. Are you missing `Photon.Pun' using directive?
    Assets/Ztore/Smooth Sync/PUN/Smooth Sync Asset/SmoothSyncPUN.cs(1939,64): error CS0246: The type or namespace name `PhotonMessageInfo' could not be found. Are you missing `Photon.Pun' using directive?
     
    Last edited: Apr 24, 2019
  7. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @hmpublic2000
    You only need to extract the SmoothSyncPUN2 package if you are using PUN2.
     
    toyhunter likes this.
  8. dadamsj1

    dadamsj1

    Joined:
    Jul 25, 2017
    Posts:
    42
    FYI, you may get some complaints from people if they are using manual instantiation method for PUN2. Because you are calling the teleport RPC from OnEnable, the photonViewID will likely not be assigned yet. This will print an error to the console of "Illegal View ID: 0...". I fixed these errors by simply adding to OnEnable if statement for SmoothSyncPUN2.cs:

    public override void OnEnable()
    {
    if (photonView && photonView.IsMine && photonView.ViewID > 0 )
    {
    teleportOwnedObjectFromOwner();
    }
    base.OnEnable();
    }
     
    Last edited: Apr 26, 2019
  9. toyhunter

    toyhunter

    Joined:
    Mar 5, 2018
    Posts:
    76
    Hi @Fuestrine

    I'm implementing PUN2 with SmoothSync for my project, everything works smooth but now i faced an issue that when a player joined a room first, move around, then another player join but seeing the first player's position not synced with where he moved.

    I checked your example in the package but cannot figure out how u do that, attached my smoothsync setting for my player prefab, very thanks I believe i missed something...
     

    Attached Files:

  10. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @dadamsj1
    Sorry about that. Thanks for the tip. It'll be fixed for the next update.
     
  11. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @hmpublic2000
    It looks set up correctly in what you showed.

    Is it just the starting position that is wrong or are you talking about how the position isn't synced even if the player moves around?
     
  12. toyhunter

    toyhunter

    Joined:
    Mar 5, 2018
    Posts:
    76
    @Fuestrine

    Just the starting position... thanks :)
     
  13. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @hmpublic2000
    Ah yeah, I've seen that before. I'm not sure why Photon doesn't spawn their objects at the correct position like other systems do. I have some teleport() code in OnEnable() but that doesn't seem to be taking effect in your scenario.

    How are you spawning your object?
     
  14. toyhunter

    toyhunter

    Joined:
    Mar 5, 2018
    Posts:
    76
    Well I mainly referring to Photon tutorial..

    In my scene there is a GameManager, with the following code:

    void Start()
    {
    if (PlayerManager.LocalPlayerInstance == null)
    {
    // we're in a room. spawn a character for the local player. it gets synced by using PhotonNetwork.Instantiate
    PhotonNetwork.Instantiate(this.playerPrefab.name, new Vector3(0f, 5f, 0f), Quaternion.identity, 0);
    }
    }

    More info:
    The early joined player's position & rotation will be synced once he moved, the problem exist where he is idle during the late comer joined the game..
     
    Last edited: Apr 26, 2019
  15. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @hmpublic2000
    I'm not seeing this issue in the SmoothSyncExampleScenePUN2 or when I spawn with PhotonNetwork.Instantiate.

    Are you talking about how it spawns where you tell it to, and then it teleports?
    If so, this is expected behavior as it's going to have to spawn there before Smooth Sync can have access to the object.

    Or is it just always staying in the spot where you tell it to instantiate when you aren't moving?
    If it always stays in the spot where it instantiates, you can send your project to me if it's easy for you. Make sure to private message it to me if you are going to send it with a copy of Smooth Sync in it.
     
  16. toyhunter

    toyhunter

    Joined:
    Mar 5, 2018
    Posts:
    76
    @Fuestrine

    Situation changed. Now the position-not-sync issue ONLY happened when the Master Player left and rejoin the game, below are the step-by-step:

    1. Fuestrine (Master player) create a game, walk to position A;
    2. hmpublic join this game, sees Fuestrine teleport to position A which is correct, now hmpublic walk to position B (Fuestrine sees hmpublic walk to position B, very smooth, thanks to SmoothSync :D );
    3. Fuestrine left the game, (hmpublic become the master player in this case, correct me if i am wrong);

    Issue:
    4. Fuestrine join this game again, now he sees hmpublic standing on the default spawn position, but Not position B, meanwhile Fuestrine standing on the default spawn position which is correct;

    5. When hmpublic walk/move, Fuestrine sees hmpublic teleport to the sync/correct position;

    Thanks for your gentle suggestion, i prefer handle myself but I need the information regarding to SmoothSync :)

    Suppose Smoothsync handles the position & rotation sync right after the instantiation through PhotonView? Or I should call any function to enforce a teleport? Really thanks for your big help :)
     

    Attached Files:

    Last edited: Apr 26, 2019
  17. toyhunter

    toyhunter

    Joined:
    Mar 5, 2018
    Posts:
    76
    @Fuestrine

    Unfortunately somehow it happened in your demo too.. (with the same step by step to recreate)

    Further test that using Photon default: PhotonView Observed Components: PhotonTransformView, this issue gone.
     

    Attached Files:

    Last edited: Apr 26, 2019
  18. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @toyhunter
    Thanks for bringing the issue to my attention and for the great instructions on how to recreate it. I sent a quick fix to you in a PM.

    For others reading this, I'll be releasing a new version early next week.
     
    toyhunter likes this.
  19. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    Version 3.21 has been submitted to the Asset Store. It should show up in a couple business days.

    Change log:
    All Networking Systems:
    • Added ability to sync local transform only (under the Miscellaneous SmoothSync menu item). Useful for VR applications. HoloLens users will have to switch to using this variable because I took out the pre-processor directives for HoloLens.
    PUN/PUN2:
    • Fix for not spawning at initial position if at rest.
    • Fix for photonViewID being non-existent in OnEnable().
    UNet/Mirror:
    • Fix for receiving null net id.
     
  20. toyhunter

    toyhunter

    Joined:
    Mar 5, 2018
    Posts:
    76
    @Fuestrine

    Hi, if I want my player rotate about 180 degree without lerping (let's imagine he wanna throw a punch to another player on his back), how to configure smoothsync so it won't lerp on other device? As right now the player who punch is rotating very fast and sharp like teleporting, but on other devices his rotation was very slow (or lerping), I checked your document should I use "◆ snapRotationThreshold"?

    Right now my solution is temp. disable smoothsync during rotation, just wonder if Smoothsync has official switch/solution for this kind of case, thanks.
     
  21. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @toyhunter
    Use SmoothSync.teleport(). The docs main page is where I list some useful public methods.
     
    toyhunter likes this.
  22. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @toyhunter
    There's examples of using the methods on the player script in the example scene too. SmoothSyncExamplePlayerController.cs or something like that.
     
    toyhunter likes this.
  23. bingofly

    bingofly

    Joined:
    Sep 15, 2018
    Posts:
    27
    Hi @Fuestrine
    Sorry for bothering you again.
    1. If I wanna teleport a gameObject from one position to another, I know there's a method names smoothSync.teleport, but how can I make it? Could you give some pseudo code?
    2. If I have an object pool and wanna recycle a gameObject, which with smoothSync, maybe something like this:
    gameObject.SetActive(false).
    gameObject.GetComponent<smoothSync>().Reset().
    How can I do the Reset() for smoothSync so that I can use it again when I get the gameObject from object pool next time. Could you please give some code too?
     
  24. novica89

    novica89

    Joined:
    Feb 8, 2019
    Posts:
    9
    @Fuestrine

    Heya

    I've bought your plugin a few weeks ago just for a purpose (currently) of properly syncing a dynamic Rigidbody2D of a ball that is used in a simple beach 2D volleyball game. I have two player objects in the game that also have dynamic Rigidbody2D's on them (since I need gravity etc) and have added one more to the ball (that's supposed to bounce once a player jumps and hits it with his character using Unity's built in physix calculations). However, since Unity's Network Transform does not at all do a great job in syncing the ball's dynamic Rigidbody2D over the network for the client player (ball sticks and goes around the client player like a magnet when it collides with him, instead of properly bouncing off of him), even when using your package instead of Unity's Network Transform and since your package description states that it is ideal for syncing moving objects, quote:

    Ideal for syncing anything that moves. Vehicles, character controllers, even objects controlled by physics. Works great even at low send rates.

    I was looking into instructions of how I can properly use your package to achieve the above mentioned functionality and if it's possible in the first place.
     
    Last edited: May 3, 2019
  25. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @bingofly
    1. An example of teleporting is in the example scene. Check out the SmoothSyncExamplePlayerController.cs for a full example. Press "t" to see it in action in the example scene.
    Here's the relevant code for teleporting from the owner:
    Code (CSharp):
    1. if (hasAuthority)
    2. {
    3.      transform.position = transform.position + Vector3.right * 18;
    4.      smoothSync.teleportOwnedObjectFromOwner();
    5. }
    2. calling clearBuffer() on all network instances as you deactivate the object should do the trick.(except the owner but it won't hurt it).

    Let me know if you have further questions.
     
    Last edited: May 4, 2019
  26. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @novica89
    If you want perfect physics bouncing off each other, you'll have to have the objects (ball and players) owned by the same system (typically the server). This is how a game like Rocket League does it. That brings up the issue of client-side / player prediction though because you'll want your unowned local player to move immediately even though it's position is determined by the server. So basically you'll want your local version of the object to not be where it is on the position determining server(also how a game like Rocket League works). Smooth Sync does not have client-side / player prediction and I don't know of any Unity assets that do. If you bought Smooth Sync in error and will not be using Smooth Sync at all, I'd be happy to issue a refund. Send me your invoice number in a PM.

    One way to keep your players owned by each client may be to pause the ball for a little bit locally and then send over an RPC to AddForce to the ball controlling system (probably the server in your case).

    Let me know if you have further questions.
     
    Last edited: May 3, 2019
  27. ry00n

    ry00n

    Joined:
    Mar 3, 2018
    Posts:
    6
    Great asset! Definitely worth the purchase price as it was a simple drop-in that greatly smoothed out my project (using Mirror networking)

    I do have one scenario that's causing some trouble, was curious if you have any feedback:

    I have players that can pick up a ball and throw it. The ball (rigid body) is spawned with a smooth sync mirror component. For a variety of reasons I'm having the ball parent to the player when picked up (disabling the smooth sync component once parented). Then when player throws I: unparent the ball, enable smooth sync component, update position and add velocity.

    As I kind of expected this results in a couple frames of jitter on the ball at the very beginning of the throw when viewed from other clients.

    Are there any settings I could adjust to minimize that effect?
    Would it be feasible to preload the state buffer after turning the smooth sync component back on?

    Any advice greatly appreciated! Thanks!
     
  28. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @yottabyte2k4
    When you disable the SmoothSync component, try using SmoothSync.clearbuffer() on all non-owners. That will clear the State buffer and make it like it's starting out fresh when it becomes enabled again.

    Let me know how it goes, I haven't done much enable / disable tests lately.
     
  29. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @yottabyte2k4
    I'd also confirm that you are adding the velocity and updating position only on the owner as that will be the only system determining the object's Transform (EDIT: when Smooth Sync is enabled).
     
    Last edited: May 3, 2019
  30. novica89

    novica89

    Joined:
    Feb 8, 2019
    Posts:
    9
    Thank You for the response, I will try to do as you suggested, however the actual resources on doing this are pretty scarce (I am in a learning process right now, hence why I'm trying to do this simple MP game with basic elements, thought it's gonna be a breeze by using unity built in physix system). Silly me, it never ends up like this.
    No refund needed man, I bet your package is great for any MP game and I will be using it in the future 100% so even though it's not doing what I need right now, it's gonna do it's thing later I'm sure :)

    Only one more thing: since resources for this type of thing that I need are scarce, any idea where I could find nicely explanation with code examples for this online (some tutorial, or maybe a book you'd recommend) ?
     
  31. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @novica89
    I could be wrong in some of these things I say here, but it's my current understanding of it all.

    Client-side/player prediction is not even something I would try without needing a lot of time, which is why I don't have it myself. I don't know of any resources either unfortunately. Googling client-side prediction or player prediction are the kind of things you want but it's a rough subject.

    The general idea though is that you move the local player immediately and then do that exact move on the server and then nudge your local player to the server position if it becomes off too much. This is basically what results in almost all of the noticeable lag with Rocket League, the local car becomes different than where the server thinks it is so it has to correct itself.

    I'm pretty sure the Unreal engine has some client-side/player prediction built in but that's only for certain controllers and none of them are regular physics objects as far as I know. So Unreal would maybe work for the players, but not for the ball.

    Your idea is simple for one computer, but networking wise it's complex. Basically, most games won't have physics like this, they'll hide it. Rocket League is kind of a rare exception. I would think in volleyball type games the ball isn't actually colliding with hands and bouncing off of them. It's probably just telling the ball to be hit at an angle with a certain amount of force.

    Probably the easiest way to get your game working would be to have the players owned locally and the ball owned by the server (this seems to be how you have it already). Then send a CMD from your local player's game instance to the server to Rigidbody.AddForce() at some angle. If you pause your game slightly when any player hits the ball it may even end up as a cool effect (not a full pause, just like your players and the ball). Fighting games like Street Fighter have a pause on hit for effect and that's even for single player. It makes it feel more powerful.

    Let me know if you have any questions.
     
    Last edited: May 4, 2019
  32. ry00n

    ry00n

    Joined:
    Mar 3, 2018
    Posts:
    6
    I think this is the big thing I was missing! I accidentally left in an RPC call that was setting the position and velocity on ball release so it must have been fighting the smooth sync component.

    I removed the position/velocity portion of the RPC call and added the clearBuffer() and the release is much smoother now. Thank you!
     
  33. novica89

    novica89

    Joined:
    Feb 8, 2019
    Posts:
    9
    Gotya. Than you very much man, much appreciated! It makes sense faking everything since syncing it using the network is not an option!
     
  34. acirmustafa

    acirmustafa

    Joined:
    Feb 3, 2014
    Posts:
    2
    First of all, thanks for developing this plugin.
    I have a question.
    I added a sphere (ball) to the scene. When A is pressed, I'm applying force.. But it only works on one client. How can I make a shared object?
     
  35. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @acirmustafa
    If it's already a networked object, add a SmoothSync component to the object for the networking system you are using.

    If it's not a networked object yet, each networking system uses their own unique component to make networked objects. NetworkIdentity for Mirror and UNet (though actually different files, they just named them the same) and PhotonView for PUN and PUN2. After it's networked, add a Smooth Sync component to the object to sync the transform.
    Smooth Sync also comes with examples for every networking system, so you should be able to just copy what I'm doing in those examples to make a networked object if you run into any trouble.
     
    Last edited: May 10, 2019
  36. acirmustafa

    acirmustafa

    Joined:
    Feb 3, 2014
    Posts:
    2
    I guess I couldn't explain the problem.
    I'm sending image. I am using pun2

    http://prntscr.com/nmo9mi
    http://prntscr.com/nmoa2w

    The ball is the common scene object. (not spawned object)

    public GameObject ball;
    // Update is called once per frame
    void Update()
    {
    if (Input.GetKey(KeyCode.R))
    {
    ball.GetComponent<Rigidbody>().AddForce(33f, 33f, 33f);
    }
    if (Input.GetKey(KeyCode.F))
    {
    ball.GetComponent<Rigidbody>().AddForce(-20f, -20f, -20f);
    }
    }
     
    Last edited: May 10, 2019
  37. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @acirmustafa
    I'm still not sure what you are saying.

    Are you trying to move the object from the client when it is owned by the server? You'll need to send over an RPC or something similar and then run your movement code on the server.
     
    Last edited: May 10, 2019
  38. ry00n

    ry00n

    Joined:
    Mar 3, 2018
    Posts:
    6
    I haven't looked through the actual SmoothSync code yet which may answer some of my questions once I get in there but I wanted to ask:

    1) Does SmoothSync use velocity + angular velocity sync to aid in extrapolation/interpolation calculations?

    I'm starting to do some bandwidth optimization and was curious if it's worth syncing pos+rot+vel+angularvel or just pos+rot at a potentially higher sendrate

    I don't care if the velocity of the objects are slightly off as long as the motion stays smooth

    2) Is it possible to vary SmoothSync settings live / within a build?

    This would be a huge help for testing performance but I didn't know how it would behave if say a parameter like SendRate went out of sync between host and client (even for a split second).

    For example if I wanted to change the smoothsync SendRate of objects that are already spawned via a Command and RPC?

    Should I clear buffer, disable the component, change parameter, then re-enable? (Haven't tried this yet but maybe I answered my own question hah)

    Or do I need to spawn completely new objects with the new settings to be safe?

    3) This may be more of a Mirror question - but I assume the Smooth Sync sendrate can't effectively exceed the NetworkManager "Tick rate"?

    Thanks again for any help!
     
  39. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    I'm using SmoothSync to sync rigidbodies and have this really weird behaviour that I can't figure out.
    My settings are 14 send rate, 0.2 ease in for everything, and everything else at default with limited extrapolation (20 seconds).

    This works perfectly for every physics object except in one circumstance. When any physics object is moving/falling along the world Up/down axis, there is this very exaggerated jitter and it's confusing the hell out of me.
    My sync structure is host/server authority > to client. So this jitter is only occurring on clients as you would expect a syncing issue to occur.

    I thought maybe it was because I have the physics simulation running on both the server and the client (gravity etc), but even with the client side objects set to kinematic or simply with no gravity they still jitter when falling/moving upwards.

    Any thoughts as to why this might be? Could it be that when they are falling, they're moving a little faster than what my smooth sync settings can handle via extrapolation? ( I have tried increasing my send rate, ease in speeds and even extrapolation time/distances to test this with no luck )
     
  40. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    If you're asking if it's possible, then simply yes, I solved this for debugging purposes using syncvars.

    My solution, a debug script, which on start, finds any object with the 'debug tag' (so i can debug any networked object). Gets any smooth sync components on said object, and then updates a sync var/s using a simple gui. In the sync var hook, i just have it update the smooth sync components corresponding properties like send rate etc. I'm lazy so my solution only works/updates correctly when using the gui on the server/host. But with a quick command added for clients, you could adjust smooth sync properties across the network from either end.
     
  41. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @yottabyte2k4
    1) Does SmoothSync use velocity + angular velocity sync to aid in extrapolation/interpolation calculations?
    Velocity and angular velocity are only used for extrapolation. It will attempt to get the velocity from the latest two positions for extrapolation if not syncing velocity but this is rarely as accurate.

    You should be safe to not sync those.

    2) Is it possible to vary SmoothSync settings live / within a build?
    I would assume SendRate can be changed locally without issue. It's only used by the sender (owner).
    Things like the EasingSpeeds are only used by the receiver(non-owner) so it may be able to be changed on the fly as well.
    I haven't done anything like this but it seems like it should work at least for those variable types without having to clear the buffer or anything.
    Taking a semi-quick look at the variables, I think only the sections of Variables To Sync, Compression, Miscellaneous, and ChildObjectToSync will not work at all unless they are changed for everyone.

    3) This may be more of a Mirror question - but I assume the Smooth Sync sendrate can't effectively exceed the NetworkManager "Tick rate"?
    I'm not exactly sure but I would think it would be limited by the networking system. I send messages through the message handlers if that helps.
     
  42. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @Hummy91
    .2 easing speed is pretty low but if you are still seeing the issue at a higher easing speed I would think that is not the issue. The rest of your settings seem fine and wouldn't cause any issues that I can think of.

    The only jitter issue I can think of would be if your camera is following one of these falling objects and another object is falling alongside it at almost the same speed. Is this the case?
    If this is the case (maybe also if this is not the case) try checking UseVelocityDrivenSyncing under the Miscellaneous menu and let me know if that makes it stop jittering for you and that may tell me more about the issue.
     
    Last edited: May 13, 2019
  43. bingofly

    bingofly

    Joined:
    Sep 15, 2018
    Posts:
    27
    Hi @Fuestrine
    If an object has a kinematic rigidbody and I don't use rigidbody for movement , should I switch the syncVelocity or syncAngularVelocity to XYZ?
    I feel confused when the syncVelocity or syncAngularVelocity should be opened and when they should just be none...
    Could you please tell me?
     
  44. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @bingofly
    I'd probably just set it to none. I don't think an object has velocity or angular velocity to send over the network when isKinematic. Syncing velocity and angular velocity is only used for extrapolation too.
     
  45. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    Version 3.22 is now on the Asset Store.

    Change Log:
    • Fixed an issue with teleporting sometimes interpolating instead of teleporting.
     
  46. LootlabGames

    LootlabGames

    Joined:
    Nov 21, 2014
    Posts:
    343
    I was using version: Plugin Version: 3.09 and everything worked great.
    But I was getting errors related to teleporting so I upgraded to version: Plugin Version: 3.22

    Now the teleporting issue has been resolved but it it very "laggy" and doesn't seem to be updating the position like the old one did.
    Lots of general lagginess and rubber-banding.

    Here is a picture of the settings using the old version:
    SmoothSync Version 3.09 Picture.PNG

    And here is a picture of the settings using the new version:

    SmoothSync Version 3.22 Picture.PNG

    Any ideas on what needs to be done to get it to run like it used to?
     
  47. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @katasteel
    Use the default settings and let me know if you still get the issue or not. That will let me know if it's a settings issue or if it's something else I've done in the background.

    My main guess is that the Lerp Speed variables are too low.

    You may also want to extract the editor script so that the variables are laid out in a simpler way.
     
    Last edited: May 24, 2019
  48. jacobclayman

    jacobclayman

    Joined:
    Apr 12, 2018
    Posts:
    3
    So I'm working on a sort of fighting game, and the room creator is managing all the physics. Client streams inputs to host, and host sends outputs to client.

    Here are my smooth-sync settings:
    upload_2019-5-31_0-40-22.png

    Because it's a fighting game, it's important to get as close to real-time syncing as possible, so I'm using an interpolation back time of 0.

    Most of the time this works pretty well (albeit with a bit of input delay for the client), but sometimes the Smooth Synced outputs to the client are very delayed, as if the interpolation back time or time correction speed had been artificially inflated. During these delays, RPCs are being transferred nearly instantaneously as expected. Do you know what would cause this?

    Note all testing so far has been executable and editor client/host setup on the same machine.
     
  49. SpindizzyGames

    SpindizzyGames

    Joined:
    Jun 29, 2017
    Posts:
    108
    after importing the latest SmoothSync and Mirror directly from the asset store, I'm getting five errors that all say:

    Assets\Smooth Sync\Mirror\Smooth Sync Asset\SmoothSyncMirror.cs(251,16): error CS0246: The type or namespace name 'SyncMode' could not be found (are you missing a using directive or an assembly reference?)

    How do I fix this?
     
  50. Fuestrine

    Fuestrine

    Joined:
    Feb 13, 2013
    Posts:
    589
    @jacobclayman
    About how long is "very delayed"?

    On an unrelated to the issue note, I'm not sure I'd recommend an InterpolationBackTime of 0 because it'll probably be extrapolating a lot but it may work for your scenario.

    I've had many weird things happen in editor, try two executables to be certain it still happens.

    If it's randomly waiting like a half second or more every now and then:
    I'm not sure what could be causing the issue. Definitely not normal. My best guess is maybe you are overloading the network? But your RPCs are instant so maybe not. Maybe it's just the Photon Serializer thing that's getting overloaded? I'd check out trying to send less things and see if that fixes it.

    About how many objects are you trying to sync and what's your Photon send rate and Photon serialization rate?

    Also, try turning the InterpolationBackTime to like .1s just for testing and see if you get the issue, it may be an issue with it thinking received states are already too far in the past.