fingh,
wow... if that's what all of you got out of my post (unless you just looked over in instead of reading it thoroughly, because of its size), then no wonder i didn't get any (except for a person's one) replies (which is good, because they probably wouldn't be helpful either).
i will read over my original post, and try to fix anything that looses you:
first of all,
server has the complete authority over everybody , and doesn't trust the client at all.
it only receives key-presses from clients, does physics, and sends the resulting positions back (for example, a client may send "i am holding down the 'move forward' key").
the client, on the other hand,
predicts his own movement , which is corrected by server's sent out packets.
now, back to my question.
if i don't have any server-side prediction, then if client 0 has a ping time of 100 ms, then all his movement actions will be 100 ms in the past for the server (eg. he starts moving at 532 ms, but on the server he will only start moving at 632 ms).
ok, the problem is the following. if there's an explosion, which all clients (as well as the server) already know will happen at, let's say, 900 ms. the problem is that at those 900 ms, client 0 will be a certain distance away from that explosion, and moving away from it. but the server, will only know his position 100 ms (which is his ping time) ago! at that time, for all we know, he could've been right beside the center of it! but to him, those 100 ms after, it will appear as he is a safe distance away from the explosion. but since the server is the dictator here, he will tell the client that he was killed by the explosion.
the problem occurs because client movement is his ping time in the past, but the explosions aren't - they happen at the same time for all clients and the server. so what should i do in order to fix that problem?
here's an example, which YOU DON'T HAVE TO READ because it might be long!
![](smile.gif)
someone throws a hand-grenade which will end up at (0, 0) and will explode at 1200 ms.time is 1000 ms:client 0 is at (0, 0)he realizes that he has to get out of there, so he starts running awaya packet [move right] is sent to the servertime is 1100 ms:server receives that packet, and puts the client at (10, 0)client sends another packet [move right]time is 1200 ms now:server gets the [move right] packet again, and puts him at (20, 0)the explosion happens on both the server and the client, BUT!by this time the client is aready at (30, 0), safe from the explosion radius... or so the client prediction tells him!because on the server he is only at (20, 0), he gets killed (his life was low)!but to the player that looks like total bs!
so how would i solve that problem?
ps. dammit! i wanted this to be a short, easy to read reply! :D please bare with me!
---
shurcool
wwdev[edited by - shurcool on July 16, 2002 1:56:26 PM]