Search Unity

Unity Relay UTP and NGO. Why use two separate allocations?

Discussion in 'Multiplayer' started by Boolable, Apr 13, 2022.

  1. Boolable

    Boolable

    Joined:
    Jun 28, 2015
    Posts:
    20
    I'm working on a project using Lobby and Relay (beta versions). I create my first relay once entered lobby to send direct messages via UTP (like chat). I figured out that in order to start my game once players are ready in the lobby, I have to create a new dedicated allocation for NGO. Am I right? Can someone explain why? Why can't we use same allocation for UTP + NGO?
     
  2. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    441
    You might have more luck reaching the Relay developers on this section of the forum.

    My understanding (and that'd need to be confirmed by the Relay folks) is that an allocation is like an identifier for a connection to the Relay server, so if you must create a new connection for NGO, then that'd require a new allocation.

    Now with that said, I think it might be possible to reuse the same allocation if you can ensure that UTP is not used once NGO is started. But that would require ensuring that NGO uses a higher nonce than UTP, which might be tricky since NGO always generates a new random one (at least you have control of it in UTP).

    I believe the cleaner solution would be to use NGO throughout, though. I think this is what Boss Room is doing. They have this lobby where players can select their characters and set their readiness state, and they use NGO for that too. You could look at their code to see how they handle the transition from lobby to game state. (They don't have a chat feature in the lobby, but I believe that could be implemented in NGO using custom messages.)
     
  3. Boolable

    Boolable

    Joined:
    Jun 28, 2015
    Posts:
    20
    Thank you for your help.
    I'll take a look to the Boss Room example.