This project has moved and is read-only. For the latest updates, please go here.

Reduce Tunneling

Topics: Developer Forum
Feb 25, 2008 at 7:17 PM
Are there certain things I can do to reduce the amount of collisions being missed by two objects? My pegs are pretty small (radius 10) and when my ball shoots at them it sometimes has an awkward bounce or goes right through (with the collision being recognized just no true bounce) to the other side. I've played with the timing of the simulation Update method in conjunction with my gameloop and that does seem to help a little, but not really sure what's optimal there (ie an update of .01 within the simulation object means that the gameloop should be updated...when?). I was thinking also collision groups, because my ball is the only real thing colliding with other objects, pegs, walls, floor and ceiling's don't move. TIA.
Feb 25, 2008 at 7:17 PM
Game is located here: where you can see the ball pass through objects and all that. Sorry, forgot the link.
Feb 25, 2008 at 7:17 PM
Edited Feb 25, 2008 at 7:18 PM
Feb 25, 2008 at 9:18 PM
I had the same issue with my game, I decided to decrease my timestep. Currently in my game I pass a timestep (dt) of .006 seconds. (equivalent to about 166 fps I think)

My render system is decoupled from my physics update and runs at 45 fps.

This probably seems like overkill, but if you have small fast moving objects it can be necassary. You may get away with a larger timestep than this... just tweak it till you get something that works.
Feb 25, 2008 at 10:04 PM
Let me give that a shot.
Feb 25, 2008 at 10:11 PM
This seems to work well with the game's speed, and if I decrease the value in my Update(.1f) to something like .07 or lower the tunneling problem gets better but the game is slower.

<Storyboard x:Name="GameLoop" Duration="00:00:00.005"/>