[MENTION=5234]Mathias[/MENTION] thanks for the input!

Fusion 2.5 Microstuttering (moved from Fusion 3 status thread)
Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.
A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.
Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!
Clickteam.
A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.
Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!
Clickteam.
-
-
As using Ultimate Fullscreen extension means Windowed FS mode this case will likely complicate a good sync as the app has no direct control over the display output and Windows moderates everything. I did a lot of testing on this last year and UF harms the performance both in terms of maximum FR as well as stuttering. Anyway, the micro stuttering issue is clearly there, even on a blank app with real FS plus Vsync enabled. I think this is the basic setup CT should debug first.
-
Yeah, I guess the Mathias' idea about why it's happening and how to solve is correct (at least for the most part). There may be some other timing issues like using WinAPI timers (which aren't very reliable and never were - you better to write your own timing code), but I think the stuff @Please login to see this link. suggested is mostly correct.
More about Windows' timer issues:
Please login to see this media element.
//edit: And would you look at that, it also suggest why VSync is helping some people.
-
Ya know, I'd been considering contributing that video to this thread for a while now, but it seems someone beat me to it.
...this thread is about that weird issue where the framerate rapidly alternates between 59 and 60 FPS, right?
-
[MENTION=11123]happygreenfrog[/MENTION]: More or less, yes. At least the phenomenon you describe is probably related to it. What exactly is discussed here is that Fusion does not output constant frametimes.
This is how frametimes for 60 FPS should look like (ideally 16,66666 ms per frame). The example graph is a GM Game output.
Please login to see this picture.
And here is what Fusion does (idle frame, Vsync on, real fullscreen mode):
Please login to see this picture.
Fusion oscillates around the desired 16,6 ms. Frametimes are alterating between too short or too high resulting in a 60 FPS (or sometimes 59) output. The inconsistent frametimes cause a microstuttering though, that is visible by some players while others don't really recognize it.
Hope that sums it up.
-
[MENTION=8574]Darkhog[/MENTION]: Thanks for sharing this video about the scheduler rate and how it can mess things up. It's funny that the video shows microstuttering in a GM Game as an example of a subpar handling by a game engine, seems they fixed it in the latest installment, as the game I recorded as an example of how to do it right is from a Kickstarter in 2017 and probably made in GM2. This video provides a lot of insight on the topic and I hope for a dirty hotfix by CT that kicks the Windows scheduler in its ass somehow, just to try if it changes anything XD
Out of curiosity I tried the suggestion in the video and ran Open Broadcaster in the background to see if it somehow accelerates the scheduling rate on my system and improves Fusion's output, but nothing changed, the recorded result was the same I've shown in my last post.
-
[MENTION=5234]Mathias[/MENTION]: I just got Freedom Planet on Steam and recorded the frametimes on 3 different laptops. To my surprise, those frametimes where not any better than the standard Fusion runtime. Tested on machines with Win 8.1 and 10.
Here is the 8.1 output:Please login to see this picture.
Some of our findings suggest that microstuttering has indeed some system specific factors to it. Anyway, all my systems don't stutter with a couple of other games I recorded, so I still suggest the major factor of this issue is the game's individual runtime and not the system you play on.
-
[MENTION=12521]Julian82[/MENTION]: That's pretty interesting! Looks like I'll need to investigate this for myself.
Just to check, are you running the games that give you good frametime in fullscreen mode/with vsync? What games give you good frametime?
What about Freedom Planet (+ what Steam branch you are running the game on)? -
I did some research since you mentioned GameMaker.
GameMaker allows you to specify the sleep margin, i.e. the time that we will be waiting using a busy loop, while the rest of the time, we will be sleeping (using Sleep or Win32 Waitable Timers).
I'm not sure if Fusion already does this, but here is an example of how this could be done (slightly simplified):Code
Display Morevoid sleep(double); // e.g. Waitable Timers double get_time(); // e.g. QueryPerformanceCounter void yield(); // e.g. SwitchToThread void limit_fps(int target_fps) { static double last_time = get_time(); double current_time = get_time(); double target_time = last_time + 1.0 / target_fps; double t = target_time - current_time; const double sleep_margin = 0.01; // 10ms double sleep_time = t - sleep_margin; if (sleep_time > 0) sleep(sleep_time); while (true) { current_time = get_time(); if (current_time >= target_time) break; yield(); } last_time = current_time; }
GameMaker doesn't seem to use yield() as in this example, but processes Win32 messages instead, which is probably about the same.
It's a tradeoff in terms of battery/performance, but it seems like most GameMaker developers use a sleep margin of 10ms. -
[MENTION=5234]Mathias[/MENTION]: Great research, man! That makes totally sense, with a sleep margin of 10ms you would never miss a call, at least not if you need at least to hit the 16,6. I think in gaming battery performance does not really matter to players. Hope CT will look into this too.
To your other questions: I recorded GM2 (Flynn - Son of Crimson) as well as two custom engines (Axiom Verge, Volgarr) and Hollow Knight (don't know what this is made in). Game Maker was the only engine hitting the nail all the time, the other games were still a lot closer than Fusion though. I had posted some examples a couple of pages before.
I bought Freedom planet yesterday, cuz I wanted to test this out. So should be the latest build. Record was Fullscreen + vsync. I had also recorded the windowed modes, no difference here.
-
I see! I checked Flynn - Son of Crimson, and that uses a sleep margin of 10ms. You can experiment with this by opening data.win with a hex editor, and changing the "10" after "@@SleepMargin" to e.g. "05".
Curious what e.g. a sleep margin of 0ms, 5ms, 10ms and 15ms gives you! -
[MENTION=5234]Mathias[/MENTION]: Great idea, did not know that editing this data in GM Games is this easy XD I set the sleep margin of Flynn from 10 to 99ms but still got a rock solid baseline with no stuttering at all. There seem to be other factors next to the sleep margin involved that make this output as stable as it is. I still think the sleep margin is one major point to consider though.
-
I hope F3 performs like GMS. GM really does perform smooth as silk!!
-
not completely true. their particle system are to slow on android.
-
[MENTION=12521]Julian82[/MENTION]: You need to put it to "00" to see how it runs without any busy loop. 99 will just make it not sleep at all, which is very CPU intensive. I think we're mostly curious how lenient your system is when using a sleep margin of "00", "05", "10", so we can see what a good value is.
-
Oh, ok, so I did not grasp it, foolish me. I'll do what you said and report XD
-
[MENTION=5234]Mathias[/MENTION]: recorded different setups again. I'll just describe the results as posting all these graphs would make the thread explode.
System: Win 8.1, aged I7 Quad core (2013) @ 2,2 GHZ, 8GB ram, GeForce GT 740mTested Flynn with different sleep margins again.
Tests on power safe mode: 00, 05 and 10 (all bad baselines, stuttering in game very noticeable), 99 very good
Tests on max CPU power: 00 (nearly crash on start screen, game good with some little hangs); 05 (like 00, but no problem on start screen); 10 and 99 (very good)This may suggest (at least for my setup) that a sleep margin of 10 ms is probably a good way to go.
Setting a high value of 99ms on power safe mode successfully disabled underclocking of my CPU resulting in a good performance, while the standard of 10ms had bad results with power safe enabled. -
Btw, here is the Iconoclasts record you were interested in.
Please login to see this picture.
Runs smooth as silk, even in power safe mode (no difference). I know this will be my game of the year, and saying this in January is pretty risky XD
-
I'm sure you guys have heard or played the game Oniken? It's made by JoyMasher who also made Odallus The Dark Call. Both those games are made in Fusion. They added stuff to Oniken (screen filters and graphical updates) since it was first released. I was playing Oniken just yesterday and noticed EPIC STUTTERING when I switch on V-sync! The stuttering seems to go away when i turn of v-sync but then i get ugly screen tearing...
-
[MENTION=16460]Edel[/MENTION]: look at page 11 of this thread, I had posted the Oniken record there, runs horrible on my system too TBH
-
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!