• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows High cpu usage even when running empy game

R

RebelRex

Guest
15 percent - for empty project (making new project, and running it - the project itself thread cpu usage)
30 percent for a bit more complex project

cpu - 7700hq
gpu 1060
windows 10 64bit
gms2.3

in comparison , Doom 2016 runs on ultra 1440p in 40 percent cpu..
 
Last edited by a moderator:
Y

YupYup

Guest
I guess because GM2 does use more CPU than GPU for 2D work.
 
R

RebelRex

Guest
I guess because GM2 does use more CPU than GPU for 2D work.
Even when I use draw_enable_drawevent(false) , and nothing is practically is drawn to the screen , I got 15-20 percent cpu.
It makes it impossible to make server side applications in game maker studio as it will require too much resources..
 
R

RebelRex

Guest
Look on sleep margin: Quick Access>Game Options>Windows. It set by default on 10, try to use lower value (1 for example).
You may read more about it here: https://forum.yoyogames.com/index.php?threads/windows-sleep-margin-explained.18327/
Thanks for the help.
1) Lowering from 10 to 1 reduced cpu usage, but it is still high: Around 5-6 percent at peek for empty project, and around 8-10 percent for small server test project... any other ideas how to reduce cpu usage?
2) Is there a parallel for sleep margin on an Ubuntu platform?
 

RujiK

Member
Disabling garbage collection ( gc_enable(false) ) can have a big impact on the CPU usage but will likely lead to memory leaks. (The next GMS update should fix this)

Also make sure in your room settings that "Clear display Buffer" is disabled and no background layers are activated.

"game_set_speed(60,gamespeed_fps);" can also be used with the lowest possible number for the FPS and a low sleep margin. I get about 1% CPU usage on my mediocre work computer with these settings.
 

O.Stogden

Member
If you are looking to make a server program that has little overhead and can get good performance out of hardware, then GM isn't what you should use really. Making the server application in another language will give you much better performance and possibly allow you to run it headless, if it's that kind of server.
 
R

RebelRex

Guest
Disabling garbage collection ( gc_enable(false) ) can have a big impact on the CPU usage but will likely lead to memory leaks. (The next GMS update should fix this)

Also make sure in your room settings that "Clear display Buffer" is disabled and no background layers are activated.

"game_set_speed(60,gamespeed_fps);" can also be used with the lowest possible number for the FPS and a low sleep margin. I get about 1% CPU usage on my mediocre work computer with these settings.
Thanks for the help.
gc_enable(false) didn't reduce cpu usage for me, but "Clear display buffer" and game_set_speed(60,gamespeed_fps); did reduced max cpu usage by an average of 2-3 percent. So after that tweaking for the small server application took around 5 percent cpu usage.

I reduced sleep margin to 0.1/0.01 , and that reduced cpu usage to 0.5-1 percent. Not sure if sleep margin really works with fractions though, or it is just truncing it to 0 sleep margin :/ (Anyone maybe knows?).



If you are looking to make a server program that has little overhead and can get good performance out of hardware, then GM isn't what you should use really. Making the server application in another language will give you much better performance and possibly allow you to run it headless, if it's that kind of server.
Haven't found any guides on how to do that with game maker studio plus I'll need to refresh my knowledge on Java , or even worse, c++. If you can refer me to some useful resources , I will appreciate it .
 
Top