| Wednesday, May 05 2010 @ 11:47 AM EDT
In case you haven't used it before, there is a very functional and well tested set of behavior for Dead Reckoning in Delta3D. Dead reckoning is what you do when you are trying to figure out where a remote actor is based on its last known position, velocity, and acceleration. Unless your networked app is publishing at 60 Hz, then it's pretty much guaranteed that you need to do some type of dead reckoning. In Delta3D, the majority of the behavior is provided via two classes in dtGame: DeadReckoningComponent and DeadReckoningHelper.
In the past couple of months, I completely reworked the smoothing algorithm on the trunk to use Catmul-Rom splines and I'm really happy with the results. So, if this is something that's applicable to your project, you might want to check out how the basic dead reckoning behaviors are used in the SimulationCore repository. In there, you'll want to look at two classes: BaseEntity and BasePhysicsVehicleActor. In those two classes, look for the following methods: TickLocal(), ShouldForceUpdate(), SetLastKnownValuesBeforePublish(), UpdateDeadReckoningValues(), and ComputeCurrentVelocity().
PS - I'm currently writing a chapter on dead reckoning for Game Engine Gems 2. Hopefully, that will help folks having trouble with it.
Project Engineer -- Alion Science and Technology