here are some very newbie questions so don’t be surprised to hear yourself think “omg, is he serious???” while reading…
I’m planning a tetris game that supports 10 players (maybe more if it’s feasible)
Games will affect each other by sending junk blocks to the other players screens when a player takes out double lines or better. Thus, more players, higher difficulty… it would need a fair bit of testing and tweaking to get the difficulty just right. Each player can see the other players playfield.
I dont think my simple tetris game would generate enough traffic to slow down even a 56k connection with 10 players… i’m not really sure. The only other networking i ever did was in a chess game and a chat program.
I’m thinking of a few properties:
-
Permanent latency of 1000/2000ms, as the players do not interact directly, and to provide a buffer for network messages. the player’s own client will not show latency but remote ones will.
-
TCP rather than UDP because of above, and it is important that all messages get through. If there needs to be a resync, I don’t want it happening too often.
-
A means of passing on hosting responsibility to another client if the server drops out or quits… (though as yet I have only a couple of sketchy ideas and I can think of problems with most of them)
-
games buffer 500ms worth of messages to send so that they send less frequent, but larger packets.
With #1, maybe the latency would be dynamically adjusted in-game, but would not be done very often. I’d probably put a minimum of 1000 ms. The reason for this is #4, and an extra 500ms buffer should provide a smooth game.
would it be useful or even beneficial to try to manage the network load rather than have just one host recieving all the input and sending all the output? i expect that it would be more trouble than it’s worth, but i want to ask anyway. (see picture:http://www.adam.com.au/kellyjones/picsused/network.gif)
How would I effectively do #3? I was thinking of in case the host drops, the clients all listen for connections (become potential hosts), and try to connect to the others in order of first come, first host… (try for 5 seconds, move on… to next… until all have been tried then give up) seems a bit messy. Suggestions?