Speed up the game without breaking physics

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By dulvui

I’m making a soccer simulation game and for that I’m using normal 2DBody nodes for the players and ball. But I would like to be able to speed up the game, without breaking the physics and getting other results.

To speed up the game I found Engine.time_scale and Engine.iterations_per_second that affect the game speed.

So default values for timescale = 1 and for iterations_per_second = 60

By just setting time_scale = 0.5, physics seem to break. At least I can see, that it looks less natural than on normal speed.

When fasting up by setting time_scale = 0.5 and iterations per second = 120,
so physics don’t seem to break.
But I can’t really tell if this is 100% true. (Also 99% would be okay :wink: )

So does somebody know another way to speed up the game without breaking physics or can confirm, that modified time_scale and iterations per second don’t break physics?

:bust_in_silhouette: Reply From: Zeto

Have you tried look set physics_jitter_fix ? or lock FPS at 60

No, I will try that. Thanks for the hint.
But I asked this question also on stack overflow and there I got the answer, that physics could break, in case the engine can’t update the physic processes so fast.
Godot - Speed up the game without breaking physics - Stack Overflow

dulvui | 2020-11-01 14:27

:bust_in_silhouette: Reply From: huhund

FYI, changing timescale changes physics delta time - which is not what you want if you are after deterministic behaviour.
See this ticket:

And this patch: Add semi-fixed timestep and physics time stretching for global timescale · lawnjelly/godot@55ddf46 · GitHub

Thanks, but I think this is an overhead for my simple use case, so I’ll simply change logic of game. So I don’t need physics

dulvui | 2020-11-07 23:48