Optimzing UPS for a Megabase

Post all other topics which do not belong to any other category.
meAndmyself
Burner Inserter
Burner Inserter
Posts: 8
Joined: Wed Apr 27, 2016 5:02 pm
Contact:

Optimzing UPS for a Megabase

Post by meAndmyself »

I’ve been working on a (modded) megabase (10+ rockets/minute) for a while now and I keep running into UPS problems. In parallel I’ve been thinking about making an UPS-optimization mod to help with creating a mega base that runs with more than 10 fps. This is 0.12 btw, since I haven’t dared to migrate to 0.13 yet.
So I have a number of questions on how to optimize this.

What I’ve read from others so far is this:
  • - Full belts absolutely kill performance
    - Too many entities kill performance
    - Too many active chunks due to pollution kill performance
What I found myself so far is this:
  • - Too many logistic chests kill performance.
    - Enemy clusters outside of the base are horrible for performance.
    - Too many items (millions+) in the logistics network kill performance
    - Active provider chests seem to be worse for performance than passive provider chests since they make it more difficult for the bots to use the stack bonus, leading to more robots in the air, leading to worse performance.
    - Too many bots in the air kills performance
    - Too many active bots (5000+) inside one network kill performance and don’t work very well.
So my conclusions are:
  • - Running a genuine big base with more than 100k iron/copper / minute with belts seems to be right out. Bots are the way to go.
    - Mod the bots to have a huge stack size so that as few bots as possible need to be in the air.
    - Mod the bots to be as fast as possible
    - Mod the solar panels to be more powerful so that you don’t need to plaster 1000s of chunks.
    - Don’t put logistic networks over the solar area
    - Segment the logistic networks.
    - Mod the underground belts to span longer distances
    - Use the air filter mod to limit the pollution as much as possible
    - Use the Orbital Ion Canon auto targeting to clear a reasonable belt around the base.
    - If you need to store a large number of ore for example because you are cleaning an area for putting down solar, then use compression chests to avoid cluttering up your logistic network.
Of course I also have a number of questions:
  • - Are these conclusions correct?
    - What am I missing?
    - What is the impact of radars?
    - Is there a performance impact of the way you arrange the inserters on an assembler? Meaning does it make a difference you do: active provider -> smart inserter -> assembler -> fast insert -> passive provider vs. active provider -> fast inserter -> assembler -> smart insert -> passive provider. In the first case the assembler will be empty most of the time, in the second the assembler buffer will be mostly full.
    - For the performance, is it better to transfer 100k / minute iron plates on long underground belts or on trains?
    - Is it better for UPS if there is one assembler running at speed 3 or 3 assemblers at speed 1? My guess would be the fewer assemblers the better? So modded assemblers are probably the way to go?
    - How bad are modded super-fast inserters such as the mk3 from the Factorio extended mod for the UPS if you use them in large numbers, considering that you need a lot fewer of them than fast inserters?
    - Is there a way to see for the debug-time-used-view which entities in the entity update are taking the most time?
    - Is there a way to optimize the electric network?
(I checked the time used in the debug view by the way and my mods don’t seem to be the problem. It’s hovering around: game update ~50, entity update ~ 40, electric network ~6)
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Optimzing UPS for a Megabase

Post by steinio »

So the best is don't play this game to keep UPS high because every entity brings it down.
Image

Transport Belt Repair Man

View unread Posts
bobucles
Smart Inserter
Smart Inserter
Posts: 1708
Joined: Wed Jun 10, 2015 10:37 pm
Contact:

Re: Optimzing UPS for a Megabase

Post by bobucles »

steinio wrote:So the best is don't play this game to keep UPS high because every entity brings it down.
The solution is to run no software at all because every CPU calculation is stealing away our precious idle states!

Out of all the CPU hogging events, I'd have to say
- Enemy clusters outside of the base are horrible for performance.
Is the absolute worst. Idle biters should not be consuming so much CPU time when their primary objectives are sitting around and going A=>B. The hardest part of pathing can be shunted off the main CPU anyway.

I haven't seen cases where passive structures like solar panels cause any real system drag. They don't actually do anything other than change the solar panel number and never need CPU time again.

You can gain some UPS benefit by shutting down any major chunk of factory that is unused. Unfortunately belts can not be shut down to save any performance but when it comes to long distance then trains are king.
XBBX
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Wed Jan 07, 2015 4:30 pm
Contact:

Re: Optimzing UPS for a Megabase

Post by XBBX »

assembler furnace speed does not matter only amount of them i have tested that with like 400 of each with speed modules and without
Zaflis
Filter Inserter
Filter Inserter
Posts: 514
Joined: Sun Apr 24, 2016 12:51 am
Contact:

Re: Optimzing UPS for a Megabase

Post by Zaflis »

Performance is 1 of the reasons i like warehouse mod. Compare the amount of processing it takes to store 100k of 1 item in logistic storage, when it's passed with numerous inserters and so on, compared to just 1 container with no internal inserters? It simplifies the tasks for logistics network too.

As for logistics itself, there's mods that add more speed and capacity upgrades to them. Less robots in air at the time = win for performance.
User avatar
Kewlhotrod
Fast Inserter
Fast Inserter
Posts: 166
Joined: Thu Apr 23, 2015 5:20 pm
Contact:

Re: Optimzing UPS for a Megabase

Post by Kewlhotrod »

buy an cpu with a overclocking functionality and overclock it past 4.5ghz, on the new skylake parts it preforms really well.
meAndmyself
Burner Inserter
Burner Inserter
Posts: 8
Joined: Wed Apr 27, 2016 5:02 pm
Contact:

Re: Optimzing UPS for a Megabase

Post by meAndmyself »

steinio wrote:So the best is don't play this game to keep UPS high because every entity brings it down.
Obviously, but then you won't have a mega base, no dopamin release from looking at the base you built and I mean that's what we all crave, don't we? ;)
Kewlhotrod wrote:buy an cpu with a overclocking functionality and overclock it past 4.5ghz, on the new skylake parts it preforms really well.
Well, that would probably help a little, but if my current CPU is running at 3.5 Ghz and I up that to 4.5 Ghz, it seems unlikely that this would really solve very much. If we assume linear performance (rather optimistic in my opinion) then it would increase an FPS of 10 on my current computer to an FPS of 13. So the only way to really make progress is probably have the CPU do less.
Zaflis wrote:Performance is 1 of the reasons i like warehouse mod. Compare the amount of processing it takes to store 100k of 1 item in logistic storage, when it's passed with numerous inserters and so on, compared to just 1 container with no internal inserters? It simplifies the tasks for logistics network too.
I haven't tried out the warehouse mod since the mod thread contains quite a few examples of people complaining about how slow everything got. So your experience is completely different? How do you set up the warehouse? Do you use one per item? Have you compared it with the compression chest mod?
XBBX wrote:assembler furnace speed does not matter only amount of them i have tested that with like 400 of each with speed modules and without
So then a modded speed 10 assembler is probably the way to go...
bobucles wrote: I haven't seen cases where passive structures like solar panels cause any real system drag. They don't actually do anything other than change the solar panel number and never need CPU time again.

You can gain some UPS benefit by shutting down any major chunk of factory that is unused. Unfortunately belts can not be shut down to save any performance but when it comes to long distance then trains are king.
But if you need 10 GW of solar, then that's a lot of chunks, no? And the fewer chunks the better from my understanding.

Shutting down is an very interesting idea. But how do you shut down entire sections? Do you mean cutting electricity or stopping the material flow? Have you done any testing on how much that does?
Zaflis
Filter Inserter
Filter Inserter
Posts: 514
Joined: Sun Apr 24, 2016 12:51 am
Contact:

Re: Optimzing UPS for a Megabase

Post by Zaflis »

meAndmyself wrote:I haven't tried out the warehouse mod since the mod thread contains quite a few examples of people complaining about how slow everything got. So your experience is completely different? How do you set up the warehouse? Do you use one per item? Have you compared it with the compression chest mod?
Compression chest uses some form of power as far as i understand so it's a little different. I also like the 3x3 and 6x6 sizes of storage houses because then i can use so many inserters on them, and use some creative builds. One is a crafting circle for circuits, where in the middle is 3x3 requester storage and 8 assembly factories around it, extracting and inserting into it. And yes normally just 1 item type per container.

I haven't tried any mods in 0.13 yet because i aim for achievements for now, but it didn't used to lag for me. I've made 2 mods myself before so i just download the latest version and saw through source codes. There are only numeric variables set in the scripts, no ticking entities or anything like that. It cannot have higher than 0 cpu impact. So if there's lag it comes from base game itself using its images or whatever. Maybe the guy with lag had really old videocard... *shrug* Sometimes it helps for general factorio lag when increasing the memory from video options.
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Optimzing UPS for a Megabase

Post by orzelek »

Zaflis wrote:
meAndmyself wrote:I haven't tried out the warehouse mod since the mod thread contains quite a few examples of people complaining about how slow everything got. So your experience is completely different? How do you set up the warehouse? Do you use one per item? Have you compared it with the compression chest mod?
Compression chest uses some form of power as far as i understand so it's a little different. I also like the 3x3 and 6x6 sizes of storage houses because then i can use so many inserters on them, and use some creative builds. One is a crafting circle for circuits, where in the middle is 3x3 requester storage and 8 assembly factories around it, extracting and inserting into it. And yes normally just 1 item type per container.

I haven't tried any mods in 0.13 yet because i aim for achievements for now, but it didn't used to lag for me. I've made 2 mods myself before so i just download the latest version and saw through source codes. There are only numeric variables set in the scripts, no ticking entities or anything like that. It cannot have higher than 0 cpu impact. So if there's lag it comes from base game itself using its images or whatever. Maybe the guy with lag had really old videocard... *shrug* Sometimes it helps for general factorio lag when increasing the memory from video options.
From what I understood from dev explanations problem is on inserting into the warehouse with inserters. Bot based ones should not be a problem then.
meAndmyself
Burner Inserter
Burner Inserter
Posts: 8
Joined: Wed Apr 27, 2016 5:02 pm
Contact:

Re: Optimzing UPS for a Megabase

Post by meAndmyself »

orzelek wrote:
Zaflis wrote:
meAndmyself wrote:I haven't tried out the warehouse mod since the mod thread contains quite a few examples of people complaining about how slow everything got. So your experience is completely different? How do you set up the warehouse? Do you use one per item? Have you compared it with the compression chest mod?
Compression chest uses some form of power as far as i understand so it's a little different. I also like the 3x3 and 6x6 sizes of storage houses because then i can use so many inserters on them, and use some creative builds. One is a crafting circle for circuits, where in the middle is 3x3 requester storage and 8 assembly factories around it, extracting and inserting into it. And yes normally just 1 item type per container.

I haven't tried any mods in 0.13 yet because i aim for achievements for now, but it didn't used to lag for me. I've made 2 mods myself before so i just download the latest version and saw through source codes. There are only numeric variables set in the scripts, no ticking entities or anything like that. It cannot have higher than 0 cpu impact. So if there's lag it comes from base game itself using its images or whatever. Maybe the guy with lag had really old videocard... *shrug* Sometimes it helps for general factorio lag when increasing the memory from video options.
From what I understood from dev explanations problem is on inserting into the warehouse with inserters. Bot based ones should not be a problem then.
My understanding from some dev post (that I can't find anymore) was that for every insertion or removal of an item factorio needs to iterate across all (filled?) slots in the warehouse/chest to find where the item is or to find the next free space. This is not a problem if you have only only a couple of slots full of items, but if you have 500 slots and 10 fast inserters (or worse, modded mk3 inserters) doing that to a dozen warehouses a couple of times per second, it seems understandable that this rapidly becomes a major performance issue. So this is probably why it's not so horrible for bot based warehouses, since there bots usually won't arrive a couple of times per second.

What I don't understand though is why the warehouse is then a major improvement over just using some steel chests? I understand that compression chests won't have the issue, since they have only one slot, but I don't get how using the warehouse would improve performace?
Post Reply

Return to “General discussion”