How's transform syncing for VR games?
A unique system that Normcore networking has, that I have not been able to find in any other assets, is ownership of the object is different than ownership of position. When a physics object collides with another object its position owner changes, which allows near seamless physics for a multiplayer virtual reality game.
Here's an article that covers how to do VR physics networking well, and they have the concept of a different position owner as well. https://gafferongames.com/post/networked_physics_in_virtual_reality/
Do you mean make it so multiple clients can control an objects position?
Only one client controls it at a time, but a client requests control of the object and immediately can start changing its position without having to wait for a response from the server. Control of position is different than control of SyncVar values of the object itself.
The article explains in detail how to accomplish syncing of physics objects for VR.
I guess you can change the item's ownership (with client prediction, then you can roll back the state when other players actually grab it before you) once you grab it and move it with client authoritative.
I implement this in MLAPI, but I am also very interested if FishNet has some built-in features to support this.
Only one client controls it at a time, but a client requests control of the object and immediately can start changing its position without having to wait for a response from the server. Control of position is different than control of SyncVar values of the object itself.
The article explains in detail how to accomplish syncing of physics objects for VR.
I understand what you are saying and I can 100% see a use for this. I'll make sure it makes it onto the roadmap. Keeping issue open until I get it up there.
Thank you!
I know this has been opened awhile. I wanted to implement this sooner but things got re-arranged. I'll make sure this is happening within the next release or two.
Great, thank you!
Great, thank you!
I just got this feature complete and I realized, wouldn't it make more sense if immediate ownership of the entire object was faked instead of just the NetworkTransform. That way all IsOwner checks would pass rather than only granting you access to control the NT.
No, because you don't necessarily want the owner of the object to change. For example, a player summons an object, and that object should disappear when that player disconnects. But other players are allowed to move it through physics. Physics ownership should not be the same as object ownership.
You cannot really control an object without ownership. The NetworkTransform changes were just faking ownership until it transferred over on the NetworkObject. Now it's essentially the same but all scripts will receive the ownership change.
I see. Unfortunately, that won't be a good solution for networking VR physics then.
[EDIT] Not only because of the ownership issue, but because of the synchronization too. The article explains the data transfer has to go both ways, not just local simulation. A client requests transform ownership and takes over it as if its client authoritative, with syncing data to the server, that the server then syncs to other clients. This process starts happening immediately on the client with no delay waiting for ownership transfer from the server to complete. But its also in combination with decoupling object ownership from transform ownership that fully completes it.
I'm not sure this is as much a problem as you believe. I did assume you were using a NetworkTransform, but I imagine this would behave the proper way for anything. If you were say using a PredictedObject you would still get ownership of it allowing you to control it however you want.
I'll have to use a different system then, but thanks for looking into it. Ownership shouldn't be the same as movement control for VR physics. If you want to learn more on the subject, I would recommend looking into the Normcore networking asset in Unity. They have the best multiplayer networking physics for VR that I've tried. I just don't use their asset because its peer to peer only.
I'm not sure I understand entirely. Ownership doesn't necessarily mean the object is now client auth it just means the client has the right to communicate with the server on it. Another day please get to me on Discord so we can discuss because I feel as though this would work.
You can read up on Normcore's documentation for how they handle syncing transforms to learn why it's different. One of the key parts is when an owned transform collides with an unowned transform, it requests ownership of it, so it can immediately start syncing positions of all collided objects to other clients.
There might be better ways to handle it, I'm not sure, but its the best multiplayer physics I've seen in VR. Other options just haven't worked as well for realtime physics syncing with hands colliding with objects from multiple players.
And all of that is done without changing who the original owner of the object is. https://normcore.io/documentation/realtime/realtimetransform.html