Search Unity

  1. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  2. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  3. If you couldn't join the live stream, take a peek at what you missed.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Best practice for spawning a dynamically created level on multiplayer?

Discussion in 'Connected Games' started by Striph, Jun 13, 2018.

  1. Striph

    Striph

    Joined:
    Nov 17, 2012
    Posts:
    25
    I'm currently generating a procedural level on runtime, this works fine in the editor for single player testing but does not show up to any clients (not spawned as a network object is what I'm picking up from what I'm reading).

    My question is, whats the best practice for something like this? Should I instantiate it on the server, store it in a prefab somehow, then NetworkSpawn it to all of the clients? Or would it be a better idea to send the level seed to each client and let them spawn the level themselves?
     
  2. Ellernate

    Ellernate

    Joined:
    Aug 25, 2017
    Posts:
    68
    The first option won't work, prefabs need to be serialized in the build where they get their unique ids. The other option should work assuming there isn't any randomness or inaccuracy between simulations
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    2,575
    I'd send the level seed to the clients and have them generate the level using the same algorithm as the server. Otherwise you'd need to send the clients all the information they would need to construct the identical level, which could be complicated depending on the complexity of your levels.