I’ve been working on integrating networking into my sandbox game. Right now, the way I’m handling the physics is letting the clients do their own simulating, and having the server send 2 sync packets: linear and angular velocity every second, and position every 3 seconds. Sounds good, but lag (even when the client and server are both localhost) causes problems when more than a few bodies are in the world. Is there a better way to do this?
This is a 2D game, I’m using the JBox2D engine.
Right now I’m doing physics and drawing in the same thread, so I guess that could be part of the problem.