Search Unity

Multiple simultaneous maps in the game

Discussion in 'Netcode for GameObjects' started by Chefix, Mar 19, 2023.

  1. Chefix

    Chefix

    Joined:
    Mar 14, 2017
    Posts:
    5
    Hey.

    I just started developing with Netcode recently and I'm pretty comfortable with it when the game is played in a single scene.

    But I've been wanting to add an element to my game that would allow players to travel between different maps, while still being connected to the server and interacting with other players that are in the same map with them.

    For example, if you've ever played Minecraft, you know how you can be in the main world, but are able to teleport to the "Ender" which is like a different dimension.

    Is such a system possible with Netcode? If so, could you please give me a general idea of how to implement it?

    Thank you.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,989
    Afaik It would require a custom Scene Management implementation. The NGO manual briefly touches on this.
     
  3. Chefix

    Chefix

    Joined:
    Mar 14, 2017
    Posts:
    5
    Thank you for the reply. And for the last one, too.
     
  4. Chefix

    Chefix

    Joined:
    Mar 14, 2017
    Posts:
    5
    Well I looked at the NGO manual and still have no idea how to do it. If anyone could help, I would really appreciate that.
     
  5. cerestorm

    cerestorm

    Joined:
    Apr 16, 2020
    Posts:
    666
    It's a bit complicated due to the server having to keep track of what clients are in which scene and which network objects should be visible to them and hidden from them. There's no built-in mechanism for this so you'll have to write it yourself.

    I've messed around with this a fair bit so if there's anything specific I can help with let me know.