- Home /
Very simple networking question
I made complex ship simulators with radar, echo-sounder, steering, digital charts, engine sound, winches, etc. A first-person camera moves on the ship's bridge and works all the instruments.
I am now asked to have two or more ships networking in a common scenery. What I have done so far is:
A scene with the scenery and several ships as prefabs. I call it: client. A scene with only a script that starts a server. I call it: server.
Ships are moving and turning extremely slow! The only thing I need to communicate via the network is the Transform of each ship. I, therefore, decided to use a non-authoritative approach. The Server is only a connector, it doesn't contain any game object.
The problem is that, each ship is a complex object and I can't have them, including the first-persons, duplicated on the same client. I therefore use two sets of "ships:"
OwnShip1, OwnShip2, etc. including all the bells and whistles for the first-person player
Target1, Target2, etc. being only the hull and superstructure and navigation lights of the ships.
When a client is then connecting to the server, depending on its Network.player.ToString number, it instantiate, for example, prefabs OwnShip1 and Target2. When another client connects, it then instantiate OwnShip2 and Target1.
The point is: If the exercise says that there are two ships in the harbour, both must be there even if there is only one client (player).
To have say, OwnShip2 to move Target2 on the other computer, I think I only have to add a Network View component to the ship's game object with the State Syncronization set to Reliable Delta Compression and the Observed field to ...
Yes, what should I observe and how do I tell the network that what is OwnShip1 on one computer should move the Target1 on the other computer? Sorry, I have spent one week looking at all the Unity networking tutorials but I can't figure it out. For my defense, I am 66 years old and qualifies as "Dementia Light" ... :-)
Your answer
Follow this Question
Related Questions
Infinite/procedural multiplayer world in Unity possible? 2 Answers
Does the position change need state synchronization? 2 Answers
RPC Player Name and show it above head 0 Answers
[uNet] Need help Converting From Unity Network to uNet 0 Answers
AllocateViewID over RPC but the NetworkView doesn't exist 2 Answers