Search Unity

Resolved LobbyCode unusable for XR games

Discussion in 'Lobby' started by taimex, Mar 25, 2022.

Thread Status:
Not open for further replies.
  1. taimex

    taimex

    Joined:
    Feb 20, 2022
    Posts:
    13
    The LobbyCode is defined as "A randomly generated alphanumeric code that players can share with other players to join a private match." This makes if VERY unusable for XR games where there isn't a physical keyboard.

    To quickly join a local game in XR, it would be desirable to limit the LobbyCode returned when creating a private lobby to only numbers. This would allow a much smaller numeric keypad or number wheels to be displayed in the XR world instead of an entire alphanumeric keyboard.

    Additionally, to be able to limit the length of the code to just four (4) digits would be preferable. This would facilitate the quickest way for a user to enter a game with an out of band supplied LobbyCode. The search space for the LobbyCode to LobbyId match would be limited to 9999 active lobbies for a particular game. This should be sufficient for most games and still make it not likely for a users to randomly 'guess' a LobbyCode to enter some lobby they were not given the LobbyCode to out of band.
     
    Unity_Brandon likes this.
  2. Unity_Brandon

    Unity_Brandon

    Unity Technologies

    Joined:
    Sep 29, 2016
    Posts:
    23
    Hi taimex,

    Having a way to customize the complexity of the returned lobby code is an interesting idea. However, I believe on-screen keyboards are fairly commonplace in VR. In my Oculus quest, I believe there are a few places in which an on-screen keyboard is necessary within the main menu (such as searching the store).

    I would probably still recommend against limiting the number of lobbies to 1000, given that if there are as few as 20 lobbies across all regions there would still be a 1 out of 50 chance of being able to randomly find a lobby to join, including private lobbies. This is opposed to 1 in 220 billion with normal lobby codes (assuming my math is correct).

    However, if you'd still like to implement this, a good option would be to use the lobby data feature. You could generate a random 4 digit number and include it in the lobby data, then use the quick join feature and query by that 4 digit number.
     
  3. taimex

    taimex

    Joined:
    Feb 20, 2022
    Posts:
    13
    Thanks for your reply...
    I am targeting AR devices so the function of an on-screen keyboard my be less likely to exist in these devices.
    This is why giving the ability to limit it to just numbers would be great. Much easier to build a UI on our own for this than would be a full keyboard if the device doesn't support it.

    Four digits would limit it to 9999 possible lobbies, not 1000. At least for our use, this is reasonable number to not have to 'worry' about.
    If not for general use, if you just want to make it 6 "numbers" instead alphanumeric, then it is a 1 out of 50,000.

    If I understand your suggestion, you'd have the Host take the returned LobbyCode (alpha numeric) and generate a number between 0 and 9999. The Host then takes this LobbyCode4Num and the LobbyCode, stores them both as Lobby Data for the lobby the Host creates. The client would then query for a lobby with the LobbyCode4Num and then get the LobbyCode from the resulting lobby to Join with.

    Did I get this right?
    I like it... and your API's already support it.
    If so, then the Host could instead just store he LobbyId instead of the LobbyCode.
    I just need to avoid on screen keyboard input as much as possible.
    Thanks
     
  4. UnityKip

    UnityKip

    Unity Technologies

    Joined:
    Nov 15, 2021
    Posts:
    36
    Hi @taimex

    Your proposed solution sounds like it should work. Be sure to review the Lobby Query documentation for more details on implementing it.

    Let us know if you have any further questions or concerns.

    -Kip
     
Thread Status:
Not open for further replies.