Godot: High CPU usage on simple project

Created on 15 May 2017  Â·  19Comments  Â·  Source: godotengine/godot

Operating system or device - Godot version:
Mac OS 10.12.4. Godot 2.1.3

Issue description:

Play any simple project and keep it playing after some time will cause the cpu overloaded and the cpu fans noisy.

Steps to reproduce:

Link to minimal example project:

archived discussion core

Most helpful comment

I'd like to have default 60 fps. I changed it every time when create new one.

All 19 comments

try to set force_fps to 60 at project setting > debug

This is not specific to Godot – this will happen in any rendering engine where the target FPS is not limited, or where it is very high (which is why it's usually a good idea to enable V-Sync by default, or force FPS to 60 by default, but make sure it can be changed by users, eg. for 120 Hz displays and benchmarking).

However, if you have a very slow machine, high CPU usage will happen even when rendering simple projects at 60 FPS.

No, I play it on a latest MacBook Pro with the toppest hardware configuration.
I also run other game engine, it's never overloaded as this.

That's because most game engines tend to either force you to limit to a number, or will automatically limit to 60FPS for you. GMS, for example, will render as fast as it can (I've seen it go up to the thousands of FPS in very simple rooms) but will only actually run step events (which is usually where stuff like movement code is) at the room speed (usually 30 or 60 times per second).

Consider Godot like GMS in that example, except that there is no room speed setting, so it really is just running as absolutely fast as it can, and so your code is being run thousands of times per second compared to the default of 60.. As suggested, try limiting it to 60FPS.


That being said, I would definitely be in support of defaulting the FPS limit to 60/90/120, or something similar such as simply limiting the number of draw events per second to the display's capable framerate. I won't suggest forcing it upon developers, though, but I don't imagine defaulting new projects to this would hurt either.

I'd like to have default 60 fps. I changed it every time when create new one.

I agree, I think there are more users who'd want vsync enabled than disabled, so it should be the default value.

@akien-mga I want vsync off. don't know why but "vsync on" makes about 1 sec delay when changing window focus on my ubuntu 16.04. (like changing focus between running game and editor... or any other application)

I want vsync off.

Then I don't understand what you meant with "I'd like to have default 60 fps.". vsync is what should limit the FPS to your monitor refresh rate, typically 60 Hz.

But if vsync is already on by default and OP still gets high CPU usage, the problem would be somewhere else.

@akien-mga story is like this.

  1. vsync on make my system response slow
  2. so I turn it off
  3. now no limit fps
  4. so I set it 60 fps

The alternative I see here is to disable V-Sync by default (helps with reducing input lag) and limit to 60 FPS by default (or 61 FPS, if you notice that a 60 FPS limit causes tearing, that has happened to me a few times but not in Godot). However, users of displays above 60 Hz will have to change the FPS limit themselves, which may not be possible for players of exported games where the FPS limit cannot be changed in the game's settings.

Lastly, mobile platforms – to my knowledge – always enforce V-Sync and it cannot be disabled there.

My main targets are iOS and Android devices ,will it be run smoothly by force fps to 60 for publishing?

Whether it will run smoothly or not is largely up to the content of your project, as well as specific devices. My suggestion, at least for Android, is to get a relatively new consumer android phone (somewhere in the $50 to $100 range, ideally with Android 4.0 as a minimum) and test it using that. While you won't get results that will apply to every phone, this should serve as a baseline for adjusting your settings and code.

I would be inclined to believe that the same would apply to iOS testing, but as I have very limited knowledge of how iOS works or how you would use one as a testing environment, I would prefer someone with more experience answer that for me.

First of all thank you for your report and sorry for the delay.

We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to.

We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us.
Could you check if the issue that you described initially is still relevant/reproducible in Godot 3.0 or any newer version, and comment about its current status here?

For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors.

Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed.

Thanks in advance.

Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it.

put it on low processor mode
image

Closing as it doesn't appear to be a bug (at least as far as this issue depicts), and solutions to OP's problems have been suggested.

Try open Godot in non Retina mode:
Right click Godot, choose "Show Info" and check "Open in low resolution".

It seems to work for me, because using Godot in Retina mode means crude high resolution for real time 3d rendering that could be taxing high on your machine.

@drsounds Alternatively, you can render the 3D viewport at a lower resolution by clicking on the Perspective button in the top-left corner then checking Half Resolution.

OK thanks for the great tip, it seems that the only blow I hear now is the wind outside (Windy here in Sweden). Thanks for your help!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bojidar-bg picture bojidar-bg  Â·  3Comments

nunodonato picture nunodonato  Â·  3Comments

Spooner picture Spooner  Â·  3Comments

blurymind picture blurymind  Â·  3Comments

RebelliousX picture RebelliousX  Â·  3Comments