Original Post
Hi, I''m having a big problem with my network code. I made it using winsock and UDP.
The problem is the prediction. I have a dedicated server and then i connect to it. now each player sends a packet with his position, velocity and the keys pressed on his keyboard 5 times per second. Then the server sends packets with the positions of every player to the clients, but on the clients the other players jump around. I have some different smoothing algorithms and the work fine, but sometimes the player jumps back and forward, as if a packet with an older position arrived later because of lag. to avoid this i gave serial numbers to the packet, but the problem is still there.
I think its because of the server side prediction of client movements and when the client sends his new position to the server it is wrong and the updated position is send to the clients wich causes the player to jump back. But what i dont understand is, that even if i leave the controls the player, wich should move on with his last velocity, this effect occours.
both, the client and the server, share the same physic and movement funtions, so there should be the same movement on the server and the client...
hope anyone had a similar problem (and solved it) :D