문제

For the last few months I have been programming a 2d java racing game and have recently finished a very bare bones multiplayer implementation. This simply uses a server-client system where all world physics calculations are done on the server and then relayed to the client. The client does no calculations of its own but simply renders data from the server and sends the server user input data. I only update the client held positions when the object on the server side actually moves. The system works perfectly fine when sprites are moving at low speeds - however, at higher speeds, they look jittery. The standard Valve article on the subject prescribes interpolation as a way to make movement look more smooth, but I want to be careful before misdiagnosing a problem and making the system even more complicated before I've solved the underlying problem. What's making me wary about this solution is that I'm sending the client update messages sixty times a second, which should be enough to make the quality much higher. Are there any other bugs that have similar symptoms? Thanks for your time.

Edit: If this seems vague, it's because it's supposed to be. I'm not asking for help in a specific situation, of for you to debug my code and figure out why it's not working. Unless I've made some awful error, I think my code does exactly what it's supposed to do, given the system described. I'm asking for a theoretical experience-based response as to the cause of the symptoms and what I should implement to solve this.

도움이 되었습니까?

해결책

I've resolved this with a simple fix - I was only updating my physics engine at 20 times a second, causing the lag described. Upping this to 50 times per second solved the issue.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top