I'm doing a multiplayer realtime implementation, using the google play services. The goal is to have 4 players playing together in a room, but if there are not enought players at a time, the game should be started with only 2 or 3 players. Ideally with a timer asking the first players to wait a little.
Solution 1 : I use RoomConfig.createAutoMatchCriteria(1, 3, 0); But in that case, the automatching never tries to connect 3 or 4 players, but always starts games with only 2 players (onRoomConnected() called with 2 players joined and no one else can then join the room)
Solution 2 : I use RoomConfig.createAutoMatchCriteria(3, 3, 0); It works fine with 4 players. But i can't start the game "manually" with 2 or 3 players as no Callback is called, especially the method onPeersConnected() 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 the 2 other players waiting with us, and when the 3rd is connected, we sudendly see all the 3 other players and receive all the corresponding Callbacks).
I tried to set Games.RealTimeMultiplayer.getWaitingRoomIntent(mGoogleApiClient, room, 2); But (as the documentation says it should be possible with at least 2 players) a button to start the game without waiting the missing players is never shown (it only says : "not enought players to start"). [Edit : it seems it's normal it only works with invitations, not automatch.]
So i'm stuck in my implementation for my idea...
it works fine with always 2 players (createAutoMatchCriteria(1, 1, 0).
it works fine with always 4 players (createAutoMatchCriteria(3, 3, 0), except we can't see if other players are waiting with us in the waiting room.
Thanks for your help!