Page 1 of 1

Why can't data/atlas caching not be turned on from the GUI?

Posted: Mon Nov 01, 2021 10:40 pm
by mrvn
In config/config.ini are three options that greatly speed up the startup time of factorio:

cache-prototype-data=true
cache-sprite-atlas-count=1
cache-sprite-atlas=true

Caching prototypes is marked experimental. The other two have no comment. I'm guessing that the cache-sprite-atlas-count is the number of old altases it keeps around so switching between 2 sets of mods will still have a cached atlas. And the default of 1 only keeps the current atlas.

Turning those options on has a huge impact on the startup time. Without caches:
...
0.225 [Audio] Backend:default; Depth:16, Channel:2, Frequency:44100; MixerQuality:linear
0.340 Data stage cache not used.
...
26.768 Prototype list checksum: 3457637422
27.359 Data stage cached in: 0.573571 seconds.
27.725 Loading sounds...
27.798 Info PlayerData.cpp:71: Local player-data.json available, timestamp 1635804730
27.799 Info PlayerData.cpp:78: Cloud player-data.json unavailable
28.048 Crop bitmaps.
28.048 Atlases were not loaded from disk cache.
28.885 Parallel Sprite Loader initialized (threads: 7)
...
53.919 Sprites loaded
55.023 Sprite atlas cached.
...
55.874 Factorio initialised
And with caches:
...
0.222 [Audio] Backend:default; Depth:16, Channel:2, Frequency:44100; MixerQuality:linear
0.712 Data stage cache loaded in: 0.346025 seconds.
...
1.296 Prototype list checksum: 3457637422
1.360 Loading sounds...
1.412 Info PlayerData.cpp:71: Local player-data.json available, timestamp 1635804802
1.412 Info PlayerData.cpp:78: Cloud player-data.json unavailable
1.649 Initial atlas bitmap size is 4096
...
5.210 Atlases loaded from disk cache.
5.228 Texture processor created (2048). GPU accelerated compression Supported: yes, Enabled: yes/yes. Test passed. YCoCgDXT PSNR: 35.83, BC3 PSNR: 33.82
5.343 Parallel Sprite Loader initialized (threads: 7)
7.153 Sprites loaded
...
7.512 Custom mipmaps uploaded.
7.617 Generated mipmaps for virtual atlas of size 8192x16384
7.633 Custom inputs active: 54
7.822 Factorio initialised
From nearly 56 seconds to under 8, more than 7 times faster every time you start factorio. Seems well worth it for anyone playing with large mods.

Now I wonder why the first option is still marked experimental? Why can't they be activated from the GUI? And how are they ever going to get more player testing if they are hidden away in config.ini?

Is there something I should look out for when using those options? Something more to report if I see odd things like timestamps or checksums of some cached files?

Re: Why can't data/atlas caching not be turned on from the GUI?

Posted: Tue Nov 02, 2021 6:45 am
by Koub
Actually, they're kind of accessible via a GUI, but ... a hidden one :
2021-11-02 07_40_55-Factorio 1.1.45.jpg
2021-11-02 07_40_55-Factorio 1.1.45.jpg (30.78 KiB) Viewed 1682 times
In the main menu, instead of clicking on Settings, click on [Ctrl]+[Alt]+[Settings], you'll have a new "The rest" submenu.

I guess the reason they're not accessible is because they may cause issues.

Re: Why can't data/atlas caching not be turned on from the GUI?

Posted: Tue Nov 02, 2021 7:31 pm
by mrvn
Can you elaborate a bit more on that?

Can I expect to get wrong prototype data because the cache not always detects then a mod has changed?
Some graphics not getting updated because the cache doesn't notice if a graphics file changes?

Or does the game become unstable?

Re: Why can't data/atlas caching not be turned on from the GUI?

Posted: Wed Nov 03, 2021 1:42 am
by DaveMcW
https://www.factorio.com/blog/post/fff-326 wrote:
The setting is still disabled by default because it's highly experimental, but if it ends up stable enough, we might turn it on by default.
Maybe ask Rseding if it's stable enough after 2 years.