[0.10.9] Low FPS due to slow flip

This subforum contains all the issues which we already resolved.
User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

[0.10.9] Low FPS due to slow flip

Post by cube »

Rseding91
Factorio Staff
Factorio Staff
Posts: 14265
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.10.9] Low FPS due to slow flip

Post by Rseding91 »

This one also ties into that issue: https://forums.factorio.com/forum/vie ... =48&t=4883

There (may or may not) be helpful information on the last post I made on that.
If you want to get ahold of me I'm almost always on Discord.
User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: [0.10.9] Low FPS due to slow flip

Post by cube »

Rseding91
Factorio Staff
Factorio Staff
Posts: 14265
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.10.9] Low FPS due to slow flip

Post by Rseding91 »

I'm re-posting this here for visibility:
I did some more research into this issue and I don't believe it's related to the Factorio graphics library: Allegro.

I believe it's simply a fault of VSYNC and the mechanic behind it. VSYNC limits the refresh rate of the game to that of the monitor. If for any reason it can't keep it at a steady 60 FPS it will half it and try to keep it at 30. If it can't do 30 it goes half that and repeats. That's why different reports from people have shown up where the "Flip" timer is taking 30~ MS instead of the normal 15~ MS.

In order to fix that, the refresh rate would need to be controlled manually: timing how long since the last refresh and sleeping 15MS - time since last each frame (or something close to this effect).


Now, this is all speculation up to this point. I haven't done any actual tests (yet). If I find out anything else that might be useful i'll post it here.
If you want to get ahold of me I'm almost always on Discord.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.10.9] Low FPS due to slow flip

Post by kovarex »

I need to know if the problem appeared exactly during the transition 0.10.9 -> 0.10.10.

Who could prove/disprove that?
Rseding91
Factorio Staff
Factorio Staff
Posts: 14265
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.10.9] Low FPS due to slow flip

Post by Rseding91 »

kovarex wrote:I need to know if the problem appeared exactly during the transition 0.10.9 -> 0.10.10.

Who could prove/disprove that?
I've had the issue since 0.9 - it's not specific to any version. Also, did you mean 0.10.8 -> 0.10.9? 0.10.10 isn't out for public use yet.


My current VSYNC theory does make sense though: Flip() waits for the next monitor refresh. If the total time since the last Flip() is greater than 15 MS it would have missed the refresh and it's going to wait for the next Flip() which would put the total time between frames at 30 MS for a total of 30 FPS.
If you want to get ahold of me I'm almost always on Discord.
User avatar
micomico
Long Handed Inserter
Long Handed Inserter
Posts: 94
Joined: Thu Jul 24, 2014 10:55 pm
Contact:

Re: [0.10.9] Low FPS due to slow flip

Post by micomico »

Low FPS due to high flip happens to me every time there are a lot of trees in the screen, like when walking through a forest while zoomed out. Zooming in or walking away from the forest lowers the flip value again.

This happens since 0.10.3, which was the first version I played.
jazha
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Aug 31, 2014 6:05 pm
Contact:

Re: [0.10.9] Low FPS due to slow flip

Post by jazha »

kovarex wrote:I need to know if the problem appeared exactly during the transition 0.10.9 -> 0.10.10.

Who could prove/disprove that?
I've had this problem since the first version I played namely 0.9.8. I have no data from before this version as I did not play them. Thanks for looking into it =)
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.10.9] Low FPS due to slow flip

Post by kovarex »

I added experimental option to disable v sync (for 0.10.10), it is not good to play with that (v sync has its reason), but it could help to find out, if the time spent on the flip is caused by vsync or something other.
jazha
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Aug 31, 2014 6:05 pm
Contact:

Re: [0.10.9] Low FPS due to slow flip

Post by jazha »

kovarex wrote:I added experimental option to disable v sync (for 0.10.10), it is not good to play with that (v sync has its reason), but it could help to find out, if the time spent on the flip is caused by vsync or something other.

If released by the time I leave for work then I will help test this. (I am virtually without download possibilites due to internet situation onboard the ship I work on, and I am away for 4 weeks)
User avatar
pyrolytic_tungsten
Fast Inserter
Fast Inserter
Posts: 115
Joined: Fri Aug 01, 2014 4:29 am
Contact:

Re: [0.10.9] Low FPS due to slow flip

Post by pyrolytic_tungsten »

I played a little with 0.10.10. In previous versions I sometimes had reduced framerate when fully zoomed out in forests with increased flip time. Now flip always stays low and the framerate is good in forests regardless of vsync setting (with game restarts when the setting is changed). I can't notice any difference with either vsync setting but I am using a CRT monitor with 75 Hz refresh so tearing may be more noticeable to those with LCD displays and the like. This issue is fixed for me.
jazha
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Aug 31, 2014 6:05 pm
Contact:

Re: [0.10.9] Low FPS due to slow flip

Post by jazha »

It seems much better on my end aswell, I don't have the time to test properly, but I haven't had any really noticeable slowdowns with the latest version. Will play more with it when I get the spare time to do so :)
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.10.9] Low FPS due to slow flip

Post by kovarex »

Well, this seems like magic, but ok.
By the way, this "might" be affected by the selection of default video adapter, anyway I'm moving this to resolved then.
Okami
Inserter
Inserter
Posts: 26
Joined: Fri May 02, 2014 7:58 am
Contact:

Re: [0.10.9] Low FPS due to slow flip

Post by Okami »

Work better on my End aswell.

Now the Game runs faster, but with tearing of course without VSync.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.10.9] Low FPS due to slow flip

Post by kovarex »

Well, this means it still isn't solved, could you post screenshots of the time spent in flip when the option is on and off?
User avatar
pyrolytic_tungsten
Fast Inserter
Fast Inserter
Posts: 115
Joined: Fri Aug 01, 2014 4:29 am
Contact:

Re: [0.10.9] Low FPS due to slow flip

Post by pyrolytic_tungsten »

It turns out that during my previous tests the forest didn't want to give me low fps with vsync enabled. I had been mostly running with vsync off since my initial tests so I didn't see it. I saw that happen today. Disabling vsync causes the low fps to go away. I don't know why it didn't give me low fps in my earlier testing. It is erratic since I can find an area that gives low fps, save, disable vsync, restart Factorio, see it works fine, enable vsync, close Factorio, see the config has "v-sync=true", start Factorio, and it still works fine. I haven't seen any tearing with vsync disabled. Perhaps it's something weird about my linux/Xorg/proprietary Nvidia drivers/geforce 240/configurations/CRT monitor. I'll try and grab some screenshots next time.
Post Reply

Return to “Resolved Problems and Bugs”