correcting client movements

mike1
Posts: 14
Joined: Thu May 03, 2012 8:47 am

correcting client movements

Post by mike1 »

Hi everyone,

I'm writing a server/client game, both server and client use Bullet physics.

My server has the 'real' world, and it sends this world to clients. When clients update the server, they send to the server their direction of movement. When the server receives this message, a certain amount of time has already passed since the message was created and sent (lag).
What I'd like to do is for the server to rewind the client to the previous known location of the last frame (easy), change it's velocity/apply forces, and then stepSimulation() only for that object with the time that passed.
Is this something that can be achieved using Bullet? Can anyone direct me to the API to achieve that?
Thanks in advance,
Mike
Robo
Posts: 1
Joined: Mon Jun 10, 2013 11:48 am

Re: correcting client movements

Post by Robo »

Hi,
I'm trying to do something similar.
You mentioned saving and restoring the state is easy.

Could you please tell me which functions you use to do that?
I tried get/setLinearVelocity()
get/setAngularVelocity()
and
get/setWorldTransform()

but without any luck :(
unfortunately I can't help you with your problem sorry :( (I imagine stepping a single object is not possible because a collision would have to update the other one too)