Hello,
I''ve been coding a Bomberman clone for about two years now (http://www.bomberman.fr.fm). Many people have requested network support for this game and I recently decided to try.
Someone told me the code design should have been planned for this, but oh well at least I will learn what I should have done
![](smile.gif)
By the way, how do you think it should be thought when you plan to add network support in the future?
I don''t have real experience in networking since I just read some articles about the constraints and how to (hopefully) fix the problems. I just tried some simple stuff with WinSock.
Here is the solution I may try, considering I''m using TCP and a client/server structure. Please don''t blame me if it sounds stupid
![](smile.gif)
Each client saves the state of the game. It lets the player use the input and play normally. The other players moves are predicted (I guess a very simple prediction could be acceptable). The local input is stored until 50 ms elapsed. Then this local input (which gives the history of the input during the last 50 ms) is sent to the server. While the server is receiving this, the player can still play normally and the other players moves are predicted.
The server waits for the local input of each client. Once it has received each client''s local input, it applies all these inputs concurrently to update the state of the game. Then it sends the changes of the game state to each client.
Once the client receives theses changes, it restores the game state he has saved. Then it applies the changes, and then applies again all the local input he is currently storing. Etc.
In theory, do you think it''s OK? And what about in practice?
I''d really like to have your opinion about the solution above, or hear about your solution, or hear about your advice on how to think about a solution, or any other advice actually.
Thanks!
fury