Matching type serial matching not working
Options
When I use function joinRandomOrCreateRoom function with serial matchmaking mode it first lands me in the same room again then on the second call I get in the new room.
0
Best Answer
-
I still do not understand, why 'testa' won't join 'teste' as the mode is serial matchmaking, should not he join 'teste' rather than joining the same room again on the second attempt.No. That's your expectation. See below.
here is how it happened
- "testa" connects & tries to find a random room
- "testa" creates "room A" with MaxPlayers = 4
- "testb" connects & tries to find a random room
- "testb" joins "room A"
- "testc" connects & tries to find a random room
- "testc" joins "room A"
- "testd" connects & tries to find a random room
- "testd" joins "room A" --> "room A" is full
- "teste" connects & tries to find a random room
- "teste" creates "room B" with MaxPlayers = 4
- "testa" disconnects --> "room A" is no longer full
- "testa" connects & tries to find a random room
- "testa" joins "room A" because server's serial matchmaker is pointing at "room A" --> the server's serial matchmaker is now pointing at "room B"
- "testa" disconnects
- "testa" connects & tries to find a random room
- "testa" joins "room B" because server's serial matchmaker is pointing at "room B"5
Answers
-
Hi @mohit_mittal,
Thank you for choosing Photon!
There is no "joinRandomOrCreateRoom", it's either JoinRandomRoom or JoinOrCreateRoom.
My guess is that it's JoinRandomRoom since it accepts MatchmakingType.
In order to help you we need more details:
- client SDK used and client SDK version
- server environment: are you connecting to Photon Cloud or to a self-hosted Photon Server?
- what's the expected behaviour vs. actual behaviour?
- minimal repro steps0 -
Hi @JohnTube Sorry, the function was 'joinRandomRoom'.
PhotonNetwork.JoinRandomRoom(
matchmakingParams.Hashtable,
4,
MatchmakingMode.SerialMatching,
TypedLobby.Default,
null);
-Photon Unity Networking v1.86
-server environment - photon cloud
-I am in a room of 4 people , there exists another room with only one user in it. I call joinrandomroom -> i leave the current room and again join the same one. I again call joinrandomroom -> then i join the room with one user in it. It should have gone to the single user room on the first call itself.
-repro steps - 1.have a room max capacity set to 4.
2.make the room full with 4 people.
3.make a new room with new user.
4.try making any user from the first room join a random room.0 -
Hi @mohit_mittal,-repro steps - 1.have a room max capacity set to 4.Make sure to wait sometime between 3 and 4 so that the 2nd room is ready to be joined.
2.make the room full with 4 people.
3.make a new room with new user.
4.try making any user from the first room join a random room.0 -
@JohnTube
I tried it, but still happens.
also note that it happens only for the first time, then calling the joinrandom again the user joins the seconds room as it should.
According to our QA team it used to work earlier, this issue is replicating in our existing app as well.0 -
Hey @mohit_mittal,
Could you send us a minimal repro project to developer@photonengine.com?
Add a reference to this forum discussion in the email if you do.0 -
Hi @JohnTube,
Out of context :Sorry, couldn't follow up on this for quite a while as this bug was sent to our backlog for a while, but now it was picked up again in the current sprint, so I must solve it.
Tested the same thing on the photons sample scenes on PUN v1.99 and was able to reproduce the same thing in that as well. Reproduction video and build links below
Video link:https://drive.google.com/file/d/1ALeWm-g4cB0V6wOs4y7Wn94H69tPKs5I/view?usp=sharing
Build:https://drive.google.com/drive/folders/1X7Z1KqG__htnEO9urpopwp2hupH1PlET?usp=sharing
So for reproducing it I just changed matchmaking type to 'serial' instead of 'fillroom' in PhotonNetwork.cspublic static bool JoinRandomRoom() { return JoinRandomRoom(null, 0, <b class="Bold">MatchmakingMode.SerialMatchmaking</b>, null, null); }
And made a mac build, copied it 5 times and ran 5 clients to test this.0 -
Hi @mohit_mittal,
Thanks for the report and the video.
I think the behaviour is expected and normal.
Serial matchmaking distributes players across rooms sequentially one after the other which is what you see in the video with player "testa" (same client build, same nickname but different UserId every time as it gets a GUID from the server).
I will ask my colleagues @chvetsov and @stefan for confirmation.0 -
I got confirmation from @Stefanwhen the first player leaves the game and tries to join its the first time that 2 games are available (player 5 opened the second game)
player 1 is matched to the first game in the list
leaves again, calls join again, is matched to the second game
we don't store the information in which game the player was before. we can only match player 1 to the first game with the first join call (regardless of serial matchmaking)
next join call matches to the next available (matching) game and so on0 -
More info from @Stefan (we will probably add it to the documentation):the server-side logic is quite simple.
- FillRoom: always take the first match in the list (oldest game).
- SerialMatchmaking: take for each join call the next node than for the call before (we have a pointer to the last result and take the next in the list). This is also never per player, we have no list for results we returned to a certain player. If the same player calls join 10 times or it 10 different players call join (once) makes no difference.
0 - FillRoom: always take the first match in the list (oldest game).
-
Hi @JohnTube
I still do not understand, why 'testa' won't join 'teste' as the mode is serial matchmaking, should not he join 'teste' rather than joining the same room again on the second attempt.
Also I didn't get thisSerialMatchmaking: take for each join call the next node than for the call before (we have a pointer to the last result and take the next in the list). This is also never per player, we have no list for results we returned to a certain player. If the same player calls join 10 times or it 10 different players call join (once) makes no difference0 -
I still do not understand, why 'testa' won't join 'teste' as the mode is serial matchmaking, should not he join 'teste' rather than joining the same room again on the second attempt.No. That's your expectation. See below.
here is how it happened
- "testa" connects & tries to find a random room
- "testa" creates "room A" with MaxPlayers = 4
- "testb" connects & tries to find a random room
- "testb" joins "room A"
- "testc" connects & tries to find a random room
- "testc" joins "room A"
- "testd" connects & tries to find a random room
- "testd" joins "room A" --> "room A" is full
- "teste" connects & tries to find a random room
- "teste" creates "room B" with MaxPlayers = 4
- "testa" disconnects --> "room A" is no longer full
- "testa" connects & tries to find a random room
- "testa" joins "room A" because server's serial matchmaker is pointing at "room A" --> the server's serial matchmaker is now pointing at "room B"
- "testa" disconnects
- "testa" connects & tries to find a random room
- "testa" joins "room B" because server's serial matchmaker is pointing at "room B"5 -
0