1
\$\begingroup\$

First of all I am total amateur in game development and sorry for my poor English. I want to make android human vs human chess game. So I am wondering how to design it?

scenario 1: User connect to server, find opponent and send moves to server using socket, so match is running on a server side. I think this is not good idea because move should be validated on client side - or do I have to validate moves on client side? I do not think this is good solution because game is seperated.

scenario 2: Using hole punching technique so server is needed only for connection between players, so game is running on android devices.

which approach do you suggest? Or is there any better solution? Which server is best to use?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

For most games, most of the game logic should be done on the server to avoid cheating.

However, in games like chess which are turn-based, have no information hiding and no randomness, this is something different. There is just no way to break the rules of chess without the other party being able to notice. This means that it is sufficient in this case to just send the other player the move and have them validate if the move is valid or not. You should still validate the own moves of the player though, so that the player gets immediate feedback and illegal moves aren't even sent to the other player.

Be careful though when you want to have online scoring. Cheaters could try to send you wrong match results to boost their score or reduce that of their opponents. To mitigate this, you could have both players send the recorded moves of the whole match to the server after the match is over. When they differ, they didn't play the same game. That means either that there is a bug in your app or that one of them was cheating.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Because the move list is all the information required to validate the match, you can instantly validate the result of the match, too. (Well, instantly with a match simulation program.) You can compare both players' match history for another validation step. \$\endgroup\$ Aug 24, 2014 at 15:55
  • \$\begingroup\$ @SethBattin You mean that players only send me a move list when game is over and if they match I can get the result? But they can also cheat at move list, so it is same if they send me just result. @Philipp @SethBattin So what is the best practice to connect two players? How does it works? If I understand right, when user A wants to play with user B, he gets his IP and connect through socket so they can communicate? And how do I implement ratings? They`ll probably have to register/authenticate so I can match ther usernames with ratings? How would you implement it? Thanks for help. \$\endgroup\$
    – Plejo
    Aug 24, 2014 at 20:14
  • \$\begingroup\$ @Plejo These are a whole bunch of new questions which are far too complex to answer with a comment. So I would like to ask you to ask them separately. \$\endgroup\$
    – Philipp
    Aug 24, 2014 at 20:23

Not the answer you're looking for? Browse other questions tagged .