- Home /
NetworkView Component state update
Should NetworkView component send updates only from object's owner side, or from other's too?
What I mean is, if object with networkView is spawned by one client and that client moves the object it sends state update to all others, but should it send state updates when it is moved by other client?
Answer by Fattie · Mar 18, 2013 at 12:09 PM
say four iPads are playing a networked game.
As a general rule ...
ONLY ONE is the "boss" of the game. it does EVERYTHING. the others do NOTHING.
the others are PURELY PUPPETS .. the others only display what the "Boss" iPad decides on. all physics etc is on the "boss" iPad.
Please vote up any of these other discussions which may be useful to you:
http://answers.unity3d.com/questions/326626/games-with-multiple-maps.html
http://answers.unity3d.com/questions/332027/call-a-rpc-on-all-clients-at-the-same-time.html
http://answers.unity3d.com/questions/346961/question-about-buffered-rpc-calls.html
http://answers.unity3d.com/questions/190340/how-can-i-send-a-render-texture-over-the-network.html
http://answers.unity3d.com/questions/347567/how-do-i-sync-network-ais.html
be sure to search on this site for topics like networking, RPC, etc.
Well, an authoritative server setup is quite common but not a requirement. It depends totally on what you want to use the Networking for. Not everything made with Unity has to be a game and not every game has a high requirement for cheat-safety ;)
Answer by Bunny83 · Mar 18, 2013 at 12:10 PM
Yes, updates are only sent by the owner. All other players are just "listener". However you can use RPCs which can be send in both directions.
BTW as previous often mentioned. I really worry about the nomenclature in the field on this. Whenever one says "server" it sounds like one is talking about "a web server" (I mean like smartFox, GC $$anonymous$$P, those cool games like Quake, or whatever).
There is no really good nomenclature distinction between "four ipads and one is the boss and the others are puppets" and "Quake -like server on the internet is the boss".
(Is Quake the one you play man? I always get those mixed-up as I'm so old :) Doom? Quake?)
:D Yes i', still playing QuakeLive. And yes Quake has an authoritative server, even for single player. $$anonymous$$inecraft also switched to this model. When you start a single player game it starts a local server in the background and connects your client to it. This actually simplifies the design of the client because it's always a client-server model.
However, unfortunately that's not possible with Unity since one instance of the program can only be either client or server. You would have to start the game a second time just to run a server.
Btw, i just posted an answer which explains the term "server" briefly ;)
An outstanding point -- Buzzy even if only one playing, you still have a "boss" routine and "client" routines.
fascinating info on QuakeAlive and $$anonymous$$C, thanks.
"However, unfortunately that's not possible with Unity since one instance of the program can only be either client or server"
Well you couldn't literally have two programs running on the device....
But you could certainly have a master routine in a run loop ('the boss routine") and you could also have a puppet routine in the runloop ("the puppet routine"). Indeed this is precisely what I did on a game, works great.
(So, if more than one iPad playing, on the Boss iPad it runs both the BossRoutine and a PuppetRoutine. On the others, only the PuppetRoutine. If only one iPad playing, it runs both the BR and the PR.)
It doesn't start a separate instance of the app - it just opens a listen socket for the server and the client, which happens to reside in the same app, connects to it. From a program$$anonymous$$g standpoint, neither knows the client is within the same app. It's pretty much only Unity that doesn't allow this sort of thing, which is one of the biggest drawbacks in Unity's networking model. It makes coding the server much more complicated than it needs to be.
you have to get REALLY SOBER to do stuff like that man ;-)
i believe (but don't know) Bunn meant it literally (these days) runs two instances.
also ... I added to B's discussion here:
http://answers.unity3d.com/questions/417626/masterserver-is-public.html
Your answer
Follow this Question
Related Questions
Network.Instantiate dont instantiate object 0 Answers
Unity software to act both as server in one network and a client in another 0 Answers
Smooth network communication like Unity remote 1 Answer
How do I change networkView ownership of a Rigidbody by clicking on it? 1 Answer
RPC not being called 1 Answer