0 votes

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.iterationspersecond that affect the game speed.

So default values for timescale = 1 and for iterationspersecond = 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 ;-) )

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?

in Engine by (44 points)

2 Answers

+2 votes
Best answer

FYI, changing timescale changes physics delta time - which is not what you want if you are after deterministic behaviour.
See this ticket:
https://github.com/godotengine/godot/issues/24334

And this patch: https://github.com/lawnjelly/godot/commit/55ddf46628ad310175b3e41a55784c186d087c83

by (130 points)
selected by

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

+1 vote

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

by (16 points)

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.
https://stackoverflow.com/questions/64620176/godot-speed-up-the-game-without-breaking-physics

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.