Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Third Party [Photon] can't find custom created room using random matchmaking

Discussion in 'Multiplayer' started by nightkenny, Mar 23, 2020.

  1. nightkenny

    nightkenny

    Joined:
    Feb 18, 2015
    Posts:
    5
    Hello everyone,

    I am working on a multiplayer game using Photon.
    I am trying to implement 2v2 matchmaking while playing with a friend.
    Random matchmaking is working perfectly fine, and as soon as 4 players join my room, I start the game, and it works. However the problem happens when I try to invite a friend.

    I create a custom room (using PhotonNetwork.JoinOrCreateRoom) and send the invitation to my club that contains the room name (any player from my club can accept the invitation and join my room). In the beginning I set the room to IsVisible = false so no one can find it using random matchmaking, and then as soon as someone accepts the invitations and joins the room (again using using PhotonNetwork.JoinOrCreateRoom), I make it IsVisible = true so it becomes visible to random matchmaking. I see that the player that accepts my invitation is in the same room as me and I see the room becoming visible, so this part is working.
    However when I try to do random matchmaking with a third player (using PhotonNetwork.JoinRandomRoom), I can't find that room and he ends up creating his own room instead and I can't understand why.

    If anyone has any hint or wants more information to discuss this issue, it would be very helpful. I've been debugging this for days and I still can't understand why I can't find that room using regular random matchmaking.

    Thanks again for any help!
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,082
    Which version of PUN do you use?
    Three things come to my mind here:
    a) All clients need to be in the same region. Sometimes best region selection isn't correct and a client connects to another region.
    b) The update of isVisible needs a moment to distribute, so if you quickly JoinRandom, it may (still) fail. Give it a moment.
    c) You need each client to have a unique userID. This is the case by default but if you got a login screen which sets the userID, it could be you use the same on multiple clients.

    There is a Matchmaking Checklist on the docs, which offers additional info.
     
  3. VirtualDreamer

    VirtualDreamer

    Joined:
    Aug 8, 2019
    Posts:
    5
    Hi there. I'm getting the same problem and I verified these:
    The build and the editor are on the same region (asia). I toasted it and they printed the same region
    The is Visible is True and I gave it a moment. Still can't find.
    I don't have a login screen.

    Any remediate I can try?
     
  4. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,082
    Turn on the SupportLogger and check both logs.
    The Matchmaking Checklist is complete. If you don't find a hint in the logs, send them to developer@photonengine.com.
     
  5. VirtualDreamer

    VirtualDreamer

    Joined:
    Aug 8, 2019
    Posts:
    5
    will do. thank you so much
     
  6. VirtualDreamer

    VirtualDreamer

    Joined:
    Aug 8, 2019
    Posts:
    5
    sent an email explaining the problem. is it okay for me to send a video instead?
     
  7. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,082
    Videos are not worth the effort, imo. We need to see the logs, code, etc. All of the hard info is text, so a video .. won't help.
     
  8. VirtualDreamer

    VirtualDreamer

    Joined:
    Aug 8, 2019
    Posts:
    5
    got it. by the way, I read the documentation and found out that Ownership transfers could only happen once in a scene? (Correct me if I'm wrong) I
     
  9. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,082
    Ownership can be transferred as often as you want to. Each transfer takes a bit of time, of course, as it travels the internet...
     
  10. VirtualDreamer

    VirtualDreamer

    Joined:
    Aug 8, 2019
    Posts:
    5
    I see. Yeah I confirmed it. It happened that I asked this because of an error in code logic. Thank you so much. You're the best.
     
    tobiass likes this.