I’m trying to create a sort of a system that freezes all the props on the maps when physics just takes too much to process, and I was wondering if there was a certain way of getting the time it took to process physics during a frame, or something similiar. Any other ways of ‘detecting lag’ are rather unreliable and are oftentimes irrelevant to the physics.
I can’t think of any way really. If you’d host the server yourself you could perhaps write some c++ module that gets the servers CPU usage, and then perhaps freeze everything.
This is entirely possible in Lua. There’s actually a mod that already does this except it removes props when they start eating up cpu and lagging the server. Calculate delta time between frames ( Tick would suffice ) on the server. Usually it’s a very very small number, if it goes above 3 seconds, there’s a problem.
I’ve already done that, the issue is that this method is unreliable since it is often dependant on a plethora of other conditions. But thanks for the contribution.