- Home /
Scene objects on multiplayer networking
Hi! I am using Unity 5.6.0, and I'm working on a multiplayer game over a local network. I have been testing my own localdiscovery and network manager without the standard hud with good results. So I think I understand pretty well how they work. I've also followed the networking multiplayer tutorial from unity website. My concern is about scene game objects. I have a big mess with them. My scenes are made of pieces of terrain that can be destroyed by the player object. Each of these pieces of terrain is a different prefab. At the beginning of the scene, level data is red from database and the corresponding prefabs are instantiated. But: should this process be performed on every client, or should the terrain be created on the server and spawned to the clients? I now that the spawn procedure is required for objects like the players, but should I follow the same criteria with every object that could be created/destroyed dynamically? Within the scene, there will be also some items that can be "caught" and used by the players. Again, which criteria should I use for them: client creation or spawning from server?
Sorry for the long question and thanks in advance for your help.
Answer by K_Tec · Jul 01, 2017 at 06:53 PM
I would say Server, because i think its bad if one player have aleady destroyed a piece and the other does have it undestroyed. :)
Thanks for your answer, 12ttttt. That was my initial idea; but I'm a bit concerned about spawning such amount of gameobjects (they could be even thousand of them) and its impact on performance.
I think i have a wrong image of your game in my head. Is it a 3d game were you can destroy tousands of manysmall terains?? why did you need so much :D ?
Please explain this to me, maybe we will find a better solution ;)
Regards,
$$anonymous$$erbo
Hi, $$anonymous$$erbo. Sorry for the late response. I've had problem with my internet connection. It's a sort of 2d labyrinth where the walls, floors and ceilings are made of blocks (of different types) and most of them can be destroyed or converted into any other type. From my tests, the maximum size of the levels could be about 400*400 blocks, but about half of the space must be left blank to move through them --> up to 80$$anonymous$$ blocks in one level (although I don't think I create such a big level). The amount of blocks in screen is variable because camera size can vary during the game. Hope this helps. Thanks.
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
How to make UNITY multiplayer with two HTC VIVE in the same real room? 0 Answers
Networking Question: Spawning selectively / on only one client. 1 Answer
Spawning bullets on host and client Networking 1 Answer
Why are objects only spawning on host but not on remote clients? 3 Answers