Hi. I've looked around, and it appears that this is the best 2D physics library available. But I'm working on an online game, so I have a couple odd requirements, and I was wondering how the system would be able to handle them.
First, I'm using a client-server architecture, and the client and server should be reflections of each other, but they need not go into the same level of detail in representation. For example, if I have some sort of wriggling substance using a hundred joints, I could simulate it on the server with a few joints, and get close enough results while showing it with the full amount of joints on the client so that it looks more smooth. Anyway, my concern is mostly about the ability to put things back where they should be, and keep constraints on objects so that the client and server simulations are not too far apart.
I'm going to be using a technique called dead reckoning. Basically, you interpolate the movement of an object to simulate how it's acting on the other side. With just position and velocity, it follows a cubic hermite spline very well. At time t1, you receive a packet with the position and velocity of an object at time t0. So you extrapolate the position and velocity from the received data to where it should be at time t2, and use it to make a hermite spline, based on the local position and velocity at t1 and the extrapolated position and velocity for t2.
I don't know a huge amount about splines, but I think instead of just acceleration, I'd have to apply jerk to the body as well to get a nice cubic spline, and the error in such a situation would be significant, especially with discrete and unfixed time steps. The only other way I see to do it is to remove and replace the body each frame, along the cubic spline.
I'm far from needing to apply this sort of interpolation yet, but I'm wondering the best way to apply it in this engine, and if there's anything planned that might make it easier in the future.
First, I'm using a client-server architecture, and the client and server should be reflections of each other, but they need not go into the same level of detail in representation. For example, if I have some sort of wriggling substance using a hundred joints, I could simulate it on the server with a few joints, and get close enough results while showing it with the full amount of joints on the client so that it looks more smooth. Anyway, my concern is mostly about the ability to put things back where they should be, and keep constraints on objects so that the client and server simulations are not too far apart.
I'm going to be using a technique called dead reckoning. Basically, you interpolate the movement of an object to simulate how it's acting on the other side. With just position and velocity, it follows a cubic hermite spline very well. At time t1, you receive a packet with the position and velocity of an object at time t0. So you extrapolate the position and velocity from the received data to where it should be at time t2, and use it to make a hermite spline, based on the local position and velocity at t1 and the extrapolated position and velocity for t2.
I don't know a huge amount about splines, but I think instead of just acceleration, I'd have to apply jerk to the body as well to get a nice cubic spline, and the error in such a situation would be significant, especially with discrete and unfixed time steps. The only other way I see to do it is to remove and replace the body each frame, along the cubic spline.
I'm far from needing to apply this sort of interpolation yet, but I'm wondering the best way to apply it in this engine, and if there's anything planned that might make it easier in the future.