Tasharen Entertainment Forum
Support => TNet 3 Support => Topic started by: JimmothySanchez on March 21, 2013, 12:09:34 PM
-
I've been working on a game that needs scenes to be generated randomly. I've been accomplishing this locally by creating an empty scene containing logic that generates random prefabs at specific locations. My question is, as I am redesigning the game for multi-player, what is the best way to structure how the scene is generated and passed to each of the players?
-
Are you using some sort of seed for the generation? If so, you could possible just sync the seed used and have each client run the generation code with the seed that is synced.
Or if the prefabs have properties that need to be synced, you could just add the TNObject to the prefab and on the hosting client run the generation code using TNManager.Create instead of Unity's Instantiate. This would tell every client to instantiate the prefab wherever the Generation Code determined as run from the hosting client.
-
I haven't been using a seed, but that looks like that might be the way to go. Game is still in early planning stages so I may try implementing your solution. Thanks for your reply.