multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.42k stars 438 forks source link

"Variable refresh rate" in Windows graphics settings causes lower FPS & stutter #2500

Open Dutchman101 opened 2 years ago

Dutchman101 commented 2 years ago

Describe the issue There is a conflict between a built-in Windows feature (that defaults to Enabled) and MTA.

Having "Variable refresh rate" toggled on, causes the game to suffer from FPS stutter/lower perceived FPS.. especially when a lot of things are moving on screen (such as when driving a vehicle fast, or flying.. but even without that, there are certain 'interval' microstutters that happens constantly)

Display settings > Graphics Settings (don't mistake it for Advanced display settings)

image

Then you will get here:

image

To reproduce

  1. Toggle off "Variable refresh rate" as per the Windows OS settings above
  2. Test the FPS/stutter experience with and without the setting on.. game will be much smoother while it's toggled off

Targets (to-do for this issue)

Alternatively, see if we just want to write the setting value using MTA, without asking the user. I don't think that our players will have any objections, because this ("Variable refresh rate") is a really bad quality Windows feature and known to be very buggy.. especially in combination with similar features provided by modern graphics drivers, like these:

AMD/Ati and Nvidia offer similar features such as:

They often conflict with the Windows OS "Variable refresh rate" as well, giving a subpar experience and FPS issues in many other, even modern (non-DX9) games. Most gamers don't realize this, but that's why the tweak is in the user's interest and therefore if we jump straight to overwriting the setting when MTA is being installed (so only once.. giving the user final say to re-enable it) it probably wouldn't be a big deal

Do note that those advanced graphic driver features (in their respective control panels) have an effect on "Variable refresh rate" outcome when playing MTA as well, as in: it can worsen it. Variable refresh rate alone causes the described issues with MTA, but such advanced graphics driver settings or their equivalent per GPU brand/driver, have interactions with it. That's why i wrote this pinned post in MTA discord #help-support as well, for a quick understanding:

image

Version Client 1.5.9-9.21048.0

Additional context Any user that reads this issue is advised to turn off "Variable refresh rate" in Windows 8 / 10 settings, and perhaps also change graphics driver features in their control panel (disable any such features like, and similar to, VSync, FreeSync and GSync.. besides using application profiles for MTA & GTA executables: "Let the application decide / defer to application" for as many options as possible).

But as you can guess from this issue, "Variable refresh rate" has the biggest impact of all, and is the most important. I didn't yet test the impact of such advanced graphics driver features without "Variable refresh rate" being enabled, but who knows they also don't float well with DX9 games

Sidenote (doesn't seem related to this issue): anyone reading this issue for the purpose of optimizing their PC to reduce FPS issues & stutter in MTA, may also take an interest in this statement from someone else:

image

EDIT: if you can't see the "Variable refresh rate" setting in Windows 10, see this comment for the reason

ArranTuna commented 2 years ago

Strange, I don't have that setting:

image

Dutchman101 commented 2 years ago

Strange, I don't have that setting

Because i was wrong with a detail..

You won’t see the slider unless your system has all of the following. If any of these are missing, you will not see the toggle and the feature will not be enabled for you.
- Windows 10 version 1903 or later
- A G-SYNC, FreeSync, or Adaptive-Sync capable monitor
- A GPU with WDDM 2.6 or above drivers, that supports G-SYNC / FreeSync / Adaptive-Sync and this new OS feature

https://devblogs.microsoft.com/directx/os-variable-refresh-rate/

But it may still explain FPS & stutter complaints that we hear from game PC users on a regular basis, as the specs that this option requires indicate a modern PC and monitor

Note: in my test cases (recently installing Windows 10 on 2 separate PC's) it was enabled the first time i went to that settings page. They may have changed it to be enabled by default (even though the doc claims otherwise) or who knows installing Nvidia/AMD drivers forcibly enables it. I didn't yet test looking at the settings page before installing the latest drivers. Bottom line, i have the feeling that in practise 99% of users with suitable PC specs have it toggled on, harming MTA game performance