[0.15.x] Severe lag and lag spike issues
-
- Inserter
- Posts: 37
- Joined: Sun Jul 17, 2016 9:05 pm
- Contact:
Re: [0.15.x] Severe lag and lag spike issues
Okay, I've checked out the save and Factorissimo is also a bit at fault, although that's easily fixed.
There are three important factors to your lag: Factorissimo, Vanilla Loaders, and something else.
Factorissimo uses 3-4 milliseconds per tick because you're using it wrong. Extremely fast belt connections to factory buildings are horrible for your UPS, because the faster the belt, the more often Factorissimo needs to check it for new items. Instead, use chest connections, set to transfer mode, and connected to the belts with loaders. This will shrink Factorissimo's processing time to basically nothing, because chest connections are updated very slowly and can be made to update even slower.
Vanilla Loaders has absolutely horrible code regarding transport to and from trains. Please change up all your train loading and unloading stations to not use loaders directly from trains. Put a chest buffer in between, filled with an express stack inserter or something, and attach the loaders to that.
Thirdly, the reason that your map is slower in multiplayer is that there is an absurd amount of CRC checking going on (that only needs to run in multiplayer because this is how the game tests for desyncs). Maybe it's because your map is just that large, maybe it's because there's some mod with a memory leak (it's not Factorissimo), maybe both. I don't know much about how Factorio does the CRCs.
There are three important factors to your lag: Factorissimo, Vanilla Loaders, and something else.
Factorissimo uses 3-4 milliseconds per tick because you're using it wrong. Extremely fast belt connections to factory buildings are horrible for your UPS, because the faster the belt, the more often Factorissimo needs to check it for new items. Instead, use chest connections, set to transfer mode, and connected to the belts with loaders. This will shrink Factorissimo's processing time to basically nothing, because chest connections are updated very slowly and can be made to update even slower.
Vanilla Loaders has absolutely horrible code regarding transport to and from trains. Please change up all your train loading and unloading stations to not use loaders directly from trains. Put a chest buffer in between, filled with an express stack inserter or something, and attach the loaders to that.
Thirdly, the reason that your map is slower in multiplayer is that there is an absurd amount of CRC checking going on (that only needs to run in multiplayer because this is how the game tests for desyncs). Maybe it's because your map is just that large, maybe it's because there's some mod with a memory leak (it's not Factorissimo), maybe both. I don't know much about how Factorio does the CRCs.
I don't visit the forum very often. If you want to contact me, message me on the mod portal for Factorissimo-related things, or on Discord.
Re: [0.15.x] Severe lag and lag spike issues
Can you upload your save file and mods? 8 MS for CRC is insane.xBlizzDevious wrote:I would note that even on SP I'm running sub 60 FPS/UPS, hovering around 45-50. Local MP is about 30.orzelek wrote:If looking at stats game processing is below 13ms and UPS/FPS starts dropping then it might be something to investigate for devs.
Especially that it's a difference between single and multiplayer.
If detailed timings show that Factorissimo2 is using more script time in multiplayer then single that might be something for mod author to look at.
Both of those cases seem complicated
Not exactly scientific testing, but I opened the game up in local multiplayer, showed time-usage and then waited ten seconds and took a screenshot.
Then I saved, exited and loaded the game up as single player, waited ten seconds and took a screenshot. Here are the results:
SP:
Local MP:
Not exactly sure what I'm looking for, but I can see that there's a 30% drop in performance when you load MP.
If you want to get ahold of me I'm almost always on Discord.
Re: [0.15.x] Severe lag and lag spike issues
xBlizzDevious wrote:I've just uploaded the save and all mods to the bug reports forum as I was having another bug. viewtopic.php?f=7&t=47735&p=275371#p275371
You can use the files attached there to test. Simply load in single player, see how smooth it runs, then load in local multiplayer and see how much worse it runs. Remove Factorissimo2 and load local MP again and it's running much more smoothly. There is always the fact that there are several hundred furnaces running inside those factories that disappeared but I don't think they'd cause a 30% performance drop. Thanks for looking into it.
Additionaly there is a loader re-write in the works that is slightly better, but loaders where never designed to work with trains so lots of loaders and lots of trains is still a bad combination.
-
- Fast Inserter
- Posts: 108
- Joined: Mon Feb 02, 2015 10:15 pm
- Contact:
Re: [0.15.x] Severe lag and lag spike issues
Sounds useful. Is there a better loaders mod around (that I can hack green and purple versions in) or is the rest of the code fine and I just need to not use them at stations?Nexela wrote:-snip-
Additionaly there is a loader re-write in the works that is slightly better, but loaders where never designed to work with trains so lots of loaders and lots of trains is still a bad combination.
OP of this thread has them: viewtopic.php?f=7&t=47735&p=275371#p275371Rseding91 wrote:-snip-
Can you upload your save file and mods? 8 MS for CRC is insane.
Just don't switch on that combinator in the preview picture!
The lag was an issue before I installed loaders and so when I got around to installing loaders, I didn't think to update the factories with them. I haven't touched those factories for quite some time, actually. Good to know that I've helped you find a minor issue!MagmaMcFry wrote:Okay, I've checked out the save and Factorissimo is also a bit at fault, although that's easily fixed.
There are three important factors to your lag: Factorissimo, Vanilla Loaders, and something else.
Factorissimo uses 3-4 milliseconds per tick because you're using it wrong. Extremely fast belt connections to factory buildings are horrible for your UPS, because the faster the belt, the more often Factorissimo needs to check it for new items. Instead, use chest connections, set to transfer mode, and connected to the belts with loaders. This will shrink Factorissimo's processing time to basically nothing, because chest connections are updated very slowly and can be made to update even slower.
Vanilla Loaders has absolutely horrible code regarding transport to and from trains. Please change up all your train loading and unloading stations to not use loaders directly from trains. Put a chest buffer in between, filled with an express stack inserter or something, and attach the loaders to that.
Thirdly, the reason that your map is slower in multiplayer is that there is an absurd amount of CRC checking going on (that only needs to run in multiplayer because this is how the game tests for desyncs). Maybe it's because your map is just that large, maybe it's because there's some mod with a memory leak (it's not Factorissimo), maybe both. I don't know much about how Factorio does the CRCs.
1. Shame that I can't run things this way, but then I do have to cope with the limitations.
2. Also a shame, but I can sort that. I was using Burny's Station Blueprint Creator or whatever it was called so I'll just go back to that.
3. Hopefully Rseding91 can figure that out. I'm guessing it's a mod at fault.
-
- Fast Inserter
- Posts: 108
- Joined: Mon Feb 02, 2015 10:15 pm
- Contact:
Re: [0.15.x] Severe lag and lag spike issues
Had any luck figuring this out?Rseding91 wrote:-snip-
-
- Fast Inserter
- Posts: 108
- Joined: Mon Feb 02, 2015 10:15 pm
- Contact:
Re: [0.15.x] Severe lag and lag spike issues
I have info to add:
My friend and I were working on the server to sort out the factory buildings and transition them to chests, however, ended up deciding that we would just build a large layout furnace setup in the open world.
Since 0.15.13 just came out, I updated several mods and decided that Factorissimo2 didn't need to be in the list anymore. Simply by removing Factorissimo2 from the game, that CRC figure went from 8-9.5ms down to 3-4ms.
I can't guarantee that the update to 0.15.13 did or did not have anything to do with it, but I was lagging before the crashes caused by other mods and now the game is flawless. @MagmaMcFry any ideas? Would you like a new copy of the save?
My friend and I were working on the server to sort out the factory buildings and transition them to chests, however, ended up deciding that we would just build a large layout furnace setup in the open world.
Since 0.15.13 just came out, I updated several mods and decided that Factorissimo2 didn't need to be in the list anymore. Simply by removing Factorissimo2 from the game, that CRC figure went from 8-9.5ms down to 3-4ms.
I can't guarantee that the update to 0.15.13 did or did not have anything to do with it, but I was lagging before the crashes caused by other mods and now the game is flawless. @MagmaMcFry any ideas? Would you like a new copy of the save?
-
- Inserter
- Posts: 37
- Joined: Sun Jul 17, 2016 9:05 pm
- Contact:
Re: [0.15.x] Severe lag and lag spike issues
Now that's weird. I did try disabling all mods except Factorissimo and the mod that added the faster belts when I messed with your old save, and the CRC went down from 10ms to ~0.5 ms, so I thought Factorissimo couldn't be causing all those CRC checks.
I don't visit the forum very often. If you want to contact me, message me on the mod portal for Factorissimo-related things, or on Discord.
-
- Fast Inserter
- Posts: 108
- Joined: Mon Feb 02, 2015 10:15 pm
- Contact:
Re: [0.15.x] Severe lag and lag spike issues
Interesting. The faster belts is just Bob's Logistics that I've removed all the other stuff from and tweaked a couple of little things. Unless belts cause that CRC thing to go up, I wouldn't see that being the cause.MagmaMcFry wrote:Now that's weird. I did try disabling all mods except Factorissimo and the mod that added the faster belts when I messed with your old save, and the CRC went down from 10ms to ~0.5 ms, so I thought Factorissimo couldn't be causing all those CRC checks.
Either way, here's a new copy if you're wanting to check it out.
- Attachments
-
- xBlizzServersMP.zip
- Save file
- (48.56 MiB) Downloaded 141 times
-
- Factorio0.15.13-Mods.rar
- Winrar 5 archive of mods
- (124.38 MiB) Downloaded 126 times
Re: [0.15.x] Severe lag and lag spike issues
The CRC time is spent saving electric network info last-value from each electric network that exists in the game. Because you're using a mod that makes a ton of isolated electric networks that means it spends a ton of time going over all the different networks.
Looking at it as well, Factorissimo and vanilla loaders appear to be calling get_transport_line *way* too often instead of just caching the transport lines once and re-using them. That could save a ton of time as well.
Virtually every object gotten back from the game can be cached and saved - transport lines are no exception.
Looking at it as well, Factorissimo and vanilla loaders appear to be calling get_transport_line *way* too often instead of just caching the transport lines once and re-using them. That could save a ton of time as well.
Virtually every object gotten back from the game can be cached and saved - transport lines are no exception.
If you want to get ahold of me I'm almost always on Discord.
-
- Fast Inserter
- Posts: 108
- Joined: Mon Feb 02, 2015 10:15 pm
- Contact:
Re: [0.15.x] Severe lag and lag spike issues
Rseding91 wrote:The CRC time is spent saving electric network info last-value from each electric network that exists in the game. Because you're using a mod that makes a ton of isolated electric networks that means it spends a ton of time going over all the different networks.
Looking at it as well, Factorissimo and vanilla loaders appear to be calling get_transport_line *way* too often instead of just caching the transport lines once and re-using them. That could save a ton of time as well.
Virtually every object gotten back from the game can be cached and saved - transport lines are no exception.
Good to know. Thanks for looking into it.
Which mod is it that's creating all of the electric networks? Other than Factorissimo (which is now gone) I haven't got anything else - as far as I'm aware - that adds separate networks.
I'd also note that Vanilla Loaders is now gone - I've replaced it with Loaders Redux. I don't know how the code works so the "get_transport_line" bit is unknown to me but that'll be useful for the modders who do know.
Re: [0.15.x] Severe lag and lag spike issues
I'm also FPS having issues with multi-mods including Factorissimo2... almost every connection is either through chests or pipes... but I think we have a lot of recursion... did we break the mod?
Right now I have to pause the game, then once I unpause I get about two seconds before unplayability sets back in and I have to repause to do any more.
Incidentally, we only have one active train and it's using pumps not loaders, though there is a station under construction with 42 loaders but it isn't running yet.
Is this all I need to send or is there more? (I'm playing latest stable on Steam.)
Right now I have to pause the game, then once I unpause I get about two seconds before unplayability sets back in and I have to repause to do any more.
Incidentally, we only have one active train and it's using pumps not loaders, though there is a station under construction with 42 loaders but it isn't running yet.
Is this all I need to send or is there more? (I'm playing latest stable on Steam.)
- Attachments
-
- Factorio mods.7z
- (121.97 MiB) Downloaded 115 times
-
- 20171009 cant keep up.zip
- (12.46 MiB) Downloaded 107 times
-
- Factorio screenshot.png (3.33 MiB) Viewed 5485 times
Re: [0.15.x] Severe lag and lag spike issues
That is the standard client too slow for server issue, see performance issue section in local FAQ.wolfling wrote:I'm also FPS having issues with multi-mods including Factorissimo2...