Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am developing a multiplayer tic tac toe game. The issue I'm facing at the moment is knowing whether the other player is in the game or not. Each player is running their own session, and should a player's session not exist, the game should end. How can I know whether the other player session exists or not?

share|improve this question
    
could you just implement a call response system: player1 sends state to player2. player2 sends state to player1. both send a received message to the other with differences if needed. for 9 points this is relatively trivial as a game state can be summarized as 9 enums (unused, player1, player2). then if a response is not received by either then start a timer if no response is received by the end that player is no longer connected. I say timer because their connection just might be slow. –  gardian06 May 6 '12 at 17:04
    
More information is required here. Is this a P2P game, client/server-based, or what? Your options depend on your implementation. –  SomeGuy Jun 4 '12 at 23:09
add comment

1 Answer

Simply have a timer. For example if a player gets 5 seconds then show a countdown for that 5 seconds and if the player hasn't made their turn by then I would say there is a 90% chance that the player has disconnected - so they automatically 'lose'.

In multiplayer games you must have some sort of timer or some players simply disconnect instead of losing.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.