[posila][16.3] Low FPS in 4K (4GB VRAM)

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
ScaryBuh
Inserter
Inserter
Posts: 26
Joined: Mon Jun 27, 2016 11:45 pm
Contact:

[posila][16.3] Low FPS in 4K (4GB VRAM)

Post by ScaryBuh »

What happens: Low Fps (15-17) when the screen is all zoomed out and player is near a dense forest zone
What was expected: FPS at 60

My machine is
i7-3770k
ram 16GB
windows 10 64bit
Nvidia 970
running at 4k resolution

I fiddle with the settings on graphics and here are some images showing the problem,
Just so there isn't confusion, each screenshot is taken with the actual settings active. I already had restarted factorio so the setting is in effect.

Here is the game a bit slow and unplayable because of the low frame rate, with focus on this settings (because it's the ones I'm using for comparison)
- Decoratives ON
- Tree sprites ON
- Video memory usage ALL
- Atlas texture size LargestPossible
1 decoratives ON, Tree sprites ON, video ALL, atlas LargestProssible, FPS at 16.jpg
1 decoratives ON, Tree sprites ON, video ALL, atlas LargestProssible, FPS at 16.jpg (4.19 MiB) Viewed 2778 times
By turning off Decoratives it no longer fixes the problem of FPS (that was another bug) let's focus on what's going on here, it's about the trees.
So it still lags with frame rate around 17.
- Decoratives OFF
- Tree sprites ON
- Video memory usage ALL
- Atlas texture size LargestPossible
2 decoratives OFF, Tree sprites ON, video All, atlas LargestProssible, FPS at 17.jpg
2 decoratives OFF, Tree sprites ON, video All, atlas LargestProssible, FPS at 17.jpg (4.01 MiB) Viewed 2778 times
By turning tree sprites OFF I get 60fps.
- Decoratives ON
- Tree sprites Off
- Video memory usage ALL
- Atlas texture size LargestPossible
3 decoratives ON, Tree sprites OFF, video ALL, atlas LargestProssible, FPS at 60.jpg
3 decoratives ON, Tree sprites OFF, video ALL, atlas LargestProssible, FPS at 60.jpg (5.01 MiB) Viewed 2778 times
If I keep the tree sprites ON and lower atlas texture size, at 8192, there's still lag with 16 fps.
- Decoratives ON
- Tree sprites ON
- Video memory usage ALL
- Atlas texture size 8192
4 decoratives ON, Tree sprites ON, video ALL, atlas 8192, FPS at 16.jpg
4 decoratives ON, Tree sprites ON, video ALL, atlas 8192, FPS at 16.jpg (4.15 MiB) Viewed 2778 times
When I use atlas texture size 4096 the problem is gone. I do have more atlas maps (I can see them by pressing F3) but everything else is fine, FPS stable at 60
- Decoratives ON
- Tree sprites ON
- Video memory usage ALL
- Atlas texture size 4096
5 decoratives ON, Tree sprites ON, video ALL, atlas 4096, FPS at 60.jpg
5 decoratives ON, Tree sprites ON, video ALL, atlas 4096, FPS at 60.jpg (4.15 MiB) Viewed 2778 times
If I keep the atlas texture size at LargestPossible, I need to lower video settings to High to fix the low FPS problem
- Decoratives ON
- Tree sprites ON
- Video memory usage HIGH
- Atlas texture size LargestPossible
6 decoratives ON, Tree sprites ON, video HIGH, atlas LargestProssible, FPS at 60.jpg
6 decoratives ON, Tree sprites ON, video HIGH, atlas LargestProssible, FPS at 60.jpg (4.13 MiB) Viewed 2778 times


This bug is strongly related to this one I guess,
viewtopic.php?f=182&t=54694
because I had the same issue, low fps, in that case I could fix the FPS by turning off decoratives, now it's no longer the case, so the bug is similar, but different.

Here is the save
denseForestLags.zip
(2.11 MiB) Downloaded 62 times

User avatar
ScaryBuh
Inserter
Inserter
Posts: 26
Joined: Mon Jun 27, 2016 11:45 pm
Contact:

Re: [16.3] low fps when near dense forest

Post by ScaryBuh »

Just to make things more complicated:

I was on factorio forums for some 15 min reading stuff, with factorio game closed.
Decided to run factorio on that dense forest map, my settings were left at max,
- Decoratives ON
- Tree sprites ON
- Video memory usage ALL
- Atlas texture size LargestPossible
... and the fps were at 60fps with full zoom out. (no fps problem this time)

It's like sometimes I have that problem, sometimes not.
I'll keep attention if it's any run on background application... until then, any feedback? Does it happen to more people? I'm getting crazy here :oops:

User avatar
ScaryBuh
Inserter
Inserter
Posts: 26
Joined: Mon Jun 27, 2016 11:45 pm
Contact:

Re: [16.3] low fps when near dense forest

Post by ScaryBuh »

Got it again! I mean, the fps problem, which is totally undesirable but it proves I'm not lying or going mad.

this time I started factorio and went straight to new game, set Trees to high frequency and very big size, so I could get a fancy big forest near me.
It is at 30fps. It's not as bad as only 15fps, but it sure isn't good as 60fps.
30fps.jpg
30fps.jpg (3.96 MiB) Viewed 2765 times
Here's the log.
factorio-current.log
(18.12 KiB) Downloaded 88 times

User avatar
ScaryBuh
Inserter
Inserter
Posts: 26
Joined: Mon Jun 27, 2016 11:45 pm
Contact:

Re: [16.3] low fps when near dense forest

Post by ScaryBuh »

I restarted factorio, this time I went to load the dense forest map I shared before.

Settings are just like the first one, and it has 16fps.
- Decoratives ON
- Tree sprites ON
- Video memory usage ALL
- Atlas texture size LargestPossible
16fps on dense forest map.jpg
16fps on dense forest map.jpg (4.4 MiB) Viewed 2763 times
There's some instability here!
I know I can "hotfix" it by lowering video memory or atlas texture size.
Thing is... sometimes it works great with everything at max at 60fps.

log
factorio-current.log
(11.07 KiB) Downloaded 87 times

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [posila][16.3] Low FPS in 4K (4GB VRAM)

Post by posila »

Thanks for the thorough testing. I think I finally realized what is happening. We moved trees to separate atlas and enabled mipmaps on it some time ago, the reason for that was to decrease size of textures GPU has to sample when the view is zoomed out on large forrest. Problem is zoom 0.552 on 4K display shows much larger area as zoom 0.552 on FullHD display, and mipmaps seems to even hurt performance in this case.
I am buffled with why atlases of size 4096 perform much better than larger sizes on GPU with 4GB VRAM, my theory is that the driver fits smaller atlases to VRAM better than large ones due to memory fragmentation or possibly some limitations I don't know about. But this is why we exposed atlas size configuration to options (after having it for years in config.ini and as command line option)

Anyway ... I don't know how to make it better with our current rendering pipeline, but we plan to put lot of work into that for 0.17, so I'll say the current workaround is to tinker with options to find the configuration that works best for you. I'll add some explanation of the options to their tooltips and here on the forum.

Post Reply

Return to “Resolved Problems and Bugs”