Original Post
Our game is going to have a turn based strategy battle system. Naturally, it would be really awesome to be able to battle your friends. So I am planning to write a Ruby on Rails server side program to coordinate connecting a player with a friend or random stranger for a single battle.
My goal is to keep the server load to a minimum, which means a few design decisions that make sense at the moment, but server stuff is a little new for me, so please feel free to tear holes in these decisions and/or enlighten me on issues I may have missed.
First off, it seems like a good idea to throttle down the frequency that the client side program checks the server for new information, say at most once per second.
Second, it seems like doing all battle calculations client side and then sending the results through the server to the other client would cut down the server load, and also simplify it so that I am not reproducing core C++ game logic in ruby on the server. This would probably work as follows, client A performs an attack that effects units 1 and 2 in the battle field, upload the attack name and the effects to the server. Client B checks the server and pulls the info, then simulates the attack, but in reality just applies the effects that client A uploaded. Rinse and repeat.
I like the simplicity of this process, but it seems fairly ripe for cheating. How easy would it be for the person controlling client A to fake the data sent to the server so that they actually do more damage than the game calculated (which would seem to get the two games out of sync and venture into undefined territory)? Is this really worth worrying about? The target will initially be iOS and Android, does this make it more difficult to cheat?
Are there any unknowns that I should be more worried about, like packet loss? I have a contingency plan to deal with people disconnecting, but there might be other things I haven't thought about.
I'm looking forward to hearing any thoughts.
My goal is to keep the server load to a minimum, which means a few design decisions that make sense at the moment, but server stuff is a little new for me, so please feel free to tear holes in these decisions and/or enlighten me on issues I may have missed.
First off, it seems like a good idea to throttle down the frequency that the client side program checks the server for new information, say at most once per second.
Second, it seems like doing all battle calculations client side and then sending the results through the server to the other client would cut down the server load, and also simplify it so that I am not reproducing core C++ game logic in ruby on the server. This would probably work as follows, client A performs an attack that effects units 1 and 2 in the battle field, upload the attack name and the effects to the server. Client B checks the server and pulls the info, then simulates the attack, but in reality just applies the effects that client A uploaded. Rinse and repeat.
I like the simplicity of this process, but it seems fairly ripe for cheating. How easy would it be for the person controlling client A to fake the data sent to the server so that they actually do more damage than the game calculated (which would seem to get the two games out of sync and venture into undefined territory)? Is this really worth worrying about? The target will initially be iOS and Android, does this make it more difficult to cheat?
Are there any unknowns that I should be more worried about, like packet loss? I have a contingency plan to deal with people disconnecting, but there might be other things I haven't thought about.
I'm looking forward to hearing any thoughts.