Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers 2

i recommend to all who want to implement multi player this article http://gafferongames.com/networking-for-game-programmers/what-every-programmer-needs-to-know-about-game-networking/

share|improve this answer
1  
+1 This is the bare minimum of research anyone should have done before coming here to look for answers. –  Patrick Hughes Jun 1 '12 at 5:27
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.