• 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 Game Speed Doubles in Fullscreen Mode

F

Fractal

Guest
I'm having a really strange problem, and I can't figure out what's causing it. I just started using source control for my ~2-year-old game project, and I pushed all the game files to the repository. Then, today, I did some cleanup and deleted a bunch of extraneous objects and sprites I wasn't using anymore, then pushed those changes to the repository.

Now, suddenly, my game runs at double speed in fullscreen mode. It's set at 60 fps, and when it's in fullscreen it runs at 120. This doesn't affect the real fps, and the debug graph does show the observed fps doubling. I can confirm that the deletion of those objects didn't cause this, since I pulled back the older version and the problem persisted. Even if the pull screwed up somehow, I went back through all the objects I deleted and none of them had any code that would have caused this problem.

The weirdest part is that the game is sped up as well as the frame rate. I'm not using delta_time, but I'm using a system where all my step and alarm values get multiplied by a value to automatically correct for a different hard-coded frame rate value, so the game should still be running at the correct speed. I'm not sure why it isn't.

I'm on IDE 2.1.4.288 and runtime 2.1.4.212. I've tried toggling vertical sync, using an older runtime, and restarting the IDE and my computer, and nothing solved it. I feel like the source control somehow had something to do with this since I've never had this issue before, but I don't understand how it could have messed things up, since rolling back didn't fix it and I verified all the objects I deleted had nothing to do with it.

Anyone have an idea of what's going on?

EDIT: Okay... so, I made a backup of the entire game project right before I did any source control stuff, and I tried importing that backup and running it. The frame rate is still doubled in fullscreen mode on that project! So at this point I can only assume that something outside of GMS is screwing around with things.
 
Last edited by a moderator:

DukeSoft

Member
You can try setting the window size to the display size and centering it. This is "fake fullscreen" or "windowed fullscreen". This will not bind the application to your videocard port and will probably prevent this from happening.

If you're 100% sure you don't have any "Game" tools running (all that bloatware that AMD / NVidia installs) it might be a bug - but I think the game is forced on 120fps by an external application.
 
F

Fractal

Guest
@Nocturne I have a GTX 1070, and I'm on a laptop, so I'm pretty sure I don't have Gsync/freesync. I did just update my NVidia driver, but I rolled it back and that didn't fix it, so that shouldn't be the problem.

@DukeSoft Yeah, for now I'm just using doubled window size instead of fullscreen. I've also found out that this issue happens with other GMS2 games and not just this project, so I'm assuming the issue is something outside of it.
 
R

Ruben Moreno

Guest
Did you just recently update Windows to the April 2018 update? I just updated today and all of a sudden I'm seeing a bizarre speed doubling like the kind you described, but also a strange lag in other parts of my project. EDIT: Fullscreen vs. non-fullscreen actually does make a difference on my end -- I had to test it properly. Looks like the game speed is set properly when in windowed mode but if I set it to fullscreen, it goes off the rails. But again, this only started happening today after I updated to the latest Windows release.
 
Last edited by a moderator:
F

Fractal

Guest
@Ruben Moreno Yep, I just updated Windows, and that's what I suspected the cause was, even though I have no idea how it could be doing that. I guess it's just breaking stuff like Windows updates like to do.
 

Elevory

Member
I'm experiencing this problem too (created a separate thread here). Some details about my situation:

  • In fullscreen, my game's framerate jumps to my monitor's refresh rate (144) despite my best efforts to lock the application to 60 FPS.
  • I recently installed the April 2018 Windows update.
  • Older builds of my game are affected by this bug--they used to work fine.
  • The problem occurs in VM as well as YYC.
  • My monitor has G-SYNC, but I've disabled the feature through NVIDIA Control Panel to no avail.

Has anyone submitted a bug report about this yet? It's a pretty urgent problem, in my case. I may have to resort to using the borderless fullscreen trick...

EDIT: Whoa, this is strange. If I enter fullscreen mode, then alt-tab out of the game and back in, the framerate corrects itself to 60 FPS. Hmm...
 

Elevory

Member
I have come up with a workable stopgap measure. :) It's janky as hell, but here we go:

You need to automate the process of alt-tabbing your game, since the FPS issue corrects itself when your application regains focus.

1. Download and import the Windows Commands extension by the world's finest GameMaker contributor, YellowAfterlife.
2. Wherever you call window_set_fullscreen(true), follow it with alarm[0] = 1 (or your first free alarm index).
3. In alarm[0], place:

Code:
window_command_run(window_command_minimize);
alarm[1] = 2;
4. In alarm[1], place:

Code:
window_command_run(window_command_maximize);
That seems to do it for me. Hopefully, yoyogames will implement a proper solution soon.

Note: I've only tested this in VM--feel free to let me know whether it works with the YYC.
 
Last edited:
P

pblpbl

Guest
I have come up with a workable stopgap measure. :) It's janky as hell, but here we go:

You need to automate the process of alt-tabbing your game, since the FPS issue corrects itself when your application regains focus.

1. Download and import the Windows Commands extension by the world's finest GameMaker contributor, YellowAfterlife.
2. Wherever you call window_set_fullscreen(true), follow it with alarm[0] = 1 (or your first free alarm index).
3. In alarm[0], place:

Code:
window_command_run(window_command_minimize);
alarm[1] = 2;
4. In alarm[1], place:

Code:
window_command_run(window_command_maximize);
That seems to do it for me. Hopefully, yoyogames will implement a proper solution soon.

Note: I've only tested this in VM--feel free to let me know whether it works with the YYC.
Thanks, it worked! I checked on YYC and it works there as well.
 
R

Ruben Moreno

Guest
Try forcing vsync off in your code with display_reset(0, false).

I THINK what's happening is that GameMaker isn't actually respecting the vsync project settings when in fullscreen mode due to the latest Windows update... I'm going to test this tonight and let you know if it works.
 

Zixtix

Member
Try forcing vsync off in your code with display_reset(0, false).

I THINK what's happening is that GameMaker isn't actually respecting the vsync project settings when in fullscreen mode due to the latest Windows update... I'm going to test this tonight and let you know if it works.
Would love to know if you found anything different with that!
 

DukeSoft

Member
You could also try using the old sleep interval method:
Code:
display_set_timing_method(tm_sleep);
that might help

Also, I have a 144hz G-sync monitor, and a regular 60hz one.

On the 144hz monitor it runs at 24 fps and when i drag it to the left it neatly runs 60fps.

If I disable G-sync (the sleep method / fullscreen stuff doesn't help) it jumps back to the expected 60.
 
F

firarottico

Guest
I'm having a really strange problem, and I can't figure out what's causing it. I just started using source control for my ~2-year-old game project, and I pushed all the game files to the repository. Then, today, I did some cleanup and deleted a bunch of extraneous objects and sprites I wasn't using anymore, then pushed those changes to the repository.

Now, suddenly, my game runs at double speed in fullscreen mode. It's set at 60 fps, and when it's in fullscreen it runs at 120. This doesn't affect the real fps, and the debug graph does show the observed fps doubling. I can confirm that the deletion of those objects didn't cause this, since I pulled back the older version and the problem persisted. Even if the pull screwed up somehow, I went back through all the objects I deleted and none of them had any code that would have caused this problem.

The weirdest part is that the game is sped up as well as the frame rate. I'm not using delta_time, but I'm using a system where all my step and alarm values get multiplied by a value to automatically correct for a different hard-coded frame rate value, so the game should still be running at the correct speed. I'm not sure why it isn't.

I'm on IDE 2.1.4.288 and runtime 2.1.4.212. I've tried toggling vertical sync, using an older runtime, and restarting the IDE and my computer, and nothing solved it. I feel like the source control somehow had something to do with this since I've never had this issue before, but I don't understand how it could have messed things up, since rolling back didn't fix it and I verified all the objects I deleted had nothing to do with it.

Anyone have an idea of what's going on?

EDIT: Okay... so, I made a backup of the entire game project right before I did any source control stuff, and I tried importing that backup and running it. The frame rate is still doubled in fullscreen mode on that project! So at this point I can only assume that something outside of GMS is screwing around with things.
In case you're 100% certain you don't have any "Diversion" apparatuses running (everything that bloatware that AMD/NVidia introduces) it may be a bug - yet I think the amusement is constrained on 120fps by an outside application.
 

Elevory

Member
Also, I have a 144hz G-sync monitor, and a regular 60hz one.

On the 144hz monitor it runs at 24 fps and when i drag it to the left it neatly runs 60fps.

If I disable G-sync (the sleep method / fullscreen stuff doesn't help) it jumps back to the expected 60.
This is kind of interesting. I experience different behavior on my 144hz G-Sync monitor; my application correctly runs at 60 FPS in windowed mode and 120 FPS in fullscreen (until I alt-tab, as explained above).
 

DukeSoft

Member
This is kind of interesting. I experience different behavior on my 144hz G-Sync monitor; my application correctly runs at 60 FPS in windowed mode and 120 FPS in fullscreen (until I alt-tab, as explained above).
Its all very unreliable, thats for sure :p
 

Zixtix

Member
I posted this in a different but related thread, so in case anyone wants to give this a try:

We had issues with random FPS drops on laptop PC with Nvidia graphics card. I thought that this may have to do with the Nvidia Optimus battery saving, so we want to follow the guide to enable it.

After contacting YoYo, we were given the following suggestion:

Add the below into the YYGML.h in %appdata%\GameMakerStudio\yyc\include (for GMS1) or %programdata%\GameMakerStudio2\Cache\runtimes\<runtime-dir>\yyc\include

Code:
#if defined(YYLLVM) && defined(_WIN32)
extern "C" {
_declspec(dllexport) unsigned long __attribute__((weak)) NvOptimusEnablement = 0x00000001;
_declspec(dllexport) int __attribute__((weak)) AmdPowerXpressRequestHighPerformance = 1;
}
#endif
Please note that this will only work for YYC and not any VM builds.
This solved the issue on one of our testing device, but we still get bug reports from players, so I don't think this addressed the problem. However, feel free to give it a try and let me know if it does anything for you!
 

Ehpy

Member
Howdy, first time posting (albeit on a 2 year-old topic)...

Has anyone submitted a bug report yet? I'm using GMS 2.3 and I'm getting the same issue Fractal originally described.

display_set_timing_method() and display_reset() don't do anything, though Elevory's workaround with YellowAfterlife's extension still works -- at the expense of a very janky-feeling solution. Zixtix's suggestion from YoYo didn't solve anything on my machine, and it seems like a stopgap anyway. Borderless windowed mode is an option now, but it limits user control over the window, and isn't toggle-able on runtime.

Also, I think DWM buffering is going to lead to minor input lag on anything but actual fullscreen, which might be a problem for frame-perfect fighting games and the like, but I don't know much about this.
 
Last edited:
Top