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 don't really think this is an issue with the fact that UDP can drop packets (I'm using Lidgren and using ReliableInOrder), but basically, in my game, the client send the input keys (if forward is prsesed, backward is pressed, etc)

Now, when lag occurs, it's not noticeable at all if the packet that says "I'm pressing forward" right now is behind schedule, because I have interpolation. However, it's really annoying when you press the space bar (jump button), and nothing happens because the packet was dropped and Lidgren needs to resend it.

How can I fix this? Please keep in mind that the server controls all position data to prevent hacking, so I can't just make jumping client-sided and send the position.

Thanks!

share|improve this question

1 Answer 1

Your client should always assume the server will OK the input. The server should only send corrective position/orientation when the client seems to have moved suspiciously. Hopefully I didn't misunderstand how your client and server are communicating.

share|improve this answer
1  
i.e. process the input on the client too (as well as sending to server) and correct position based on what the server (eventually) says. –  George Duckett May 16 '12 at 11:40

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.