You should be able to assign server authority that way too, in the example scene.
Though it should automatically be doing it and it is in the example scene for me using the player prefab to spawn and having “Local Player Authority” unchecked, by spawning the way you spawn. Let me know how it goes.
@Joe-Censored I wonder if you might be running into a compatibility issue with NATTraversal. We just recently adjusted some scripts on our end because we were getting the same error as @Vaidoras and seeing the same issue you are - no synced movement. Essentially what was happening is that the connection replacement from relay to punchthrough was taking place after a player object with the SmoothSync component had been instantiated, so the SmoothSync-related message types were not being registered on the connection actually used - only the relay connection (which was soon gone). Take a look for errors on the client-side relating to an unknown message id, and if that’s the problem, fool around with where you register those messages until it works with connection replacement.
Hmmm, I’m not using the NAT Transversal package, as my game is based on clients connecting to dedicated servers. My simulation servers do though maintain client connections to a NetworkServerSimple master server and database access server for the purposes of server cluster management and centralizing access to the db. I’m wondering if there’s a similar confusion going on with the RegisterHandler calls to the NAT Transversal issue mentioned.
When I have a chance to get back to this issue I’ll take a closer look. I didn’t see any unknown message id errors at the time I was looking at this, but I wasn’t checking the logs on the master and database servers, or I might not even see those errors since my connection does exist but may be listening or sending on the wrong one? Thanks for the info, gives me a place to look!
Just bought the assets, it seems to work really well! One question though: Is there an option to only allow the Y position to sync with rotation. (The Unity Transform does offer this option).
Also I don’t know if this is possible, because the unity transform doesn’t offer it. Is it possible to only sync the X and Z position floats, instead of XYZ.
Also it seems like smooth Sync still syncs if both players are standing still. The standard Unity Transform doesn’t do that, so Smooth Sync uses way more data.
Because I’m assuming that’s smooth sync?
Here are my settings:
EDIT:
I checked the script but it seems like you never use the movementThreshold, so the script actually never checks if an object moved.
The details about SmoothSync sending without checking new position are correct from our assessment. We modified SmoothNet from the original 1.0 asset to hold the last State used to send in a private variable and check against it when it’s about to send a new state (just checking position data in our case). If the position in the new state is the same as the old state, we only send if a 25% random chance is passed. That last bit is just to ensure that position updates still come in occasionally for objects which may have been extrapolating their position for too long (we keep our send rates crazy low and our extrapolation limits pretty high).
@TheWesselGames@deliinteractive
Yep, should have had that in. I added a sendMovementThreshold for what you want and renamed the one already in there to receivedMovementThreshold. I used a new thing I learned so everyone’s settings should stay the same! Unity - Scripting API: FormerlySerializedAsAttribute in case anyone’s curious.
I also added every single combination of syncing XYZ, XY, XZ, YZ, X, Y, Z, NONE for position, rotation, velocity, and angular velocity.
It’s the end of the night for me but I’ll be cleaning it up tomorrow and adding alternative syncing position only and syncing rotation only for when the object is not moving or not rotating to save bandwidth. The plan is to submit to the asset store tomorrow. Things have been getting accepted within a day or two lately but anyone can hit up the support email with an invoice number and the version of Unity they use if they want a copy before it hits the asset store.
Hey guys, so I bought this and I’m trying to implement it to my NavMeshAgents who were previously using the NetworkTransform.
I’ve noticed that states won’t be sent to owners when the ClientScene.ready is false. On my dedicated server it is always false, not sure if that’s ok, and can’t find anywhere that says so…
Maybe it should be set as ready at some point, despite of being a dedicated headless server?
For now, I attempted to modify the Update method to check the ClientScene.ready only on clients while waiting for a real answer, but that triggers some errors when spawning the agents, despite of being working really smooth:)
Thanks!
Error Logs
Could not find target for network state message. […]
NullReferenceException: Object reference not set to an instance of an object
Smooth.SmoothSync.HandleSyncFromServerToNonOwners (UnityEngine.Networking.NetworkMessage msg) (at Assets/Plugins/Smooth Sync/SmoothSync.cs:677)
[…]
I’m curious about how it all works though… How does this work in relation to physics-based players and interaction with server-owned physics objects? Does it work? Or do the clients need to own the objects in order for interaction to work well and smooth? Also, what about players with server authority? I guess you’d need some sort of client-side prediction and reconciliation so this asset wouldn’t work in that case?
Alright, that latest update was a bit harder than I thought, but I finally pushed it out.
A hurricane is coming right at me so I’m about to be without power for probably the next week. Hopefully you’ll have no problems but if you do, just let me know and I’ll get to it when I can.
As always, if you want the updated version now, shoot me an email at the support email with your invoice number and which version of Unity you are using and I’ll send it out, hurricane permitting of course.
@Jick87
Interacting with server owned objects is not as smooth as interacting locally of course but it’s pretty good with a decent send rate. You are correct that players with server authority would require some special handling. The plugin will sync them just fine but everything will feel delayed unless you somehow handle user input immediately with some sort of client-side prediction like you say.
@tobetobe
I don’t get this issue when I set Sync Rotation to NONE on the new version I just put out. Check the new version when it comes out (or email me for it immediately).
Change log:
Fixed dedicated server issue.
Added send position, rotation, velocity, and angular velocity thresholds so you don’t need to send some things or any things when not changing or if haven’t changed enough.
Added receive thresholds.
Added the ability to send any combination of position, rotation, velocity, angular velocity.
Now uses rigidbody.MovePosition except when teleporting.
Hi there! I just purchased Smooth Sync… I was previously syncing a VR player prefab with one NetworkTransform (the head) script and two NetworkTransformChild scripts, (the hands)… I calculate and show my outgoing bytes/sec for the client with a UI using NetworkTransport.GetOutgoingFullBytesCount, I just replaced the NetworkTransforms, have the children set appropriately on the two additional Smooth Syncs, have all compression on, velocity/angular velocity set to none, and my outgoing bandwidth on all clients went up quite a bit. Am I doing something wrong?
I’ve got a problem where only the first client gets its position updated.
The second client and further only get rotation updates and very sparse (it’s very jerky).
I’m using the default settings for SmoothSync and the default settings for NetworkManager. The Game Object is a simple one with a rigidbody and a mesh.
The game is server authoritative, ie, all the objects are server authoritative and the clients only have authority over their own player prefab which sends commands to the server to apply movement (MoveTo) to their actual playable objects.
As I said, it works perfectly fine on the first client and the server sees the scene properly too, but further clients don’t get position updates for themselves and no updates at all for other players’ controller objects.
I have been fighting with this the whole day and I reached the conclusion that the target state on the non-owners always has the same position (the spawn one) on the second client, but the first one has its proper synced position on the target state for non-owners.
@aftokinito
Sorry about that. I just fixed it and pushed a new version to the asset store. Feel free to email me with your invoice number and which version of Unity you are using if you want the update quicker.
@PrimeDerektive
More bandwidth in that scenario doesn’t sound good. I’ll look into it and get back to you.
@AlCaTrAzzGames
I’m not entirely sure what Photon PUN is, but Smooth Sync uses UNET. I would think if you can use UNET, you can use Smooth Sync. It’s just a script that you add to objects that uses UNET to sync them.
Sorry I was a little salty before, i’m trying to get my bandwidth down in a VR game. I watch my clients upload to the server because I want to be careful to stay as far from the 4Kbps per user/per second limit, I was using NetworkTransform and two NetworkTransformChild scripts to do the head/hand/hand on my player prefab, i switched it to 3 smoothsync’s and my client upload went from ~1400 bytes/sec to ~2000 bytes/sec, with full compression on the children and compressed rotation on the parent (head). I monitor client → server bandwidth like this:
@PrimeDerektive
Yeah, I’m definitely seeing the same issue here with children. Sorry about the problem and thanks for bringing it to my attention. I looked around but I couldn’t find anything that stood out. This is going to require some solid time to figure out where I went wrong. The next few days are shot, but I’ll get back to you on Tuesday and hopefully with a working solution.
@PrimeDerektive
We just can’t figure out why we only lose to NetworkTransform when syncing both children and parents at the same time and only from client to the server. We beat them in every other possible combination we found. We looked over the NetworkTransform scripts to see how they did it and nothing helped.
I think I’m just going to have to say to lower your send rate because using NetworkTransform with children doesn’t even work anyway right? If you have no rigidbodies it’s super jerky, and if you have a rigidbody as the parent and a child collider, everything is just wrong. NetworkTransform can’t sync our player controllers in the example scene at all.
Let me know if you think it’s not better than NetworkTransform after you lower the send rate. I definitely am going to ask some questions around anyway at least because this is just bugging the heck out of me now.
I think you mainly care about client to server but keep in mind that you save bandwidth from the server relaying the client information around so you don’t have to lower the send rate on child objects that much to make overall bandwidth lower than Network.Transform.