Questions on networked box2d game

Hey, guys!

I want to make a networked physics game.

I've studied some others' work, especially Glenn Fiedler's blog and his GDC speech stuff.
As far as I know, the key problems is the latency and the deterministic thing brought by FP operations. Generally, I think Glenn's approach makes sense.
Latency problem:I want to use the old method Lock Step Simultaneous Simulation which is widely used in RTS games. Every player simulates other players action simultaneously after a few milliseconds when the action is broadcasted to everyone.
FP operation deterministic problem:Use Glenn's approach, broadcasting the affected bodies' position and velocity to other players for their correction.

I want to continue using box2d as the physics engine, but I don't know whether or not it is possible or easy to implement. Because I have not studied the core source code, I just used some APIs.

Should I pursue this idea? Is there something I should know about? Thanks!

I write an email to Erin, and he suggest me to post here for discussion.
Hmm...
No one replied, anyone could give some advice or your opinion on networked physics would be fine.
The lock-step model is a good one for getting matching simulations on all clients. If your game can handle the slight lag in reaction time between input and the effect of the input being seen, then it sounds like a good fit. About determinism, it is a fairly tricky goal to achieve and depends on what range of hardware/os you want to deploy the program. If you were already using a lock-step style, even if the simulation was not perfectly in line across each client a sync from a master client every now and then shouldn't look too bad. Depending on the game you could interpolate to the sync instead of snapping immediately when it arrives perhaps.
irresistible force wrote:
The lock-step model is a good one for getting matching simulations on all clients. If your game can handle the slight lag in reaction time between input and the effect of the input being seen, then it sounds like a good fit. About determinism, it is a fairly tricky goal to achieve and depends on what range of hardware/os you want to deploy the program. If you were already using a lock-step style, even if the simulation was not perfectly in line across each client a sync from a master client every now and then shouldn't look too bad. Depending on the game you could interpolate to the sync instead of snapping immediately when it arrives perhaps.


Yeah, It is what I thought. I don't know whether it works. Got to try it out.🙂 Thanks for your reply!

Original thread: https://box2d.org/forum/viewtopic.php?t=7450