Box standing on edge

aclysma
Posts: 2
Joined: Tue Feb 12, 2008 3:59 am

Box standing on edge

Post by aclysma »

I am yet another person in search of networked physics. I was originally using PhysX but it crashed horribly when I tried to reposition objects. I have changed to using bullet and I am having a different problem.

My setup is a server and client (that supports clients joining during simulation). Both the server and the client use fixed time stepping at 0.02 seconds (for now). When no objects colide, I have good results and everything seems to be pretty fluid and stay in sync. If I do not try to move an object, the boxes I am using even stack (though admitedly only 3 boxes high.

My problem comes when I start trying to move an object around (I'm just applying forces). For debug purposes I turned OFF client-side simulation so I only see server-side position/rotation and am sending packets pretty frequently. The display updates as frequently as I receive a packet.

On the server, I think the boxes are allowed to be standing on their edge. I have no clue why this is happening. The boxes in general behave like boxes (i.e. they interact together believably) but if they are rotated slowly (applying a small force to somewhere other than the center of mass) they sometimes end up standing on their edge. This even happens if I call activate() on every object during every frame.

On the client, if I enable the client-side simulation, the simulation goes crazy.. boxes that are standing on their edges on the server get bounced upward with rotation. However, the boxes that are flat on the server look great on the client.

If I cause a new client to join to the server, both clients stay in perfect sync (even the incorrect jittering is exactly syncronized).

The picture here is the server state. If the client is simulating, the front box gets bounce up a bit and the box in the back right tries to turn itself over. However, on the server, the boxes are not moving, even though they are in a physical state that would make them move ordinarily.

Image

So the question I have is: What would cause the server to allow boxes to not reach a state where they are flat on the ground? I think if I can figure out why the server is behaving so strangely, I will have a working, syncronized solution.

Thanks in advance!
Philip