• 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 FPS not reaching max FPS despite Debug Overlay FPS > 60

I did a simple stress test, draw 8000 bears (each bear is an object) onto the screen. I did the same exact test with GMS 1.4 and at first, it looked like GMS 2 was performing better, but my eyes were telling me something was lagging so I debugged the FPS using the built-in FPS variable and compared it with the Debug Overlay FPS. Here are the results:

GMS2:
1593761047596.png
GMS1.4:
1593761135486.png

Here is the creation code of the room:

GMS2:
GML:
show_debug_overlay(true);
display_set_timing_method(tm_sleep); // removing this line give the same result
game_set_speed(60, gamespeed_fps);
instance_create_depth(0,0,0,object1);
for (var i = 0; i < 8000; i++){
    instance_create_depth(random(280)+20, random(140)+20,0,obj_bear);
}
GMS1.4:
GML:
show_debug_overlay(true);
instance_create(0,0,object1);
for (var i = 0; i < 8000; i++){
    instance_create(random(280)+20, random(140)+20,obj_bear);
}
As you can see, the fps reading in the debug overlay for GMS 2 looks better than GMS 1.4 but GMS 1.4 manages to reach about 60 fps while GMS 2 hardly reaches 30. Both versions have FPS capped to 60. Vsync toggled on/off give the same result.

object1 displays the fps if you are wondering.
 
Last edited:

Coded Games

Member
In my game fps_real is always way higher than what the actual FPS is. For example I start dropping below 60 FPS when fps_real is around 200. I assume you are using all the same build options VM/YYC
 

sp202

Member
I'm getting a fixed 60 FPS on that project, I even increased the number of objects to the point where the fps_real dropped below the one you have in your image, but was still maintaining 60 FPS. Would you happen to be on a laptop with both integrated and dedicated GPUs?
 
Would you happen to be on a laptop with integrated and dedicated GPUs
I have a feeling this is my problem. Yes. I am currently abroad and it will be more than a month till I can return to my beautiful desktop. My laptop is pretty old (intel HD graphics with intel pentium) and when I was deciding to get a decent laptop or a beast desktop at a lower price, I chose desktop. I don't really regret my choice though.

Thanks for testing! I think this is just a GPU problem and not GMS. Still I wonder why GMS 1.4 was able to handle the load better.
 

Chaser

Member
Maybe GMS 2 is using layers and GMS 1 doesn’t? More processing causing slight slowdown? Idk just throwing that out there.:)
 

Coded Games

Member
I have had people have issues with my game using the integrated GPU of their computer instead of their dedicated. This caused bad performance. I don’t know if there is any way to have a game prefer a dgpu. They all just had to manually set the game to use it
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
You should try playing with the sleep margin and timing methods. I've read before that changing from the default timing method to tm_sleep can solve the issue, as can raising/lowering the sleep margin. Might be worth experimenting with this... like check the FPS and if it's below 60 then change the sleep margin/timing method. Another fix I've seen is for you to quickly switch between windowed and fullscreen a couple of times on startup. For some reason that seems to stabalise the FPS (something related to the OS and power saving or something like that...)
 
Top