Page 1 of 1
[0.18.10][0.17.79] Huge purely Clientside Lagspike when placing large Blueprints, that can kick you from Servers
Posted: Sat Mar 14, 2020 11:11 am
by GregoriusT
When placing down Blueprints or even just have the Tile-Brush at max size with a couple of Modded Player Reach Upgrades, the Game will lag Clientside for everyone who looks at the location which has those Tiles placed down to the point that weaker Machines get kicked from the Server, while Players that dont look at the 10k Slab of Concrete being ghosted onto the ground have no Issues whatsoever.
This means that something that does not affect the Serverside Game and only happens Onscreen lags the Game so much (a whole Minute for a simple 10k Concrete Slab covering a small 100x100 Area) that you just cant catch up.
The only explanation I can have for this Issue is the insane amount of Sound Effect Spam that is happening, as that is Clientside, Onscreen and there is no Particle Effects when placing Ghosts.
Also the Tile Brush Lag-stutters massively when placing down anything slightly large (depending on amount of placed Tiles), even if it is not Ghosts. I highly suspect that has the same cause.
This Lag Issue is independent of Save File, used Mods and the two Factorio capable pieces of Hardware I own, and I am not able to take a Screenshot of the Debug Screen during that spike as I cannot nail down the fraction of a second timing I would need to do that.
As a fix I would suggest just having the same Sound Effect limited to like a dozen instances of itself per update, which should not change the satisfying perception of "multi-plonk-noise" when placing down a large amount of things, while preventing huge Lagspikes when the Sound Engine is composing the output for that one tick.
Re: [0.18.10][0.17.79] Huge purely Clientside Lagspike when placing large Blueprints, that can kick you from Servers
Posted: Sat Mar 14, 2020 12:14 pm
by Klonan
GregoriusT wrote: Sat Mar 14, 2020 11:11 am
When placing down Blueprints or even just have the Tile-Brush at max size with a couple of Modded Player Reach Upgrades, the Game will lag Clientside for everyone who looks at the location which has those Tiles placed down to the point that weaker Machines get kicked from the Server, while Players that dont look at the 10k Slab of Concrete being ghosted onto the ground have no Issues whatsoever.
This means that something that does not affect the Serverside Game and only happens Onscreen lags the Game so much (a whole Minute for a simple 10k Concrete Slab covering a small 100x100 Area) that you just cant catch up.
The only explanation I can have for this Issue is the insane amount of Sound Effect Spam that is happening, as that is Clientside, Onscreen and there is no Particle Effects when placing Ghosts.
Also the Tile Brush Lag-stutters massively when placing down anything slightly large (depending on amount of placed Tiles), even if it is not Ghosts. I highly suspect that has the same cause.
This Lag Issue is independent of Save File, used Mods and the two Factorio capable pieces of Hardware I own, and I am not able to take a Screenshot of the Debug Screen during that spike as I cannot nail down the fraction of a second timing I would need to do that.
As a fix I would suggest just having the same Sound Effect limited to like a dozen instances of itself per update, which should not change the satisfying perception of "multi-plonk-noise" when placing down a large amount of things, while preventing huge Lagspikes when the Sound Engine is composing the output for that one tick.
Mods can have a major impact, depending on what events they are hooking and what logic is being performed
Can you provide a save game with all your mods installed (So we can sync mods with save)
The sound doesn't really make a difference
Re: [0.18.10][0.17.79] Huge purely Clientside Lagspike when placing large Blueprints, that can kick you from Servers
Posted: Sat Mar 14, 2020 12:50 pm
by GregoriusT
The reason I said it doesn't make a difference to have Mods, is that it happens in pure vanilla too. The more objects are placed at the very same moment, the more massive the Lag Spike is. All I need to do to cause such a huge spike is have a Blueprint with about 10k Concrete or more in it and place it down, that is literally all and can be achieved in a new empty and vanilla Game.
Sure I do not have the most powerful of Computers, but having large amounts of placement Lag like this is quite irritating when you wanna Concretify your Base or do a City Blocks like Base.
Gimme a bit to make a Vanilla Save File where I replicate it yet again. I will add a fitting Concrete Slab Blueprint into it's Game Blueprints too. There really needs to be a better way to select Factorio Instances than moving and renaming the .factorio Folder in my Home Directory.
Re: [0.18.10][0.17.79] Huge purely Clientside Lagspike when placing large Blueprints, that can kick you from Servers
Posted: Sat Mar 14, 2020 1:12 pm
by GregoriusT
"Ribbonworld Test" is Vanilla, "Modded 5" is the modded one just in case and ofcourse the Mod List. Both do cause a spike for me, though the modded one does seem to cause a slightly worse spike, so I guess you were right with the hook, or maybe its just the modded World mostly running at 43 UPS because Biters.
If anything I would just like to know how I can mitigate the Lag Spike, so I have to wait less. ^^
Edit: WTF the Forums did not upload my Save Files...
Edit 2: I guess 16.4MB and 18.4MB are too much...
Edit 3: Okay while I wrote this post originally I just had to see if that weird mechanic the AAI Mods have with Biters causes the stuttering lagspikes to get worse, and yes indeed it did cause it to get worse. It is still stuttery without it though, to the point I just cant drag it around in the map view without leaving Gaps, unless I make the brush ginormous, which is not always wanted.
Re: [0.18.10][0.17.79] Huge purely Clientside Lagspike when placing large Blueprints, that can kick you from Servers
Posted: Sat Mar 14, 2020 3:02 pm
by Rseding91
Please upload the save to dropbox, google drive, one-drive, or any other hosting website.
I doubt there's anything to actually "fix" here. Dragging around a 10k tile blueprint in is going to be a big performance hog because of how huge the blueprint is. Mods will make that worse, and MP will make it worse still.
There's nothing to "fix" about that except don't drag around a blueprint with 10,000 tiles that you're trying to build each tick.
Re: [0.18.10][0.17.79] Huge purely Clientside Lagspike when placing large Blueprints, that can kick you from Servers
Posted: Sat Mar 14, 2020 3:09 pm
by GregoriusT
Sorry that I said it misunderstandingly, even a single click with that large Blueprint lags, if dragging was the Issue I would have just clicked less often and actually aimed better. Edit: The dragging was just the regular Brush sized up to 15x15 or so.
And the Lag is directly proportional to the amount of placed tiles, not to the coverage of the Blueprint. so if I only move it one tile up and click again the resulting row will lag far less.
Ah right I constantly forget Google Drive is a thing I have.
https://drive.google.com/open?id=1dWPrX ... XR70VPrqot
https://drive.google.com/open?id=1-RFLP ... DrHMNguzfx
Re: [0.18.10][0.17.79] Huge purely Clientside Lagspike when placing large Blueprints, that can kick you from Servers
Posted: Sat Mar 14, 2020 3:40 pm
by Rseding91
I checked out the save file and there's nothing going wrong. The mod(s) you're using are just super inefficient; they're doing entity searches for every built entity and that just dominates the time spent during the player-built-entity event.
If you disable all of them, I can build 13k tile blueprints with zero impact on performance.
Re: [0.18.10][0.17.79] Huge purely Clientside Lagspike when placing large Blueprints, that can kick you from Servers
Posted: Sat Mar 14, 2020 3:48 pm
by GregoriusT
I mainly reported this spike due to having the same issue in vanilla too, dont forget about that. It is a bit less pronounced in vanilla, but it still exists and is noticeable, though that vanilla test was made on a 1.1GHz Quadcore without dedicated Graphics Card. I use my 1.8GHz Laptop with dedicated Graphics Card only when doing Multiplayer, because it is a hassle to use and has a slow Hard Drive as opposed to an SSD.
I'm glad that I did notice that the AAI Stuffs was to blame for the majority of the spike midway through this Report, so I can consider this Issue as "solved enough to use Tiles in general", it just irks me when there is even the tiniest Issue on this otherwise 98% perfect game. ^^
Re: [0.18.10][0.17.79] Huge purely Clientside Lagspike when placing large Blueprints, that can kick you from Servers
Posted: Sat Mar 14, 2020 4:15 pm
by Rseding91
There's really not anything that can be done. 10,000 entities all being allocated, linked into the world, collision checks, tile checks, overlap checks, event dispatching, registering into the to-be-built list, setting the last-user on them. It all happens in a fraction of a second without mods; I can't measure any performance loss when I test (without the mods).
It's already as fast as it can be. You just need to realize you're building 10,000 things at once and that has some impact.
You know how it is if you tried to do even 1000 at once in Minecraft

Even *1* thing has frame drops and lag spikes if you build them at the right spot in Minecraft due to lighting updates.
Re: [0.18.10][0.17.79] Huge purely Clientside Lagspike when placing large Blueprints, that can kick you from Servers
Posted: Sat Mar 14, 2020 4:30 pm
by GregoriusT
Hehe, yep MC has quite some lag in that. The only way to avoid it is to directly edit the Chunks, and that is something you can only really do during Worldgen to save on performance. Though an Octree instead of Chunks could fix that one quite easily, especially for setting multiple identical Blocks in a connected Area.
Btw the other minor Issues I have with Factorio are things people could easily mod in if they were important (and therefore I would not "actually" report), like a Pumpjack that has a centered Output, or at the very least rotational symmetry, or an omni-directional throughput like a 4-way Pipe on the Pumpjack.

Re: [0.18.10][0.17.79] Huge purely Clientside Lagspike when placing large Blueprints, that can kick you from Servers
Posted: Sun Mar 15, 2020 4:30 pm
by posila
GregoriusT wrote: Sat Mar 14, 2020 11:11 am
When placing down Blueprints or even just have the Tile-Brush at max size with a couple of Modded Player Reach Upgrades, the Game will lag Clientside for everyone who looks at the location which has those Tiles placed down to the point that weaker Machines get kicked from the Server, while Players that dont look at the 10k Slab of Concrete being ghosted onto the ground have no Issues whatsoever.
So this can't be caused by mods/scenario, because mods or scenario run same logic for everyone regardless of who sees what. My first thought is that it is caused by latency state, in which creation of every ghost will be simulated each tick until the action becomes part of the game state (= is received by the server and the server sends it back to client) and in addition to that, all entities in latency state are rendered by single and to add salt to the injury it's that was last to finish rendering (so by the slowest thread). But, this would be problem only to the one client that is placing the blueprint (not everybody who sees it being placed), thought.
Just my 2 cents. Not something I would think that needs to be improved at the moment.
Re: [0.18.10][0.17.79] Huge purely Clientside Lagspike when placing large Blueprints, that can kick you from Servers
Posted: Sun Mar 15, 2020 6:04 pm
by Rseding91
posila wrote: Sun Mar 15, 2020 4:30 pm
GregoriusT wrote: Sat Mar 14, 2020 11:11 am
When placing down Blueprints or even just have the Tile-Brush at max size with a couple of Modded Player Reach Upgrades, the Game will lag Clientside for everyone who looks at the location which has those Tiles placed down to the point that weaker Machines get kicked from the Server, while Players that dont look at the 10k Slab of Concrete being ghosted onto the ground have no Issues whatsoever.
So this can't be caused by mods/scenario, because mods or scenario run same logic for everyone regardless of who sees what. My first thought is that it is caused by latency state, in which creation of every ghost will be simulated each tick until the action becomes part of the game state (= is received by the server and the server sends it back to client) and in addition to that, all entities in latency state are rendered by single and to add salt to the injury it's that was last to finish rendering (so by the slowest thread). But, this would be problem only to the one client that is placing the blueprint (not everybody who sees it being placed), thought.
Just my 2 cents. Not something I would think that needs to be improved at the moment.
The latency system doesn't do blueprints over 300 entities because of that exact issue.
Re: [0.18.10][0.17.79] Huge purely Clientside Lagspike when placing large Blueprints, that can kick you from Servers
Posted: Sun Mar 15, 2020 6:15 pm
by posila
Rseding91 wrote: Sun Mar 15, 2020 6:04 pmThe latency system doesn't do blueprints over 300 entities because of that exact issue.
Ah, I didn't know that. Thanks.
Re: [0.18.10][0.17.79] Huge purely Clientside Lagspike when placing large Blueprints, that can kick you from Servers
Posted: Sun Mar 15, 2020 7:09 pm
by GregoriusT
Rseding91 wrote: Sun Mar 15, 2020 6:04 pm
The latency system doesn't do blueprints over 300 entities because of that exact issue.
Quick curious question: Does the Tile Brush count as Blueprint?
Re: [0.18.10][0.17.79] Huge purely Clientside Lagspike when placing large Blueprints, that can kick you from Servers
Posted: Sun Mar 15, 2020 7:15 pm
by Rseding91
GregoriusT wrote: Sun Mar 15, 2020 7:09 pm
Rseding91 wrote: Sun Mar 15, 2020 6:04 pm
The latency system doesn't do blueprints over 300 entities because of that exact issue.
Quick curious question: Does the Tile Brush count as Blueprint?
You mean in the map editor?
Re: [0.18.10][0.17.79] Huge purely Clientside Lagspike when placing large Blueprints, that can kick you from Servers
Posted: Sun Mar 15, 2020 8:02 pm
by GregoriusT
No I mean when placing Concrete or Landfill. There is no ingame name for it so that's why I called it Tile Brush.