[Genhis/Rseding] Endgame trip to Shattered Planet is incredibly laggy

This subforum contains all the issues which we already resolved.
eternialogic
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Oct 31, 2024 4:13 am
Contact:

[Genhis/Rseding] Endgame trip to Shattered Planet is incredibly laggy

Post by eternialogic »

When you blow up asteroids, they become several chunks, this slows the game down to 47 fps for good computers and servers down to a solid 30 UPS.

Many players are unable to connect and several seem to run 5 ups/fps even in Nauvis when we started this trip.

Server UPS measured using the assembler time recipe method is 33 UPS.

A possible fix is to combine asteroid chunks into stacks like in minecraft, auto-stack items together.


Logs and save file attached
Save file:
https://drive.google.com/file/d/1_JN-KC ... sp=sharing

Image
10-31-2024, 00-19-53.png
10-31-2024, 00-19-53.png (3.67 MiB) Viewed 6470 times
10-31-2024, 00-41-46.png
10-31-2024, 00-41-46.png (3.69 MiB) Viewed 6469 times
Attachments
factorio-current.log
(52.02 KiB) Downloaded 25 times
computeraddict
Fast Inserter
Fast Inserter
Posts: 223
Joined: Sat Oct 07, 2023 6:44 am
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by computeraddict »

...are those emergency land mines on your space ship?!
eternialogic
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Oct 31, 2024 4:13 am
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by eternialogic »

they are a cheap way to get rid of small and medium asteroids. Useless against huge asteroids.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14594
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by Rseding91 »

Thanks for the report however this is not a bug. Nothing here is crashing, erroring, or not working how it's supposed to. While yes, the platform is taking a decent amount of update time - it's entirely pointless to fly head-first towards the shattered planet and ignore 99.99% of the chunks along the way. The platform could have turned back long ago given it's not doing anything useful.
If you want to get ahold of me I'm almost always on Discord.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14594
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by Rseding91 »

As a side note, I did find a slight improvement for asteroid chunk performance. For the next release they're roughly 29% faster.
If you want to get ahold of me I'm almost always on Discord.
gujarat6
Inserter
Inserter
Posts: 31
Joined: Wed Apr 08, 2020 4:53 pm
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by gujarat6 »

Rseding91 wrote: Thu Oct 31, 2024 12:38 pm Thanks for the report however this is not a bug. Nothing here is crashing, erroring, or not working how it's supposed to. While yes, the platform is taking a decent amount of update time - it's entirely pointless to fly head-first towards the shattered planet and ignore 99.99% of the chunks along the way. The platform could have turned back long ago given it's not doing anything useful.
This is a problem a lot sooner than you think. There are many more chunks apart from the Promethium and the game just starts lagging. Funny you say that a part of the game which makes the game much less playable is not a bug. I know it's not a bug, this is by design, but if it makes the game unplayable then it should be changed/optimized.

I attach a lot smaller setup than the authors of this post, which is also dropping below 60 UPS on dedicated server.
chunks.png
chunks.png (4.26 MiB) Viewed 4033 times
gujarat6
Inserter
Inserter
Posts: 31
Joined: Wed Apr 08, 2020 4:53 pm
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by gujarat6 »

Someone even created a mod, released 4 hours ago, for this exact problem. Just a confirmation this issue is still relevant.
https://mods.factorio.com/mod/UPS_Frien ... rom=search
Rseding91
Factorio Staff
Factorio Staff
Posts: 14594
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by Rseding91 »

There’s nothing else to do here. There have already been several rounds of optimizations for asteroids, asteroid chunk, and overall platform performance. When an opportunity shows up to improve on we do and already did.

No matter how much we optimize things you can just copy paste and build twice as much in an instant - you will always hit the limit of what hardware can do.
If you want to get ahold of me I'm almost always on Discord.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14594
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by Rseding91 »

gujarat6 wrote: Wed Nov 27, 2024 12:29 pm Someone even created a mod, released 4 hours ago, for this exact problem. Just a confirmation this issue is still relevant.
https://mods.factorio.com/mod/UPS_Frien ... rom=search
This mod makes no sense as it shows projectile performance when asteroid chunks do not interact with projectiles in any way. Also it’s showing the explosion entity as taking any amount of time which indicates to me the mod developer has a very low end PC.
If you want to get ahold of me I'm almost always on Discord.
Genhis
Factorio Staff
Factorio Staff
Posts: 709
Joined: Wed Dec 24, 2014 8:19 am
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by Genhis »

I managed to further improve asteroid chunk update performance of the attached save file by 35% (0.8 ms overall on my machine).
Rseding91
Factorio Staff
Factorio Staff
Posts: 14594
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by Rseding91 »

I also found an optimization related to asteroid chunk creation where asteroid collectors were doing several O(N) checks which got simplified to near O(1). It reduced projectile impact cost from 3.5~ MS/tick to 0.4 MS/tick in the example save I was testing with.
If you want to get ahold of me I'm almost always on Discord.
gujarat6
Inserter
Inserter
Posts: 31
Joined: Wed Apr 08, 2020 4:53 pm
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by gujarat6 »

When running like a bigger ship to shattered and a couple of smaller ones I'm seeing asteroid collectors going up to 5 entity update on a 5950X. Seems a bit much, but only you can tell me if it's possible to do anything about that.
Genhis
Factorio Staff
Factorio Staff
Posts: 709
Joined: Wed Dec 24, 2014 8:19 am
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by Genhis »

gujarat6 wrote: Tue Dec 03, 2024 10:57 pm When running like a bigger ship to shattered and a couple of smaller ones I'm seeing asteroid collectors going up to 5 entity update on a 5950X. Seems a bit much, but only you can tell me if it's possible to do anything about that.
It's always useful to share such save files even if we couldn't do anything about it.
gujarat6
Inserter
Inserter
Posts: 31
Joined: Wed Apr 08, 2020 4:53 pm
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by gujarat6 »

Genhis wrote: Wed Dec 04, 2024 9:18 am
gujarat6 wrote: Tue Dec 03, 2024 10:57 pm When running like a bigger ship to shattered and a couple of smaller ones I'm seeing asteroid collectors going up to 5 entity update on a 5950X. Seems a bit much, but only you can tell me if it's possible to do anything about that.
It's always useful to share such save files even if we couldn't do anything about it.
Here you go: https://drive.google.com/file/d/1_TBFFl ... sp=sharing
gujarat6
Inserter
Inserter
Posts: 31
Joined: Wed Apr 08, 2020 4:53 pm
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by gujarat6 »

When the ship is on route to the shattered planet, asteroid collectors take up like 40% of the whole game update.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14594
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by Rseding91 »

Looking at that save, the time spent seems to be linear with the number of asteroid chunks passing a given collectors path.
If you want to get ahold of me I'm almost always on Discord.
Genhis
Factorio Staff
Factorio Staff
Posts: 709
Joined: Wed Dec 24, 2014 8:19 am
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by Genhis »

I significantly optimized asteroid collectors for 2.0.26. Because of this and previous improvements, I consider this issue as resolved. Please create a new topic if you still experience performance problems or post your save file to 17501. I think we exhausted all possible asteroid-related performance improvements at this point, but again, we also said that a month ago, so you never know...

Now, some numbers:
gujarat6 wrote: Wed Dec 04, 2024 10:33 am Here you go: https://drive.google.com/file/d/1_TBFFl ... sp=sharing
Your save file spends 88% less time on asteroid collector update (11.9 ms -> 1.4 ms per tick).
Another one I was given on Discord has 94% faster asteroid collectors (15 ms -> 0.9 ms per tick).

Key points if you want to optimize asteroid collectors on your map for UPS (for version 2.0.26):
  1. Asteroid collectors track asteroid chunks with their projected path intersecting with the collector - each collector does this individually.
  2. Filtered asteroid collectors take less time because they don't have to track asteroid chunks they would never catch.
  3. Circuit-controlled asteroid collectors may miss some chunks if they change filters too frequently because we have to search all chunks on the surface to find new valid candidates - there is a 300-tick cooldown between full surface searches.
  4. Wider ships with front-facing asteroid collectors (and a limited number of side-facing ones) should perform better because they don't have to track asteroid chunks which are likely to be caught by collectors on the sides above them.
  5. Asteroid collectors don't sleep, they always track asteroid chunks, although in a reduced capacity when their inventory is full. This is because we don't know when they wake up and going through all asteroid chunks on a surface and check if their paths intersect is expensive.
gujarat6
Inserter
Inserter
Posts: 31
Joined: Wed Apr 08, 2020 4:53 pm
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by gujarat6 »

Genhis wrote: Mon Dec 16, 2024 12:06 pm I significantly optimized asteroid collectors for 2.0.26. Because of this and previous improvements, I consider this issue as resolved. Please create a new topic if you still experience performance problems or post your save file to 17501. I think we exhausted all possible asteroid-related performance improvements at this point, but again, we also said that a month ago, so you never know...

Now, some numbers:
gujarat6 wrote: Wed Dec 04, 2024 10:33 am Here you go: https://drive.google.com/file/d/1_TBFFl ... sp=sharing
Your save file spends 88% less time on asteroid collector update (11.9 ms -> 1.4 ms per tick).
Another one I was given on Discord has 94% faster asteroid collectors (15 ms -> 0.9 ms per tick).

Key points if you want to optimize asteroid collectors on your map for UPS (for version 2.0.26):
  1. Asteroid collectors track asteroid chunks with their projected path intersecting with the collector - each collector does this individually.
  2. Filtered asteroid collectors take less time because they don't have to track asteroid chunks they would never catch.
  3. Circuit-controlled asteroid collectors may miss some chunks if they change filters too frequently because we have to search all chunks on the surface to find new valid candidates - there is a 300-tick cooldown between full surface searches.
  4. Wider ships with front-facing asteroid collectors (and a limited number of side-facing ones) should perform better because they don't have to track asteroid chunks which are likely to be caught by collectors on the sides above them.
  5. Asteroid collectors don't sleep, they always track asteroid chunks, although in a reduced capacity when their inventory is full. This is because we don't know when they wake up and going through all asteroid chunks on a surface and check if their paths intersect is expensive.
Sounds great, happy to test soon!
Orum
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Thu Jul 11, 2019 6:23 am
Contact:

Re: Endgame trip to Shattered Planet is incredibly laggy [Spoiler]

Post by Orum »

Genhis wrote: Mon Dec 16, 2024 12:06 pm Wider ships with front-facing asteroid collectors (and a limited number of side-facing ones) should perform better because they don't have to track asteroid chunks which are likely to be caught by collectors on the sides above them.
First of all, thank you for optimizing this. That said, I'm still going to do what I can in game to try and keep the UPS up, but this point confuses me a bit. If I have a side-facing collector on, say, an arrowhead-shaped ship, where the asteroids are collected on the side, but to the left of any of the front collectors, e.g. like this:
delta.jpg
delta.jpg (273.24 KiB) Viewed 755 times
Even the right-most part of the lower collector's field is left of the left-most part of the top collector's collection field. Does this still have the penalty of tracking asteroids, even though they're unlikely to be caught by the upper collector?
Muche
Filter Inserter
Filter Inserter
Posts: 398
Joined: Fri Jun 02, 2017 6:20 pm
Contact:

Re: [Genhis/Rseding] Endgame trip to Shattered Planet is incredibly laggy

Post by Muche »

I believe if you enable "show-selected-asteroid-collector-prospective-chunks" F4 debug setting, all chunks are hidden, except those that the asteroid collector you are hovering above is tracking.
Maybe playing around with it could help answer it in your particular setup?
Post Reply

Return to “Resolved Problems and Bugs”