I am doing a real-time multi-user implementation using the Google Play services. The goal is to have 4 players playing together in the room, but if there are not enough players, the game should start with only 2 or 3 players. Ideally, the timer asks the first players to wait a bit.
Solution 1: I use RoomConfig.createAutoMatchCriteria (1, 3, 0); But in this case, automation never tries to connect 3 or 4 players, but always starts games with only two players (onRoomConnected (), with two players joining, and no one else can join the room)
Solution 2: I use RoomConfig.createAutoMatchCriteria (3, 3, 0); It works great with 4 players. But I cannot start the game manually with 2 or 3 players, since Callback is not called, especially the onPeersConnected () method is never called with 2 or 3 players online, but only when 4 players are connected (and, by the way, the waiting room is useless , because we can’t see how 2 other players are waiting with us, and when the 3rd one is connected, we most likely see all three other players and get all the corresponding callbacks).
I tried installing Games.RealTimeMultiplayer.getWaitingRoomIntent (mGoogleApiClient, room, 2); But (since the documentation states that this is possible with at least two players), to start the game without expecting that absent players are never shown (this only says: “there are not enough players to start”). [Edit: this seems normal, it only works with prompts, not autoload.]
So, I'm stuck in my implementation for my idea ...
It works great with 2 players (createAutoMatchCriteria (1, 1, 0).
it works great with 4 players (createAutoMatchCriteria (3, 3, 0), except that we cannot see if other players are waiting for us in the waiting room.
Thank you for your help!