- Home /
RPC or Synchronization ?
For a very specific game, I need every client to act just like a remote controller, ie nothing is computed locally, and there is no display : they just see arrows and buttons they can press.
Those controls move a character on the server only. There is nearly nothing going from server to client (except some basic info like "it's your turn"). And absolutely nothing from one client should go to another client.
My first idea was to Network.Instantiate a "controls" prefab on each client, and synchronize the keypress actions. But this seems a bit stupid : other characters will Instantiate the controls too, which isn't needed, and they will even be Synchronized... Maybe I could limit this problem with groups, or with SetReceivingEnabled...
The other solution I thought of would be to have only one NetworkView, shared by everyone, and work with RPCs. But I don't know if those are meant to be heavily used like this, sending player input whenever a control is pressed/released. I'm also a bit concerned with delay here (though this game will probably be played on a local network).
Which solution seems best to you ? Can RPC be used that way ? Is there a way to prevent Clients to synchronize networkview among them ?
Thank you !
Answer by Corentin · Mar 16, 2015 at 05:40 PM
If anyone is interested someday, I went the RPC way without any problem. My use case is very specific, so it might no apply to many other situations
Your answer
Follow this Question
Related Questions
Is server the sender of RPC? 0 Answers
Did not find target warning when using uNet 3 Answers
SyncVar issue 0 Answers
Where is a free, helpful tutorial on how to use Unity's networking? 2 Answers