Constant 60 FPS but annoying micro-stuttering

Support for running, installing or compiling OpenMW

Before you submit a bug report for the first time, please read: Bug reporting guidelines
Jerome89
Posts: 8
Joined: 04 Oct 2018, 12:35

Re: Constant 60 FPS but annoying micro-stuttering

Post by Jerome89 » 21 Nov 2018, 23:49

Hi all,

@Capostrophic : Screenshot below, while running near Seyda Neen
https://www.dropbox.com/s/dwdecxmcrt8lv ... 5.png?dl=0

Image

@psi29a: 0.45 RC build from the 14th of November downloaded here : viewtopic.php?f=20&t=5220&start=140
Tests results :
- Without the textures from mod "VanillaPlus textures" mod (Purist version), no stuttering.
- With the textures from this mod, I still get the stutter.

First of all, that you so much for your help, I can enjoy the game once again :) Also, even with HD Vanilla textures installed, OpenMW 0.45 RC performance are really good. Congratulations to the dev team !

@Capostrophic said : "AFAIK Windows release and RC builds have some time-costly optimizations turned on during building so they can have better performance than nightly builds." It can explain why I get better performance with 0.45 RC rather than 0.46 or latest 0.44 nightly builds. One thing remains strange : the reason why suddenly the game started to stutter. I'm no able to give you the 0.44 revision number, I only know it happened in november.

Once again thank you for your help

Jerome

smokeyninja
Posts: 19
Joined: 26 Oct 2018, 07:51

Re: Constant 60 FPS but annoying micro-stuttering

Post by smokeyninja » 22 Nov 2018, 01:24

Is the game installed on a ssd or a hard drive? If it's running off a hard drive it might cause stuttering when it has to fetch things from the drive, an ssd wouldn't have that problem
Openmw 0.44.0 Windows 10 i7 7700k rx560

User avatar
lysol
Posts: 1360
Joined: 26 Mar 2013, 01:48
Location: Sweden

Re: Constant 60 FPS but annoying micro-stuttering

Post by lysol » 22 Nov 2018, 09:32

I guess the strange part is that it worked fine in 0.44 but not with latest master. But perhaps it is because of release build optimizations as Capostrophic believed.
Normal mapped texture replacers, exclusive for OpenMW:
My Nexus page

User avatar
psi29a
Posts: 4675
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Constant 60 FPS but annoying micro-stuttering

Post by psi29a » 27 Nov 2018, 17:20

The NV_present_video GL (and the Vulkan: VK_GOOGLE_display_timing) extension is apparently the panacea for this problem.

Take from this presentation where Croteam with Valve worked on the issue and found a possible solution.
https://www.gdcvault.com/play/1025407/A ... l0UDhEFabA
Implemented in The Talos Principle as proof of concept in Aug 2015:
Uses NV_present_video OpenGL extension
○ Originally intended for video playback - thus has timing features
● Almost there:
○ Properly schedule future frames
○ Get timing info for past frames
Original (stuttering) example code:

Code: Select all

frame_step = 16.67 ms // (assuming 60fps as initial baseline)
current_time = 0
while(running)
 Simulate(frame_step) // calculate inputs/physics/animation... using this delta
 RenderFrame()
 current_time += frame_step
 PresentFrame()// scheduled by the driver/OS1
 frame_step = LengthOfThisFrame() // calculated by the game2
Updated (non-stuttering) example code:

Code: Select all

frame_step = 16.67 ms // (assuming 60fps as initial baseline)
current_time = 0
pending_frames_queue = {} // (empty)
frame_timing_history = {}
while(running)
 Simulate(frame_step) // calculate inputs/physics/animation... using this delta
 RenderFrame()
 current_time += frame_step
 current_frame_id = PresentFrame(current_time)
 AddToList(pending_frames_queue, current_frame_id)
 QueryFrameInfos(pending_frames_queue,frame_timing_history)
 frame_step = FrameTimingHeuristics(pending_frames_queue, frame_timing_history)

User avatar
wareya
Posts: 338
Joined: 09 May 2015, 13:07

Re: Constant 60 FPS but annoying micro-stuttering

Post by wareya » 27 Nov 2018, 18:01

OpenMW doesn't use that type of delta time, does it?
paying attention to #1751 #2473 #3609 #3862/#3929 #3807 #4297 #4623

User avatar
AnyOldName3
Posts: 1594
Joined: 26 Nov 2015, 03:25

Re: Constant 60 FPS but annoying micro-stuttering

Post by AnyOldName3 » 27 Nov 2018, 21:36

What other type of delta time would we use?
AnyOldName3, Master of Shadows

i30817
Posts: 58
Joined: 07 Nov 2018, 05:56

Re: Constant 60 FPS but annoying micro-stuttering

Post by i30817 » 28 Nov 2018, 09:28

Isn't stuttering more likely to be because something that doesn't use delta-time like a script or a busy loop blocking the graphics thread than the game loop? Especially if it only happens in a heavily modded game.

edit: read the whole op finally. Well, textures shouldn't do that.

User avatar
psi29a
Posts: 4675
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Constant 60 FPS but annoying micro-stuttering

Post by psi29a » 28 Nov 2018, 09:39

From my understanding, there are lots of things that could cause this. The best we can do is attempt to reproduce to narrow it down and nail all instances which would cause this where we have the ability to do so.
i30817 wrote:
28 Nov 2018, 09:28
Isn't stuttering more likely to be because something like a script blocking the graphics thread than the game loop?
If that was the case then disabling the script (or the mod) would 'resolve' the issue right? This isn't the solution but it is a way narrow down if that is indeed the root cause.

I've not seen any concrete ways in this thread to reproduce the issue. Not everyone sees this issue.

However, the fact that the symptoms match what is currently seen in industry does indicate that there is a problem and that people aren't imagining these things and we shouldn't dismiss them.

User avatar
wareya
Posts: 338
Joined: 09 May 2015, 13:07

Re: Constant 60 FPS but annoying micro-stuttering

Post by wareya » 28 Nov 2018, 10:04

AnyOldName3 wrote:
27 Nov 2018, 21:36
What other type of delta time would we use?
Fixed timestep with interpolation.

This feels like it could be solved just by averaging the last couple frametimes together, too, if I'm not misunderstanding it.
paying attention to #1751 #2473 #3609 #3862/#3929 #3807 #4297 #4623

User avatar
AnyOldName3
Posts: 1594
Joined: 26 Nov 2015, 03:25

Re: Constant 60 FPS but annoying micro-stuttering

Post by AnyOldName3 » 28 Nov 2018, 13:45

We do fixed timestep with interpolation for the physics, but that's not something applicable here - you need to know which two things to interpolate between, which involves knowing the expected time that the next frame will be displayed, which is the whole problem in the first place with that type of stutter.

If we take a running average of frametimes, that would help reduce the impact of one frame taking an unexpectedly long time, but would also mean that one frame affected even more frames than it does now. Overall, it might be good and it might be bad.
AnyOldName3, Master of Shadows

Post Reply