Author Topic: Randomly Generated Scenes  (Read 2450 times)

JimmothySanchez

  • Guest
Randomly Generated Scenes
« 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?

broknecho

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 33
    • View Profile
Re: Randomly Generated Scenes
« Reply #1 on: March 21, 2013, 03:10:01 PM »
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.

JimmothySanchez

  • Guest
Re: Randomly Generated Scenes
« Reply #2 on: March 22, 2013, 02:05:32 PM »
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.