Whenever I move the mouse (higher speeds yield ~20ms) the Chart Refresh value goes up to 16-19ms and the game drops down to 2-5 FPS. After stopping the mouse movement the client begins to catch up (without showing any messages) and it takes up to ~30s to return to normal speeds (you can't reliably open inventory or move the character during that period). Based on the F4 timings, the script time slightly drops while the Chart Refresh is high. All this is seen on the map we're playing on.
I've tested that map in Singleplayer - the issue persists but it's less noticeable because it simply feels like the whole game is slowing down.
Changing the game.speed to 0.5-0.8 doesn't help, just at 0.2 the lag is less noticeable because each frame has more time to compute. Furthermore, I managed to get up to 22-25ms Chart Refresh with game.speed=0.2
Testing a fresh map without mods: When you start to move the mouse rapidly you can see a small increase in Chart Refresh value (from ~0.003 to ~0.009). Looks like the same negative effect is amplified for huge bases/mods. Sadly, I do not have a Vanilla map to try it out.
Also, the slowdown is still caused if the Factorio window is NOT active, but there's NO SLOWDOWN when the character is moving and the mouse is still. Hovering over the toolbar has the same effect, having no items in inventory (including armor) doesn't help.
Hence 2 questions:
1) Is it caused by installed mods (although none of the script timings are reliably increased while moving the mouse); if so, what exactly to look for? (I know Lua)
2) Is it caused by Factorio itself and is there any way to reduce the impact?
Factorio version: 0.15.25
Server CPU: i7-3770 @ 3.4 GHz
PC CPU: Ryzen 7 1700 @ 3.8 GHz
- I have the map saved if you want to try it out
Mod List