• 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!

GML Fullscreen/high res window drops the fps

K

kriz_cold

Guest
Hi everyone, I'm having a huge trouble with performance, apparently the Framerate of my game goes down a lot just for setting the game in a high resolution. I first thougth it was how the resizes work, but then I re-make the code so it just resize the window and not the game surface, gui, view, etc.
The framerate drops to 20% ~ 50%, just because the window size.
I tried a lot of things, this seems to happen in GM1.4 and GM2. I test this cleaning a room with just a controller and out in a single test game, so I can discard variables. The results are the same, the game slows down for drawing void.
The test game is just these:

obj.controller
>Create event

Code:
application_surface_draw_enable(false)
xx = window_get_width()/2-200
yy = window_get_height()/2-150
>Step event
Code:
xx = window_get_width()/2-200
yy = window_get_height()/2-150
>Draw event
Code:
draw_set_color(c_black);
draw_text(x,y,"fps = "+string(fps));
>Post Draw
Code:
draw_surface(application_surface,xx,yy);
room.room0
Speed = 9999
Clear Display Buffer with Window Colour [Unchecked]
Width = 400
Height = 300
1 obj.controller inside

Global_settings
Windows > Graphics

Allow the player to resize the window [Checked]
Allow switching to fullscreen [Checked]
Vertex buffer method = Fast

Try going to Full-screen or maximizing the game window and this is what you gonna see:

1) Window mode:
fps_01.png

2) Full-screen / Maximized
fps_02.png


I know that the game should have some fps loss because of the window size, but not a big deal. But the drop is indeed huge, and don't think I'm worried about the difference of 2000fps in an empty room, because this affects drastically in my actual game (When it goes from ~250fps to ~100) just with a few objects on it.

My pc specs:
Intel core i5
Ram 8gb
Graphics card NvidiaGtx960M
Windows 10
(A medium range pc)

A thanks in advice for taking the time to read this ;), hope you guys know what's going on.:confused:
 
I

icuurd12b42

Guest
resize the application surface. default behaviour is it follows the size of the window... or the screen if full screen. If you are running at 4k this is huge and slow
 
K

kriz_cold

Guest
resize the application surface. default behaviour is it follows the size of the window... or the screen if full screen. If you are running at 4k this is huge and slow
Thanks for answering icuurd!
You're saying that the fact of drawing void slows the game? That would be intresting, because the buffer of that area is in theory not being updated.
My guess is that the game maker actually slows down due to the screen size no matter if there is something being drawn or not. Or maybe is just me for an external cause (Like some hardware or software).

Edit: Forgot to say, i'm not in a 4k screen, just a common 1080p
 
Last edited by a moderator:
I

icuurd12b42

Guest
drawing to the app surface, which is when you draw things in the draw event, can be slow if the pixel density is high.

Yoyo tries to make sure the app surface is the same size as the final render, the screen or the window, so there is no scaling when they do the final render on screen... which is where things are more commonly slow on low end devices.

So, even if your room/view dimensions is 100x100, when you draw things they are scaled up to 1080p. then the app surface is draw without scaling to the screen...

The result, in theory is that this is more efficient in the long run... but not always. and things are smoother, not pixelated in the final render.


Also, note that most video card will go about 10 times slower in FPS with nothing happening going full screen. I'm going from 3000 to 300 on my 1070 from window to full screen with default room settings 1024x768 on a 1080p display...

resize the app surface to 400, 300 and see what happens... In my case I gain about 100 fps setting the app surface to 768...., so fps real is about 400.
 
K

kriz_cold

Guest
I fix the room, app surface, views to 400, 300 (I confirmed that in debug run), then I maximize just the window size and set the X,Y of the application surface:
Code:
xx = window_mouse_get_x()
yy = window_mouse_get_y()
draw_surface(application_surface,xx,yy)
and this is what I get:
wtf.png
Also, note that most video card will go about 10 times slower in FPS with nothing happening going full screen. I'm going from 3000 to 300 on my 1070 from window to full screen with default room settings 1024x768 on a 1080p display...
That means effectively the game slows down just for the window size itself (I think).

Edit: Also, increasing the app surface size slows down the game even more (but that should make more sense)
 
I

icuurd12b42

Guest
yeah, the amount of data required to generate an image grows exponentially the larger the image. if you take a 100x100 image vs a 200x200 image, that is 4 times the amount of data, consider you can fit 4 of that 100x100 image in all four corners of that 200x200 image.

It's not something to worry about, things tend the stabilize around 100-140 fps as the slowdowns are no longer gpu related at that point
 
K

kriz_cold

Guest
probably it's because the game uses a larger buffer when the screen is bigger, so more memory is being stored making the process slower even if that information is not being updated (but actually drawn)

Welp, thanks for your help incurd~
 
Top