Heho,
i need some thinkin' help. so imagine a 2d multiplayer space game with physics. each player controls a spaceship, there are asteroids.
i'm trying to wrap my head around how to handle collisions when pings are high.
in a techdemo i implemented state-sync multiplayer with client-side prediction/correction, server is always right.
client plays ahead of server-time and has immediate feedback on his own inputs.
(tried sending client inputs with future-timestamps also, but that feels sluggish to the player)
now i tried different approaches of displaying other players to the client.
extrapolating them is bad and results in desyncs basically everytime the other players move/act.
then i tried to show other players in the past, so i can interpolate from known states.
this looks nice as long as there are no collisions. for instant-hit shots i can use past positions on server to determine true hits.
but if the local player collides with another player there will be desync, because of the difference in time and thusly position compared to the server.
no matter how i put it, at one point the lag will make proper player/player collisions impossible.
think of two players trying to push each other away - i either have ping-sized delay between input and visible action,
or i have instant results from local players, but delayed movement from the others and with that predicition errors/desync.
testing this with RTT around 280ms, and it is maddening. i am starting to think the only way might be to not have real player/player collisions, and just make the ships explode or something when they touch.
but even then - if i want players to be able to ie bounce around asteroids using their ships,
or if they tried to push the same asteroid around, i end up with the same problems.
for example: [spoiler]
both players with the same high ping stand still with an asteroid between them.
at the same walltime both start to push the asteroid in order to smush the other player with it.
after ping/2 ms the inputs reach the server, which sees both players pushing the asteroid, so it's a draw and the asteroid stays still.
while for ping ms both players see themselfes pushing the asteroid and the other player doing nothing,
them victoriously smushing the other player with said asteroid.
after ping ms both players receive the servers state of them and the asteroid,
and have to revert to the moment when they started pushing the asteroid at ping/2,
having to realize they have not really smushed their enemy.
[/spoiler]
i guess this would even apply to a game of pong with high pings. to have proper collision on clients i need to have both players on the same timeframe, to have that i would have to show them in the past compared to player input.
am i missing something? or is it really not possible to have immediate applied player input with precise player/player-collisions on clients in high latency networks (ie the internet)?