What are best practices for Multiplayer turn timers and dealing with afk or inactive players...

We have built a turn based card game and we have recently added a time limit on each player's turn. And thus play must always continue regardless if a player manually makes a play or not. This has created a new issue we are having to deal with as explained below.

When a player's timer has expired they will be forced to play a random card. There are at least 3 scenarios when this can happen.
1. The player has disconnected and no longer active.
2. Player is active, but afk or simply failed to make a play in time.
3. The player has temporarily switched apps, but is still active. However, now the game is paused and will not respond.

And the solutions:
1. Disconnected: The game simply continues without the player. The Master Client can make plays for them until they reconnect.

Now for 2 & 3 there seems to be no way to determine if a player is simply afk or the app has paused. So what are our options here?

A. We can allow the client to send a random play. But if he is paused the play will not be sent, or there will be a greater delay in the game while the other players wait for the paused player to return or become inactive, thus effecting the other player's experience. So this is not a practical option.
B. We allow the Master to send the play. This works, but what if the Master is the one who's game is paused. So this isn't a practical approach either.

So what would be a good practice here to solve this issue? Here are some thoughts:

I. Could the paused client use OnApplicationPaused to seen a message that they are temporary paused and thus pass their play control to the Master or if they are they master have the Master switched so the master can keep the game going? Would such a message be sent on iOS and Android while the game is paused?

II. When a timer expires could all players send a random play for the skipped player, but only the 1st one is accepted. This would be like a pickup item RPC sent AllViaServer. This would keep the game going regardless if a player is afk or paused.

III. Should only the master be allowed to send the random play? But if the master's timer expired then we pass control to another player and let them send the random play.

IV. Or I'm making a mountain out of a mole hill.

Regardless, writing this out has helped me better understand the problem and possible solutions.


  • Hi @Teddymac,

    personally I wouldn't like the approach of playing a random card. Instead I would prefer just passing the turn to the next player after the timer has expired.
Sign In or Register to comment.