1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Anti-stuttering Trick: Force Game To Render At A Fixed Fps Target

Discussion in 'PC Discussion' started by geloxo, Nov 20, 2020.

  1. geloxo

    geloxo Well-Known Member

    Joined:
    Nov 21, 2018
    Messages:
    388
    Likes Received:
    594
    I have been using this trick during years for games that do not allow to set a rendering refresh rate in the menu configuration, such as TSW2. It´s old, it´s ugly, but it still works by far much better than any other method to bypass this type of situations, such as the FPS limit option that we have in TSW2.

    If you have a 60Hz monitor you will most likely be able to achieve a steady 60 fps gameplay by using the proper graphical settings, with the minimum possible stuttering so you don´t need this trick. But what if, like me, you have a standard 120Hz or 144Hz monitor? Then you will see that game will jump from 60fps to higher and lower targets and you will have also terrible stuttering. That´s because today game takes your windows desktop refresh rate to render and therefore it will try to achieve the max posible targets for the refresh rate it´s running at, so 120 FPS or 144 FPS for instance, but it will fail to reach that high and the result will be the stuttering when changing FPS values. The solution is to force the refresh rate at which game is being rendered to a lower value below what you use at your windows desktop, like 60Hz or even 50Hz if supported by your hardware.

    The easiest way is to change the windows desktop to a lower refresh directly but I don´t like to change it every time, as I also run other games at 120Hz or 144 Hz. In addition I have a display port that runs above 60Hz, so this refresh does not appear in the windows settings. There are other ways to force the refresh but NVIDIA has a trick we can use, as it´s built in their drivers. The control panel allows you to set 1/2 refresh rates but only if adaptive v-sync mode is used, which is not producing the best visuals (it gives you the so called tearing). But you can still use the NVIDIA Profile Inspector tool and simply change one setting there. This tool is a well known software that became very popular in the past, at it allows you much more customization than the regular control panel. The steps are very easy:

    1) Download the latest stable version here:

    https://github.com/Orbmu2k/nvidiaProfileInspector

    2) Now create a standard profile in NVIDIA control panel for the game executable (TS2Prototype-Win64-Shipping.exe), as you would do to add any other new game that is not listed there

    3) Then enable there the regular v-sync method with NVIDIA panel as you would do with any other game where you wanted to force it and apply the changes

    Panel.jpg

    4) Now open that profile in Inspector and set the 1/2 refresh rate in the Vertical Sync section and apply the changes

    Inspector.jpg

    5) Check that full screen mode is enabled in game UI graphics configuration menus but specially check that PreferredFullscreenMode=1 was indeed set in the GameUserSettings.ini file

    That´s all you need to activate this trick. If you go back to the NVIDIA control panel you will see that the game v-sync row contains now a "Custom" value. This is because NVIDIA does not support this setting natively, but it´s available in their configuration variables and it will not break anything in your card, don´t worry. It does the same that a game allowing you to set a refresh rate value does. And you can always restore the profile in NVIDIA panel to the default state, so don´t panic. What we did with it was to enable the refresh cap used by adaptive method but disabling the tearing control it has, nothing else. So v-sync will work as the regular method does, but at half the monitor refresh rate.

    But there´s even more. This setting can use 1/2, 1/3 or 1/4 options, which are the steps for the original adaptive v-sync method that NVIDIA has. This means that you can use a 144Hz monitor and set other rendering refresh rates for this game, such as:

    1/2 --> will target to 72 fps
    1/3 --> will target to 48 fps
    1/4 --> will target to 36 fps

    For a 120Hz monitor:

    1/2 --> will target to 60 fps
    1/3 --> will target to 40 fps
    1/4 --> will target to 30 fps

    And for a 100Hz one:

    1/2 --> will target to 50 fps
    1/3 --> will target to 33 fps
    1/4 --> will target to 25 fps

    I made a short video to test this with a 60 fps target (1/2 of a 120Hz refresh), but even 48 fps (1/3 of a 144Hz refresh) is a superb target for this game. The residual stuttering is caused by the well known tile loading, because I use a x2 viewdistance and other settings to enhance visuals and by the recording itself (encoding was made with my graphic card). Once the scenery tile has been loaded it runs like a charm, and when being in game (without recording) it´s even better.



    So devs please consider enabling a custom render refresh rate setting in game, as other Train Simulator versions had, as this is the best solution to solve the stuttering. Indeed it completely removes it and just leaves the tile loading one. Using FPS limits do not work well, nor here nor in other games that use it.

    Cheers
     
    Last edited: Nov 20, 2020
    • Helpful Helpful x 4
  2. 59321747

    59321747 Active Member

    Joined:
    Sep 16, 2020
    Messages:
    154
    Likes Received:
    79
    Very good, but I believe that DTG will gradually optimize the solution, after all, the game itself plus DLC is a large game with a volume of 100GB.
     
  3. Callum B.

    Callum B. Well-Known Member

    Joined:
    Aug 9, 2018
    Messages:
    479
    Likes Received:
    799
    This would work, I suppose, but completely pointless for any high refresh rate monitors with variable refresh technology (G-Sync/Freesync). Fortunately my monitor is G-Sync compatible so I use that instead and don't have to cap any frames. It looks like your monitor supports it, so why not turn it on?
     
    • Like Like x 1
  4. hyperlord

    hyperlord Well-Known Member

    Joined:
    May 20, 2019
    Messages:
    474
    Likes Received:
    387
    Yeah I was thinking the same as Callum B. since I purchased a G-Sync monitor back then to be a little "freed" by FPS jumps.
    Hmm ... I don't have a problem to configure that just for the TSW2 exe but because I'm a little bit lazy I wait for more responses here ;-)
     
  5. michael hooley

    michael hooley Active Member

    Joined:
    Dec 11, 2016
    Messages:
    246
    Likes Received:
    217
    It is sad that as customers that have paid for a product, we should be suggesting ways of fixing problems with the said product. surely that is DTG job.
     
    • Like Like x 1
  6. Callum B.

    Callum B. Well-Known Member

    Joined:
    Aug 9, 2018
    Messages:
    479
    Likes Received:
    799
    The microstutters fixed by this method aren't really a problem exclusive to TSW or DTG. It's just an effect of frame-skipping when the refresh-rate of a screen is out of sync with the frames being pushed by the GPU. It leads to some frames being dropped and thus a "micro stutter" that's most noticeable when moving toward or away object, which is pretty much any driving game. These microstutters are different from the ones caused by tile loading and are usually smaller and more consistent. It's actually not the game that is stuttering, but rather an effect of the display.

    Try switching from microstuttering to smooth on this page to see a simulation of what I am describing.
    https://www.testufo.com/stutter#demo=microstuttering&foreground=ffffff&background=000000&pps=720
     
  7. geloxo

    geloxo Well-Known Member

    Joined:
    Nov 21, 2018
    Messages:
    388
    Likes Received:
    594
    You are right, as for G-Sync users this is not mandatory. But my monitor is old and does not support G-Sync yet. The only thing I can do is to run it at different fixed refresh rates, but I have to set them in windows or in the games configuration when they allow that, as with any other regular monitor. It´s a native 144Hz one and I can use also 120Hz or 100Hz, but display port does not allow 60Hz. Now I mostly use 120Hz for all games.

    The good point about this method is that the monitor still works at 120Hz, but the rendering is capped to 60Hz by the NVIDIA method, and really capped, not only fps limited as games does now. So it´s less demanding for the game and super smooth for gameplay, as it targets to 60fps which is easier to achieve by my system than the origial 120fps that I would be trying to reach if I rendered game at 120Hz.

    I shared it cause it´s a method maybe not very popular but 100% reliable and effective. I had to use it in the past with other versions of the game as well and with other games.

    Cheers
     
    Last edited: Nov 20, 2020
    • Like Like x 2
  8. Callum B.

    Callum B. Well-Known Member

    Joined:
    Aug 9, 2018
    Messages:
    479
    Likes Received:
    799
    Ah, okay. It looked like G-Sync options were available for you in Nvidia Inspector but I guess I assumed wrongly! I'm hoping to procure a new GPU soon to replace my current 1070 as, unsurprisingly, it can't hit 60FPS at 3440x1440 in TSW2 (though it performs admirably at 45 FPS!). I will probably look into frame capping at that point simply to reduce fan noise.

    Thanks for the guide regardless, and I hope others in your situation will find it helpful!
     
    • Like Like x 1
  9. rostdor

    rostdor New Member

    Joined:
    Sep 10, 2020
    Messages:
    3
    Likes Received:
    0
    177 Gb I have a moment
     
  10. geloxo

    geloxo Well-Known Member

    Joined:
    Nov 21, 2018
    Messages:
    388
    Likes Received:
    594
    Stress test passed: Hagen at 60FPS. Pay attention to the upper left corner, where the FPS counter is. You can see that in game the result is amazing. At least I was never able to run that yard so good in my life. In video you can also feel how it behaves when recording is as smooth as in real gameplay (for instance when looking at the parked train or when my train passes by). Again, due to my recording quality, I have much more stutter in video than in the real gameplay, but the important test with this video was to check that FPS can stay stable as a rock even in this case, and with custom quality settings for engine.ini.

    [SystemSettings]
    r.MaxAnisotropy=16
    r.Shadow.DistanceScale=2
    r.ViewDistanceScale=2
    r.LandscapeLOD0DistributionScale=3
    r.StaticMeshLODDistanceScale=0.25
    foliage.LODDistanceScale=4
    r.TextureStreaming=0
    r.MotionBlurQuality=0

    My specs: i9900k + 2080Ti + 32 Gb RAM + Samsung 860 Evo 1TB SSD



    And this one is a higher quality recording where I managed to reduce almost all stuttering at all in the video, so it´s almost exact to what you see in the gameplay. This is much better to see the smooth results themselves.



    So game is able to run really well and look amazing too. It can give us much more than what we have. It just needs some small tweaks cause the basis we already have thanks to the creators design is strong, really strong to achieve it. I hope this helps :)

    Cheers
     
    Last edited: Nov 20, 2020
  11. keksman

    keksman Well-Known Member

    Joined:
    Sep 28, 2017
    Messages:
    207
    Likes Received:
    281
    To anyone with a Freesync/Gsync Monitor who feels like theres still some stutter like me: enable Vsync in the Nvidia Control center, set a max framerate at around 3-4fps below ur Monitors max framerate and disable Vsync in games. Freesync/Gsync works the best likes this, according to Blurbuster Forums and I can confirm that.
     
    • Helpful Helpful x 1
  12. geloxo

    geloxo Well-Known Member

    Joined:
    Nov 21, 2018
    Messages:
    388
    Likes Received:
    594
    Ok, I think I found the way to get stutter-free recordings. I have updated the first post video with another one. There you can see much better the smoothness itself. The recording is almost 100% exact to what you see in game. Youtube reduced the final visual quality a lot after encoding it, but well, that´s life...

    Cheers
     
  13. subwayvaughn

    subwayvaughn Active Member

    Joined:
    Sep 2, 2020
    Messages:
    32
    Likes Received:
    146
    Thank you, Geloxo. I’ll give this a go over the weekend.

    Regards,

    Vaughn
     
  14. geloxo

    geloxo Well-Known Member

    Joined:
    Nov 21, 2018
    Messages:
    388
    Likes Received:
    594
    You are welcome mate. Try it as it worths it. I recovered faith in game again. Now it runs smooth and I can still have high details at long distances. Old routes are a totally new world and yards are not a problem anymore. In my case system rendering workload was reduced so much that I could push the details one more notch up to a x3 viedistance and still maintain a constant framerate. That was impossible for me before, as I had a lot of lag and stuttering. Now you can have amazing cab views everywhere you go and a pleasant driving experience :)

    TS2Prototype-Win64-Shipping 2020-11-20 22-22-38.jpg

    TS2Prototype-Win64-Shipping 2020-11-20 22-25-57.jpg

    TS2Prototype-Win64-Shipping 2020-11-20 21-45-36.jpg

    Cheers
     
    Last edited: Nov 20, 2020
  15. hightower

    hightower Well-Known Member

    Joined:
    Mar 14, 2018
    Messages:
    1,138
    Likes Received:
    2,123
    I’m interested and baffled in equal measure by this. I believe we’ve got almost identical setups save for the CPU (AMD vs Intel - where your higher clock speed should, in theory, win the day for gaming), except I have a 60hz 4K monitor. It's surprising that a monitor can make so much difference but it does seem that way.

    With these .ini settings below, I’m getting a pretty rock solid (save for the odd stutter which is largely route dependent) 60fps. In game I have 4K Ultra and 100% screen percentage, whilst VSYNC and frame limiter are turned off. Save for the underlying lighting issues etc. with these settings the game does look pretty damn good now.

    [SystemSettings]
    r.ViewDistanceScale=8
    r.StaticMeshLODDistanceScale=0.70
    foliage.LODDistanceScale=5
    r.ShadowQuality=5
    r.Shadow.DistanceScale=2.0
    r.DefaultFeature.MotionBlur=0
    r.TextureStreaming=0
    r.BloomQuality=1
    r.TemporalAASamples=64
    r.SkeletalMeshLODBias=-2
    r.Color.Mid=0.4
    r.HighQualityLightMaps=1
    r.PostProcessAAQuality=6
    r.MaxAnisotropy=16
    r.Tonemapper.Quality=4
    r.Tonemapper.GrainQuantization=1
    r.SceneColorFringe.Max=0
    r.SceneColorFringeQuality=0
    r.LandscapeLODDistributionScale=3

    I have Vertical Sync set to Fast in Nvidia CP and the monitor as a G-Sync compatible. It is, but it’s not officially supported...

    1.png
    2.png

    I've also manually overclocked my GPU (ASUS ROG Strix RTX 2080ti OC) which undoubtedly helps. It 's totally stable at these settings and runs between 66 & 71 degrees. In game I've seen the clock speed hit and maintain 2100mhz.

    3.jpg

    I think that what this thread is perhaps suggesting is that it’s peoples setups, rather than the actual game itself that are responsible for some (not all) of the stutters, particularly as you seem to have managed to dial them out.

    The one caveat to all of this, is that if I let the game run under DX11 the fps can really drop in intensive areas, like Cologne. Running it under DX12 makes a MASSIVE (bold and underlined because it is that big) difference, and the solid 60fps is only achievable under that regime.

    I’m mystified as to why DTG seem to be saying they’re not going to support it. There might be a valid reason, but given the free performance boost it gives it seems, to a layman at least, crazy not to.
     
    Last edited: Nov 21, 2020
    • Like Like x 1
  16. geloxo

    geloxo Well-Known Member

    Joined:
    Nov 21, 2018
    Messages:
    388
    Likes Received:
    594
    In terms of rendering you are above as I´m not running native 4K. I run this at 1080p with 200% scaling in game. My monitor is not 4K.

    The main problem behind this thread is that games renders at your desktop resolution, so if you didn´t notice it (as it was my case till I started to monitor the fps) you may have the problem I faced as well: the rendering target fps are simply impossible to achieve by game and you will stutter like hell. As you guys said before this is not a problem for people running monitors at 60Hz, unless for some reason they want to force game to run at 30Hz. They could do it by using a 1/2 refresh as well sure, but I think going below 60Hz has no sense unless they stutter like crazy too. So nor game nor user are the guilty ones here indeed. It`s just that you need to be aware of this fact in order to configure game properly. The FPS cap never worked well in any games I know they used it. Flight Simulator had the same problem years ago. What better solves the stuttering is to limit the rendering refresh rate itself. It requires less efforts from your system and provides smoother results.

    Regarding DX12 I really don´t know what´s behind it and why devs don´t want to go with it. It may be just that it has a more efficient memory handling or bigger buffer in engine, who knows. But the fact is that together with texture stream off, it by far behaves much better on large tiles, as you said. The other settings I proposed are just cosmetic, for people willing to have better visuals and viewdistances. Any other settings proposals on this matter are fine too. But the real key elements for better game performance and stability are the following three:

    1) DX12 activated
    2) r.TextureStreaming=0 (disabled)
    3) Render at the lowest possible refresh rate (either by setting it at windows desktop or by limiting it with my trick)

    Cheers
     
    Last edited: Nov 21, 2020
    • Like Like x 1
  17. bescot

    bescot Member

    Joined:
    Dec 14, 2016
    Messages:
    28
    Likes Received:
    42
    What helped me on a 1080ti and a 4k screen is running at 30Hz and using in-game vsync to hold at 30fps. The card isn't powerful enough to maintain 60Hz and 60fps. 30fps is buttery smooth, whereas 45fps or thereabouts without v synch is very jittery. That's with DX12 and streaming off in the ini
     
    • Like Like x 1
  18. hyperlord

    hyperlord Well-Known Member

    Joined:
    May 20, 2019
    Messages:
    474
    Likes Received:
    387
    Oh thanks, mate! In combination with the findings from geloxo I took the time yesterday and set my game and nivdia settings accordingly, activated the DX12-switch and set a proper FPS target (30 fps in this case) and had a better experience driving Munich-Augsburg stutter-wise.
    So, indeed this prooves (to me) that there is at least something you can do as end-user. The GSync-Vsync combination is gold!

    I've had a similar experience when I set up TS2021 according to a very popular thread here in the forums and afterwards it behaved like a utterly different (better) game (performance and visual quality-wise).

    Btw: What do you guys think would be the best resolution-performance ratio for WQHD? I had 1440p as my resoultion set ingame and scaled that picture 150%, otherwise, I thought, I would never get rid of those flickering effects. But performance suffered hard somehow. Now I went down to 1080p and scale this up 150% to get at least stable framerates. But ... I don't know I thought my 2060 Super could handle that better than my GTX 970 I had during TSW1-period but the performance is quite the same at the moment, now at least non-stuttering 30 fps.
    I think I should look into my engine.ini again, maybe I'm doing some viewdistance overkill somewhere...
     
  19. geloxo

    geloxo Well-Known Member

    Joined:
    Nov 21, 2018
    Messages:
    388
    Likes Received:
    594
    Great news. Nice to read that the post helped you guys. Regarding the best setting there's no gold combination. You need to find what's the optimal for your system and what you feel best matches your own visual preferences. I prefer detailed viewdistance myself cause I like to have good definition in the distant field of view. Others prefer high fps, and so on.

    For the scaling the best is always 200% if you can use it as it gives the best definition. Lower values do not scale image symetrically and therefore results are not so nice but they are more performance friendly.

    Cheers
     
  20. maxipolo12

    maxipolo12 Active Member

    Joined:
    Apr 24, 2020
    Messages:
    244
    Likes Received:
    201
    that simply crazy what the players are obliged to do to have "normal" gaming expérience.
    Damn what are doing the devs ...

    I will try the tutorial ;)

    Hope that DTG will have a look on this.
     
    Last edited: Dec 2, 2020
    • Like Like x 1
  21. hyperlord

    hyperlord Well-Known Member

    Joined:
    May 20, 2019
    Messages:
    474
    Likes Received:
    387
    Oh, an update: meanwhile I settled with FullHD + 200% and, besides the tile loading, have absolutely no stuttering anymore with "reasonable 30-45 FPS"
     
  22. maxipolo12

    maxipolo12 Active Member

    Joined:
    Apr 24, 2020
    Messages:
    244
    Likes Received:
    201
    Still have stuttering on köln aachen but now with sun / lighting flickering

    I retry with ini tweaks

    nope nothing to do ..
    (i have Gsync monitor)

    But it is clearly bounded with the maps.
    I dont have any stuttering on london brighton map or Cumberland.
    for the german ones much more :/ especially in koln aachen - maybe because of the speed - the game can maybe not assume the texture generation
     
    Last edited: Dec 3, 2020

Share This Page