Faster startup (e.g. for iterating on mod code)
Posted: Sun Dec 18, 2016 10:05 pm
While getting my head around the modding functionality of Factorio, I couldn't help but notice just how punishing a full restart of the game can be even with an SSD, so I had a look to see if there were any options that would speed things up (e.g. lowering texture quality etc.).
I can't remember if tree mipmaps and/or trilinear filtering are on by default, but for me these two options add a significant amount of time to the time taken between creating the atlas and moving onto loading sounds:
I also noticed there's a "cache-sprite-atlas" setting in config.ini. While I imagine this setting is unhelpful if you're changing the artwork, enabling it can significantly speed up the time it takes to start Factorio when combined with disabling both those features.
With these changes combined, i.e.: the game takes significantly less time to reach the "loading sounds" stage:
This is after several runs with each setting, the first time after changing the settings you'll probably see it take longer to start because the game has to build the cached data.
Also having a e.g. sandbox save that you can auto-load by passing "--load-game yoursandbox" on the command line also helps from a workflow perspective since all the loading/waiting happens up front rather than having to explicitly click through the main menu each and every time.
One final startup "optimisation" I made was to replace all oggs in data\base with a short, silent file.
Before:
After:
Obviously I recommend you make a separate "development" install of standalone Factorio - the standalone version uses completely separate config/save/etc. directories which is perfect for these sorts of potentially destabilising changes that you don't want in your proper install.
I can't remember if tree mipmaps and/or trilinear filtering are on by default, but for me these two options add a significant amount of time to the time taken between creating the atlas and moving onto loading sounds:
Code: Select all
1.318 Initial atlas bitmap size is 16384
1.320 Created atlas bitmap 16384x5589
1.320 Created atlas bitmap 4096x968
1.320 Created atlas bitmap 4096x3652
19.545 Sprites loaded
19.546 Convert atlas 4096x968 to: trilinear-filtering
19.584 Convert atlas 4096x3652 to: mipmap
20.249 Loading sounds...
With these changes combined, i.e.:
Code: Select all
cache-sprite-atlas=true
tree-sprite-mipmaps=false
trilinear-filtering=false
Code: Select all
1.291 Initial atlas bitmap size is 16384
1.295 Created atlas bitmap 16384x9492
2.506 Atlases loaded from disk cache.
2.703 Sprites loaded
3.391 Loading sounds...
Also having a e.g. sandbox save that you can auto-load by passing "--load-game yoursandbox" on the command line also helps from a workflow perspective since all the loading/waiting happens up front rather than having to explicitly click through the main menu each and every time.
One final startup "optimisation" I made was to replace all oggs in data\base with a short, silent file.
Before:
Code: Select all
3.389 Loading sounds...
5.699 Custom inputs active: 0
Code: Select all
3.403 Loading sounds...
4.037 Custom inputs active: 0