OK, just read the UDP v TCP debate, along with the X-Wing v TIE article and Cormack’s Q3 strategy.
I’d like to run the following strategy for a multiplayer WWI flight-sim past you. For now, can we assume that only the network strategy is under review, not the overall design of the sim? I’ll explain the design of the sim under 1), and my current network thinking under 2).
-
The sim will have a client server architecture. Each client will send their control input to the server (position of joystick, throttle etc), and the server will work out what happened as a result, and will then send appropriate game state (position, heading, speed, damage state etc for all planes including the client’s in a 3 mile radius of the client) to each client. Obviously some form of prediction and merging will be necessary client side so that it’s not jerking all over the shop.
-
At present I’m thinking of using Cormack’s strategy; collecting the input states each with a timestamp and building UDP packets made up of all the input states since the state of the last UDP packet that was acknowledged by the server. Server discards any packets it receives that were sent earlier than the last received packet.
And in terms of the packets the server is sending to the client, again order doesn’t matter - the client works form the chronologically latest packet it gets, and ignores any ones with earlier IDs that it receives later than this.
Obviously there’s a lot of thought required to give the client a meaningful and smooth experience, but as a general approach does it sound at least sensible?
Rob