Page 1 of 1

Server reconciliation with Bullet?

Posted: Sun Nov 22, 2015 8:20 pm
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

Re: Server reconciliation with Bullet?

Posted: Tue Nov 24, 2015 12:09 pm
by Basroil
Why not just compute the effective velocity (after aggregating all inputs) and pass that to the server side sim?

Re: Server reconciliation with Bullet?

Posted: Tue Nov 24, 2015 3:12 pm
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?

Re: Server reconciliation with Bullet?

Posted: Tue Nov 24, 2015 4:58 pm
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.