Server reconciliation with Bullet?

Post Reply
axelf
Posts: 4
Joined: Sun Nov 30, 2014 10:22 am

Server reconciliation with Bullet?

Post by axelf »

How would you do server reconciliation with Bullet using btKinematicCharacterController? I am talking about when the server sends the state to the client and the client replays all the movements since that state.

No matter how many times you call btKinematicCharacterController::setVelocityForTimeInterval it still only moves once.

/Axel
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Server reconciliation with Bullet?

Post by Basroil »

Why not just compute the effective velocity (after aggregating all inputs) and pass that to the server side sim?
axelf
Posts: 4
Joined: Sun Nov 30, 2014 10:22 am

Re: Server reconciliation with Bullet?

Post by axelf »

Basroil wrote:Why not just compute the effective velocity (after aggregating all inputs) and pass that to the server side sim?
Because then I would have to call stepSimulation which would affect other things in my simulation. I think I'll have to rewrite the character controller to move immediately. Isn't that how PhysX does i?
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Server reconciliation with Bullet?

Post by Basroil »

axelf wrote: Because then I would have to call stepSimulation which would affect other things in my simulation.
That's the point of rigid body dynamics, why try to fight it?

From what you are describing, you'll have an inconsistent simulation step when you do take it, especially if the characters collide with a dynamic object. Just try imagining what will happen to a box that gets hit a dozen times with a increasing force each time (as you go further inside the box).

You can make dynamic objects move by applying impulses, or simply moving the kinematic body to a new location. Without defining your time variable though, you won't know how much to move at once.
Post Reply