Table 2. How to Overcome Latency
Decouple the communications from your game:
Place blocking communications calls in a separate thread or use asynchronous communications calls.
Never await incoming data from another player before allowing game play to continue.
Use predicting, interpolating, and reconciling later to improve game play.
When using prediction, transmit not just position information, but also velocity and acceleration.
Latch or queue user input (for example, keystrokes) until the next time communications data is to be sent. If you use the more traditional method of checking the keyboard at regular intervals during the game loop and perform this checking only at moments before sending data to the network, you will be prone to missing user input.
Hide latencies in other game elements:
Schedule events in the future if you want them to happen simultaneously for all users.
Require multiple shots to kill someone, and minimize the number of all-or-nothing, deterministic, latency-sensitive events.
Make rockets take a long time in the air (and reconcile the outcome while the rocket is flying).
Require time to move from one location to another (don't allow any instantaneous teleporters).
Make players, ships, and other objects move in ways that facilitate prediction. For example, build inertia into the way entities in your game move.
Use your imagination to incorporate latency within the context of your game concept.
Table 3. Techniques to Conserve Bandwidth
Compress your game and speech data.
Send data asynchronously--that is, only when needed, rather than at regular intervals.
Prioritize your data; then, think of your bandwidth resource as a fixed resource and budget according to your priorities. This way, if there is too much demand for bandwidth, you degrade game play gracefully. Prioritizing data and allocating bandwidth accordingly also allows for better interoperation between 14.4k, 28.8k, ISDN, and other qualities of bandwidth.
Use a multicasting or customized game server.
Cache information about other players locally.
Cluster repetitious game events (for example, a machine gun firing) into a small number of messages, rather than hundreds of messages.
Have AI live on the local client machines, and send over only the random seeds and checksums to control the AI.
Use teams and consider having players on the same team divide responsibilities so only one player needs to send data on behalf of the entire team. For example, multiple players can ride in a single tank that is controlled by just one player.
Donít allow everyone to see everyone else. One simple way to do this is to subdivide the game world (for example, into sectors or rooms) and restrict communication among players based on the subdivisions