Hi
i’ve read almost all TCP vs UDP thread, but i still have some question.
my game will be very x-wing vs tie-fighter like, almost a clone.
I’ve had some version running, fine in LAN, but unplayable on the internet.
My physic is DETERMINISTIC: so I can just send the input of the player to host, and from the host “collect” the actions and send them back to all clients.
also on client side i use 2 world: one is sinc with host world, the other is ainc and only use the action from client’s side, and generally is in the future respect sinc world of “ping/2” ms.
Probably client will send very small packet every time an input is readed, while the server will elaborate this action “pool” at 30 or 40 FPS.
now imagine a 40FPS action update cycle (25ms).
A server collect all the action arrived during the current FPS, and execute them in the next FPS, then send them back to all client (well, sending them back can be done immediately, but then there will be too much overhead)
client A’s ping with host is 100ms
client B’s ping with host is 120ms
client A shot, the action arrive with 50ms of lag, worst case add 25ms for action to be executed, and send it back. because of asinc world, client A see it’s shot after 50ms from send, and it will be corrected to 75ms after 125ms. I think that 50ms (or better half ping) from clicking a button and ship reaction are too much.
client B see the shot after 25+60ms, 85ms! this is too much in a shooter game!
ok, maybe 100ms is not a good ping, but many game still playable. Ok thanks to asinc world the experienced lag is “ping/2+25ms”(worst case, with a “warp” of 25ms) on your ship, but you will still experience “your ping/2+25ms”(worst case) lag for other’s ship.
As you can see I need guaranteed delivery(at least from server to client side), but I don’t care about the order. client will send small packet very fast, and server “big” packet every 25ms.