I am doing small game in xna client/server, there can be 50f per seconds, but i don't belive that each client has to sent 50 mesagges about only their position, and then get back from server, regular ping is 50ms so even if 20 messages per second then success, so how it is made that everyone see immediately that someone else changed its position?

2 Answers
2

Generally, you don't send 50 movement packet updates a second, normally it should be around 20. Quake 1 had 10 packets/second. What you would do is send say 20 movement packets a second, and have the other clients interpolate between the old position and the new position to stop the jitteryness.

That won't be immediate, but networking never is. Even over fast LAN connections, there would still be about 2-5 frames latency.

The client doesn't sent the position, and then move when the server lets him. That would introduce large amounts of delay that would make it unplayable. (Assuming real time here). What you would do is the client would tell the server that I am moving here, and the server would go off to tell all the other clients.

It would also be possible to have some form of anti-cheat system, where the server watches where the player is moving to, and figures out if it is valid. So it would verify that it is not inside a wall, not teleporting across the map, etc.