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 »

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 »

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
User avatar
lysol
Posts: 1513
Joined: 26 Mar 2013, 01:48
Location: Sweden

Re: Constant 60 FPS but annoying micro-stuttering

Post by lysol »

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.
User avatar
psi29a
Posts: 5356
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 »

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 »

OpenMW doesn't use that type of delta time, does it?
User avatar
AnyOldName3
Posts: 2668
Joined: 26 Nov 2015, 03:25

Re: Constant 60 FPS but annoying micro-stuttering

Post by AnyOldName3 »

What other type of delta time would we use?
i30817
Posts: 58
Joined: 07 Nov 2018, 05:56

Re: Constant 60 FPS but annoying micro-stuttering

Post by i30817 »

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: 5356
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 »

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 »

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.
User avatar
AnyOldName3
Posts: 2668
Joined: 26 Nov 2015, 03:25

Re: Constant 60 FPS but annoying micro-stuttering

Post by AnyOldName3 »

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.
Post Reply