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

This subforum contains all the issues which we already resolved.
Genhis
Factorio Staff
Factorio Staff
Posts: 775
Joined: Wed Dec 24, 2014 8:19 am
Contact:

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

Post by Genhis »

Orum wrote: Tue Dec 17, 2024 10:55 pm 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:
It's mostly about keeping the number of idle asteroid collectors (caused by overlapping areas) to minimum, assuming they don't have empty filters list controlled by circuit network in which case they wouldn't track anything. Results may slightly vary due to implementation details.
Example
Muche wrote: Tue Dec 17, 2024 11:06 pm 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.
The debug option only shows asteroid chunks which are iterated every tick, not all tracked chunks.
Orum
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Thu Jul 11, 2019 6:23 am
Contact:

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

Post by Orum »

Ah, okay. So basically just having idle collectors (that are actively trying to collect chunks and aren't disabled by filters) is just bad, wherever they are? Seems like that's just a lot more likely to occur on the side, below other collectors that would pick up the chunks they're looking for before them.
flomz
Burner Inserter
Burner Inserter
Posts: 12
Joined: Fri Feb 18, 2022 5:33 pm
Contact:

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

Post by flomz »

Asteroid collectors track asteroid chunks with their projected path intersecting with the collector - each collector does this individually.
Long time ago solar panels and belts (and fluid pipes, not so long ago :)) were tracked individually, and ate significant chunk of cpu time, until they were optimized to work like a single unit to some extent. Maybe something similar can be done here as well, to not depend on number of collectors as much?

Is it viable to track collectors from chunks side?
Will periodic preprocessing/indexing help? For example, create some sort of index of chunks which are in vicinity of collector-"painted" area, update it every 100 ticks and use it for full search by all collectors.
Or assign asteroid chunks to a grid and have collectors only query neighbouring grid cells.
C++ dev @ yandex
Post Reply

Return to “Resolved Problems and Bugs”