Reputation: 14678
I am trying to test the automatching feature for multiplayer game. My game can't start without having 4 people. I am calling the method here
Bundle am = RoomConfig.createAutoMatchCriteria(3, 3, 0);
// build the room config:
RoomConfig.Builder roomConfigBuilder = makeBasicRoomConfigBuilder();
roomConfigBuilder.setAutoMatchCriteria(am);
RoomConfig roomConfig = roomConfigBuilder.build();
I tried testing on 2 devices. The problem that the waiting room does not show any of them connected to each other. HOWEVER, when I change the code to be a game of "2 players only"
Bundle am = RoomConfig.createAutoMatchCriteria(1, 1, 0);
Then both devices are connected and everything is like a charm.
Why is this? I wouldve expected that the waiting room would show players as they connect
Thanks
Upvotes: 1
Views: 634
Reputation: 1912
This is normal behavior. When a player is in the Waiting Room (if you decide to choose the included Waiting Room) for an AUTO-MATCH scenario, then until the service finds ALL the players that will be in that room, NONE of the AUTO-MATCH players will see any other connecting AUTO-MATCH.
Now, if you have INVITED and AUTO-MATCH in the same room, then when and if an Invitation is accepted, The INVITER and INVITEES will have Waiting Rooms that will show.
So, in your 4 player scenario. If the INVITER (Cheetah) invites Tarzan and Jane into the room (and your program chooses a 4th as an AUTO-MATCH) and then you start the Waiting Room sequence, Cheetah will have a waiting room with a slot each for Tarzan and Jane, and an Auto-Match waiting to be filled.
Now let's say that a random player has pressed their join game as well. They will have a blank waiting room with 3 slots showing "Auto-pick".
Tarzan gets the invite first and swings in. Cheetah and Tarzan both will now have Waiting Rooms with Tarzan and Cheetah saying "Invite Accepted" and waiting on Jane and an "Auto-pick". The random player will still have the 3 slots.
Then Jane gets to the invite and joins the fray. Her, Cheetah, and Tarzan will now have Waiting Rooms showing "Invite Accepted" for the 3 of them, and as the Auto-Pick guy is still there, Google will grab him and immediately fill the 4th slot. So, Cheetah, Tarzan and Jane will see something like P_4356 in the 4th slot, and the Auto-Pick guy will see 3 slots filled at once, with similar numbers as the P_4356 Name.
If there is no AutoPick player out there available when our Jungle trio have entered the room, then they will all stare at their screens with the 4th "Auto-Pick" until someone does join in.
I'm not sure that this is the best behavior, but it is what it is...
Upvotes: 1