Page 1 of 1

CCD and NoSolver interaction

Posted: Tue Nov 01, 2011 6:31 pm
by bruce
Our player character moves pretty fast relative to the size of the time steps we can afford, so we were experiencing problems with tunneling through walls. Setting PositionUpdateMode = PositionUpdateMode.Continuous resolves the problem, but creates another. We have a lot of kinematic entities with NoSolver set that we use as trigger regions (level checkpoints, camera regions). When the player character passes through any of these, motion becomes discontinuous. For example, starting above a trigger region and falling into it, the character briefly pauses while passing through the trigger region. It looks like the code path for continuous updates gets time of impact for all collision pairs, finds the smallest time of impact and updates the entity up to that time of impact. I guess this makes sense, since it prevents the character from skipping entirely over a collision region (and obviously makes sense for something solid), but pauses in movement are unacceptable for our game. It also has significant ramifications on gameplay--jump height is inconsistent, since jumps passing through triggers will have their deltas cut short.

I'm just checking in to see if this is all working as intended and to see if you have any suggestions for solutions. One idea we had was to add a proxy object for detecting collisions between the player and trigger regions and disable collision detection between the player entity and trigger entities.

Re: CCD and NoSolver interaction

Posted: Tue Nov 01, 2011 7:38 pm
by Norbo
That is technically intended behavior, in that during the redesign earlier this year, I made the choice to avoid complicating things early on and left out some things. One such thing that previously existed but disappeared in the redesign was the option to avoid CCD in NoSolver pairs.

That said, the effect can indeed be very jarring. I went ahead and tossed in a MotionSettings.UseCCDForNoSolverPairs which defaults to false. You can grab the change in the latest development version: http://bepuphysics.codeplex.com/SourceC ... evelopment

Re: CCD and NoSolver interaction

Posted: Tue Nov 01, 2011 8:10 pm
by bruce
Thanks, Norbo. Works great.