I must have gotten confused, I assumed the solver stepping was responsible for collision accuracy for fast moving objects along with the various gameplay flags I saw in there, beyond playing with the iterations and how many physics steps there are in a frame I hadn't fully dissected the physics system yet to completely understand it, as I mentioned it my pm. I've never had the need to personally write new solvers before. My attack plan was to use the built in bullet dynamics solver to see how it performed in the same circumstances and then inspect source of it and try to replicate how that solver works for collisions. I hadn't tested things like stairs or sliding against walls as I hadn't considered the solver's responsibility there.scrawl wrote:...
A deeper issue is that as soon as the physics system can't keep up with simulating X seconds of physics in less than X seconds, we fall behind, have to incorporate those leftover frames in the next frame, causing us to fall behind even further, and the cycle repeats. (The article "fix your timestep" discusses this problem as the so-called Spiral of death, he explains it much better than I can). This is the reason why instead of moderate lag, we see FPS numbers below 1 when the physics system is overloaded. There isn't a way to fix this other than putting the game in slow motion or just making sure you don't fall behind.
The purpose of doing multiple iterations is not to fix tunneling, it is to handle stepping over more than one obstacle in the same frame (think staircases, for example), and/or getting "unstuck" via the sliding mechanism. I don't think reducing the max iterations is the right fix. I've tested reducing it to 3, and noticed there are some spots where I get stuck that worked fine with 8 iterations.
As for uncontroversial improvements, I've found one: one of the stepMove calls was not necessary in most cases. This should speed up the problematic collisions by a factor of two. Fix is pushed to master. Not sure though if that is enough for all systems.
It's good to hear you found a more simple fix to at least solve some of the issue and I'll make sure to update my fork later and test it now, see where it can go from there.
As for fixing the physics timestep, I've run into this a few times before and... there never seems to be a "perfect" scenario, always tradeoffs. Glenn Fiedler (gafferongames author) also writes amazing networked multiplayer articles if you haven't read them before, cool guy all around.