flightlessmango / MangoHud

A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more. Discord: https://discordapp.com/invite/Gj5YmBb
MIT License
6.57k stars 292 forks source link

AVG starting too early gives wrong AVG value #1436

Open luisalvarado opened 2 months ago

luisalvarado commented 2 months ago

This is using the compiled version from today and I see that the following is happening:

image

As you can see, before (I would say probably a month ago) the AVG would not start till around 10 seconds later or more, to offer a more realistic AVG FPS. Currently it starts from the beginning and it confuses the viewer or user because numbers don't correspond properly.

So for the image it was left running around 15 seconds and you can see that the AVG is very far away from the real AVG. Before for example it would say something more close like here: https://www.youtube.com/watch?v=N-gq5nDwfxM

I understand we can Reset FPS but for specific scenarios where the recording needs to grab the performance from the get go (From how the game loads, till the end of the recording), the AVG will mess that up.

Please let me know if this is not clear to assist as always. Thank you.

luisalvarado commented 2 months ago

Here is a more thorough test.

Counter-Strike 2 gives me an average of 200 FPS. In order to get close to 200 FPS on the AVG measurement, I had to play and wait 7 minutes. I played a full match in order to get the average of 200 FPS. Now imagine games that give 500 FPS or more. In order for a recording to show the proper AVG I would have to make a very long video about it.

Again, I might be wrong, but the previous AVG methodology was closer to the actual AVG when it waited several seconds before showing the initial AVG value like in https://www.youtube.com/watch?v=YvoSgp42-ms which basically was the main menu time plus loading the game. After that in order to show the real AVG was a second away.

flightlessmango commented 2 months ago

The AVG value is collected over 10minutes, so yes it should take some time to average out to the immediate average

luisalvarado commented 2 months ago

The AVG value is collected over 10minutes, so yes it should take some time to average out to the immediate average

Hi flightlessmango did you read both comments? I am mentioning that the fact that now we need to wait minutes for the avg to balance itself out is bad when the starting value is 0.

Instead of averaging the first several seconds and THEN showing the avg. Afterwards it would start leveling itself to the expected avg value.

Right now as it stands the starting value of avg is wrong (which is 0).

There is no previous collection of fps before showing the avg value to give a fast approximate value.

Meaning instead of waiting 10 minutes it should

  1. Collect a preliminary amount of seconds.
  2. Show the avg based on what was collected so far instead of starting at 0.
  3. Proceed with the avg calculation as it ia being done.

This ia how it was before. Now the avg is actually starting at 0 instead of calculating the average BEFORE showing. Which is what the preliminary several seconds are for.

luisalvarado commented 2 months ago

Found the problem @flightlessmango it is this part

https://github.com/flightlessmango/MangoHud/commit/d102604291cfb6b5b18f6e51a6bc0ef85d188d9b#diff-6adb07b69d0fb751ae425bbe9d6151e4115b51ce056ad66cf12c2285b23f5ee5L64

If I rollback that specific one, instead of the AVG taking minutes to get near the real AVG, it takes seconds. On CS2 it was 2-3 seconds to get to the AVG of 64 FPS for the timeline I measured.

While on Doom it took 5-6 seconds to get to the AVG of 1300 FPS for the timeline I measured.

flightlessmango commented 2 months ago

Found the problem @flightlessmango it is this part

It was a bug, it was not correctly calculating the metrics so we can't go revert that. Just because it worked differently before doesn't mean it was working correctly. Basically this is a feature, it only makes sense for it to take minutes to even out when metrics are collected over a 10 minute span. What we could do is change the default 10minutes to something less and or add a parameter to set the time span

luisalvarado commented 2 months ago

OHH You literally meant there was a 10 minute to grab the Average. I thought it was an estimation. Then yes, there would need to be a parameter that tells how long the overall time span would be before reflecting the AVG. This is very useful for showing raw data from the moment you start the game (intro, loading time, etc..)

flightlessmango commented 2 months ago

What I'm saying is the average needs a time frame of data to be useful. Currently it's 10 minutes. Let's say you start a game and the intro and menu is 1000+ fps and you wait for 5 minutes, then when you start the game and the fps is 100, it's going to take several minutes to reflect that because the avg is being "skewed" by the first 5 minutes

luisalvarado commented 2 months ago

That is correct, but the case I am making is, let us use the same example you gave, a recording would want to show that. A recording would want to show how the FPS was up in the beginning from opening the game, till the point or starting to play it.

Same for other spikes that happen throughout the game (just in case, good spikes but also bad ones like Dead Space stuttering issues). So those would need to be shown for the public to see their effect, for example, on the AVG analysis of the moment.

That is one of other cases of course. And I do understand about resetting it from a certain point in time, but this would be crippling everything that needed to be recorded beforehand is what I am trying to explain.

By allowing or offering the flexibility to dictate via a parameter for example, how long to wait to offer the initial AVG, the user can now control how they want the AVG behavior to happen in both scenarios.

jobs-git commented 2 months ago

This is using the compiled version from today and I see that the following is happening:

image

As you can see, before (I would say probably a month ago) the AVG would not start till around 10 seconds later or more, to offer a more realistic AVG FPS. Currently it starts from the beginning and it confuses the viewer or user because numbers don't correspond properly.

So for the image it was left running around 15 seconds and you can see that the AVG is very far away from the real AVG. Before for example it would say something more close like here: https://www.youtube.com/watch?v=N-gq5nDwfxM

I understand we can Reset FPS but for specific scenarios where the recording needs to grab the performance from the get go (From how the game loads, till the end of the recording), the AVG will mess that up.

Please let me know if this is not clear to assist as always. Thank you.

what game is this, I will try to check too

luisalvarado commented 2 months ago

This is using the compiled version from today and I see that the following is happening: image As you can see, before (I would say probably a month ago) the AVG would not start till around 10 seconds later or more, to offer a more realistic AVG FPS. Currently it starts from the beginning and it confuses the viewer or user because numbers don't correspond properly. So for the image it was left running around 15 seconds and you can see that the AVG is very far away from the real AVG. Before for example it would say something more close like here: https://www.youtube.com/watch?v=N-gq5nDwfxM I understand we can Reset FPS but for specific scenarios where the recording needs to grab the performance from the get go (From how the game loads, till the end of the recording), the AVG will mess that up. Please let me know if this is not clear to assist as always. Thank you.

what game is this, I will try to check too

Doom Eternal, but of course any game for example that has 200 FPS or more and you want to see the AVG quickly.

luisalvarado commented 1 month ago

@flightlessmango Hi, where would I find the parameter to control the 10 minutes to lower it via config file?

flightlessmango commented 1 month ago

There is none yet