Quote:

I tried something today and it really worked great! I was so pleased that something so simple could have such a big impact!



The physics engine already does something similar.

The base physics system checks whether an object is inside a wall at the beginning of each frame and then tries to push it outside. If your forces are very large, ERP (first value) is low, or CFM (second value) in ph_setcorrections is high, however, this counter-force to keep it outside the wall may not be strong enough to keep the object in the right spot. Also if your object has a high velocity it might start out on one side of the object and be on the other side of it within one frame.

To prevent this after each frame A6 checks (via a ray trace) whether the entity's center has passed from one side of a wall to the other side and if so puts it back to where it was. Again, with high forces, low ERP, high CFM, the object can get extremely close to the wall until it's squeezed in and then the trace will fail.

As usual, if you have a test level with severe problems please send it to mgrubert@conitec.net for inspection.