Is it possible to set maximum delta time (or whatever you call) to be maxed by a value?
What I mean is:
public override void _Process(double delta)
{
// Cap delta at 0.1 seconds (10 FPS minimum)
const double MAX_DELTA = 0.1;
double clampedDelta = Math.Min(delta, MAX_DELTA);
// Use clampedDelta for your game logic
Position += Velocity * clampedDelta;
}
What this code does the game runs normally until it becomes slow motion under 10fps.
As you can see this only modifies for single moving node in Godot. Is it possible to make delta = 0.1 generally (or other workarounds)?
The maximal delta is not something you set, it’s something you end up with 
1 Like
I feared that might be the case. I guess I only apply to player script to prevent possible exploits.
(as applying to every object will be heavy on performance)
You can check delta for several consecutive frames and if it keeps being high simply pause the game.
Thanks, that’s even better
I’ll use your idea.
Seems like an odd thing to do, what exploits are you trying to prevent? Physics systems run at a fixed step, maybe using physics process for your updates would be better?
Collision jumps. sometimes you walk through collisions when game stutters or lower fps.
You can use continuous collision monitoring and/or shapecast to somewhat compensate, but for very long frame drops the game will likely break if you don’t pause.
I wouldn’t worry too much about it until it starts happening a lot.
Then you should certainly use physics process for collisions. It would also be wise to ensure your colliding bodies are not super thin, you could also increase their safe margin.
When asking for help make sure to state your original problem, not how to fix something that may or may not help, referred to as the XY problem.
Unfortunately for my game it happens more frequent not in editor but while testing in actual android device. I had to come up with something.
Profile your game, determine actual bottlenecks and optimize them so you can be sure that the frame rate is in acceptable ballpark on your target hardware.
2 Likes