4 ms·
Regarding "missing" a collision due to the delta-time being too large, I thought the game industry standard is to "backtrack" (in math, not in ticks) to determi
by mLuby 5y ago
Regarding "missing" a collision due to the delta-time being too large, I thought the game industry standard is to "backtrack" (in math, not in ticks) to determine the correct collision point and go from there. Granted, that is a bit more complicated than just keeping the delta-t/tick consistently small, but it is more correct.
- kevingadd 5y agoBefore you can back track, you need to first recognize that you missed a collision
- mLuby 5y agoCould be—it's been a while since I read about the technique. I thought a game engine doing this figured out the collisions when the trajectories changed so then it's just a matter of rendering those known effects (rather than the more naive approach of checking each tick or frame whether anything's collided). Note that doing this at impulse can cause the game to slow down when many objects are moved at the same time, like an explosion. I think it works pretty well because most game objects are stationary, or even immovable; also moving objects are rarely subject to new accelerations—they stay ballistic. But IANAGameDev, so do correct me if you know something about this technique. t=0 cube1 p=5,0 v=0,0 m/s cube2 p=1,0 v=2,0 m/s // Game knows cube1 and 2 will collide at t=2 t=1 cube1 p=0,0 v=0,0 m/s cube2 p=3,0 v=2,0 m/s cube3 p=0,0 v=5,0 m/s // Game knows cube1 and 2 AND 3 will collide at t=2 t=2 all cubes hit at 5,0
- plopz 5y agoIts pretty difficult to do quickly and with numerical robustness, specifically when you have rotation. Here's a talk by the creator of Box2D while he was working for Blizzard on continuous collision detection. https://www.youtube.com/watch?v=7_nKOET6zwI https://www.youtube.com/watch?v=7_nKOET6zwI
- mLuby 5y agoThanks, that was an interesting talk. Apparently what I was describing is "time of impact" as that talk describes here: https://youtu.be/7_nKOET6zwI?t=495 https://youtu.be/7_nKOET6zwI?t=495
- formerly_proven 5y agoA lot of game physics engines are still pretty bad at this, which is why being able to clip through walls is such a common issue. Even in games where the physics are more or less solid, there are usually many bugs where fixed animations allow clipping through stuff (e.g. cover or hurdle-jumping animations), because those simply don't interact with the physics engine at all - you only need to get to a start point that places the animation's end point out of bounds and be able to trigger the animation.