What consumes UPS?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
E-37
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Mon Jan 22, 2018 12:37 am
Contact:

What consumes UPS?

Post by E-37 »

What mechanics are the most UPS expensive? I know that fluids are supposedly pretty expensive but what other mechanics / buildings hurt UPS the most?

Say like laser turrets: I have about 3-5k turrets in one of my factories but I really only need like a 5th of that now that I have damage upgrades. Do inactive turrets do enough harm to make it worth my time to remove them? The power drain doesn't really matter.
I have a 72 wide transport belt that stretches about a 5 minute train ride with nuclear fuel but my transport-lines update still takes < 1 ms. Does adding lots of splitters have a large impact to that? (I am using the splitters already but I was wondering if I should make an effort to minimize that)
My artillery range is large enough to keep most of the bugs out of my pollution cloud. (I get about 3 attacks per minute over my giant base) Would removing them help much since they aren't really attacking?

Those are just a couple of questions. Are there any other habits that I should be avoiding as much as I can?
Good things come in bags marked "SWAG"
Koub
Global Moderator
Global Moderator
Posts: 7784
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: What consumes UPS?

Post by Koub »

With 0.17, fluids have been heavily (and even too much) optimized : the definitive version of the fluids physics should be a little slower.
Laser turrets are negligible. Your 72 wide but that stretches for kilometers would be well replaced by trains and modular construction.
Bots are also known as better alternative to belts UPS wise when used cleverly.

Some mods are real UPS killers (like warehouses with huge containers, ...) , but I don't know if you play modded.
A screen capture of your timings would help a lot, but I'd say that you've built so big that whatever the efforts for optimization, at some point, no computer will be able to keep a steady 60 UPS.
Koub - Please consider English is not my native language.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: What consumes UPS?

Post by darkfrei »

Pathfinding by trains and biters is really expensive.
E-37
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Mon Jan 22, 2018 12:37 am
Contact:

Re: What consumes UPS?

Post by E-37 »

Koub wrote: Tue Apr 23, 2019 5:17 am Some mods are real UPS killers (like warehouses with huge containers, ...) , but I don't know if you play modded.
A screen capture of your timings would help a lot, but I'd say that you've built so big that whatever the efforts for optimization, at some point, no computer will be able to keep a steady 60 UPS.
My base currently runs at a smooth 60 UPS - I only used it as an example of some large scale inefficiencies and Ive built too big at this point to be interested in rebuilding. In general is using less entities always better? I guess solar panels and possibly beacons are an exception to that but will using 2 inserters instead of one fast inserter be slower cpu-wise? (with the assumption that both cases can satisfy the demand)
Koub wrote: Tue Apr 23, 2019 5:17 am With 0.17, fluids have been heavily (and even too much) optimized : the definitive version of the fluids physics should be a little slower.
What do you mean by fluids being too heavily optimized? Did they sacrifice more realism for performance in 0.17?
Koub wrote: Tue Apr 23, 2019 5:17 am Laser turrets are negligible. Your 72 wide but that stretches for kilometers would be well replaced by trains and modular construction.
I can imagine that it is far more efficient to have a train than a giant belt but I built it for a challenge to use no trains in my base. By modular construction I assume you mean things like smelting on site since ore has smaller stacks than plates or building circuits since they are even more compact.
Koub wrote: Tue Apr 23, 2019 5:17 am Bots are also known as better alternative to belts UPS wise when used cleverly.
What defines cleverly? Is that just for cases where the demand is low enough that running a belt to it is inefficient? I assumed that bots were the most efficient in all cases except for train-distance transportation. Is having smaller logistics zones better UPS wise or does it only reduce flight time?
darkfrei wrote: Tue Apr 23, 2019 6:38 am Pathfinding by trains and biters is really expensive.
I can imagine that biters can be expensive since they have to go long distances over who-knows-what terrain but trains surprise me. I assumed that with a much smaller set of paths that it would be fairly cheap. Maybe rail signals complicate things.
Good things come in bags marked "SWAG"
Koub
Global Moderator
Global Moderator
Posts: 7784
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: What consumes UPS?

Post by Koub »

Well I assumed that you couldn't achieve 60 UPS, and that was the reason you created this thread. I'm quite impressed being wrong (both by the devs who can get such an optimized game, and your computer, that must be quite beefy, you wouldn't run that on a potato :mrgreen: ).
E-37 wrote: Tue Apr 23, 2019 4:52 pm What do you mean by fluids being too heavily optimized? Did they sacrifice more realism for performance in 0.17?
That's exactly it. Actually, they did that in 0.17 *for now*, but this should change. Source here : viewtopic.php?p=424101#p424101

For the remaining of my previous post, most advices were given with the idea that you needed to fix low UPS issues. The pieces of advice I gave are still valid to delay even more the apparition of UPS issues should you keep on building, but you don't need them at the moment.

The "clever" use of bots is indeed "small" (compared to the scale of your base) modular constructions that allow you to minimize belt length, robot pathing calculations, ... and minimize the number of entities needed : Despite the bots being VERY UPS friendly overall, small logistic networks that can operate with a few hundred bots each are better (UPS wise) than a behemoth single network with tens of thousands of bots that have to travel across all the map : less robots, less roboports, ...

I also didn't mention the power generation. Solar is UPS free. If you run into UPS issues, replacing steam/nuclear with solar is a good way to get more UPS.

Also, I'm not trying to teach you "how the game should be played", if I gave you this impression, I'm sorry for not being clear. It's just general tips "for better UPS". I can understand the "I don't want trains" thing more than you could imagine :). but a simple yet efficient train network will be better UPS wise than endless belts with balancers everywhere.
Koub - Please consider English is not my native language.
E-37
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Mon Jan 22, 2018 12:37 am
Contact:

Re: What consumes UPS?

Post by E-37 »

Koub wrote: Tue Apr 23, 2019 5:55 pm Well I assumed that you couldn't achieve 60 UPS, and that was the reason you created this thread. I'm quite impressed being wrong (both by the devs who can get such an optimized game, and your computer, that must be quite beefy, you wouldn't run that on a potato :mrgreen: ).
Now that I have the game up, I have some actual numbers instead of just estimates. I was wildly off in terms of laser turrets as I actually have 37k. I counted my mega belt with a deconstruction planner and it comes out to about 10-11k long not counting that I use belts for all of my science production. While I do have a very strong computer, all the credit goes to the devs here. I just loaded the game on my potato laptop and it got a solid 40 UPS when I was zoomed all the way in. With the 1k SPM portion of my base switched on (I just finished it and don't have the mines to feed it for a long period of time) belts only take up 5-6% of the update. I don't have a 1k SPM train base to compare it to, but that seems really well optimized. Messing around with the debug options, it seems that the games merges belts into one long belt (like how the underground belt used to give better performance than normal belts because they covered 8 tiles instead of 1) so length doesn't seem to affect performance.

As for nuclear power, my total fluids take less than 2% of the update. I wouldn't imagine that switching to solar would help much since I have some very messy pipes that are probably taking up most of the fluid tick.
Koub wrote: Tue Apr 23, 2019 5:55 pm Also, I'm not trying to teach you "how the game should be played", if I gave you this impression, I'm sorry for not being clear. It's just general tips "for better UPS". I can understand the "I don't want trains" thing more than you could imagine :). but a simple yet efficient train network will be better UPS wise than endless belts with balancers everywhere.
I never thought you were. Besides, I came here looking for tips. Why would I ask for advice and then throw it away because I didn't like the way it was presented? ;)
Good things come in bags marked "SWAG"
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: What consumes UPS?

Post by disentius »

Entities!:)

Normal/High UPS:
-active Inserters, chests, assemblers, aliens, fish(rumor)
-all non-saturated belts; splitters, sideloaders
-active pipes
-every active chunk on the map

low/very low UPS
-beacons, solar panels, accumulators
E-37
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Mon Jan 22, 2018 12:37 am
Contact:

Re: What consumes UPS?

Post by E-37 »

disentius wrote: Tue Apr 23, 2019 8:58 pm Entities!:)

Normal/High UPS:
-active Inserters, chests, assemblers, aliens, fish(rumor)
-all non-saturated belts; splitters, sideloaders
-active pipes
-every active chunk on the map

low/very low UPS
-beacons, solar panels, accumulators
Fully compressed belts have better performance than non compressed belts? I guess that makes sense. I don't believe that fish consume much. I noticed that if you look at fish far away with a radar, you will see that they don't move at all and only start moving when the player gets close.
Good things come in bags marked "SWAG"
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: What consumes UPS?

Post by orzelek »

E-37 wrote: Wed Apr 24, 2019 8:58 pm
disentius wrote: Tue Apr 23, 2019 8:58 pm Entities!:)

Normal/High UPS:
-active Inserters, chests, assemblers, aliens, fish(rumor)
-all non-saturated belts; splitters, sideloaders
-active pipes
-every active chunk on the map

low/very low UPS
-beacons, solar panels, accumulators
Fully compressed belts have better performance than non compressed belts? I guess that makes sense. I don't believe that fish consume much. I noticed that if you look at fish far away with a radar, you will see that they don't move at all and only start moving when the player gets close.
Belts description is misleading I think.
Belt that is full and not moving might be better for performance since it's not working. I'm not sure if it has been tested enough to see if difference is meaningfull.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: What consumes UPS?

Post by darkfrei »

You can test the performance with fish: just make this code on the see

Code: Select all

/c local player = game.player
local surface = player.surface
for i = 1, 10 do
  local position = surface.find_non_colliding_position('fish', player.position, 10, 1)
  if not position then return end
  surface.create_entity {name = 'fish', position = position}
end
Or with 100, 1000 fishes etc.
E-37
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Mon Jan 22, 2018 12:37 am
Contact:

Re: What consumes UPS?

Post by E-37 »

I spawned in about 2000 fish and I didn't have any drop in UPS.
Good things come in bags marked "SWAG"
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: What consumes UPS?

Post by darkfrei »

E-37 wrote: Fri Apr 26, 2019 6:12 pm I spawned in about 2000 fish and I didn't have any drop in UPS.
I've made the map 300x300 tiles, game speed 5000.
Lower UPS was about 10 000, highest UPS was about 200 000. After placing of 2000 fishes, it was UPS 4000 / 180 000.
boran_blok
Long Handed Inserter
Long Handed Inserter
Posts: 94
Joined: Fri Mar 01, 2019 7:56 am
Contact:

Re: What consumes UPS?

Post by boran_blok »

Related to this I have a question about large chests and/or warehouses.

I understand large warehouses and chests have an impact on UPS when inserting/taking out, does limiting the chest or warehouse help with this in any way? I know wooden chests are good for passing items in between with a chest buffer, but would an iron chest limited to 1 stack perform just as well as a wooden chest limited to 1 stack ?
Koub
Global Moderator
Global Moderator
Posts: 7784
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: What consumes UPS?

Post by Koub »

What is UPS unfriendly with large warehouses is that every time an inserter wants to ... insert something in a container, it has to cycle through all the slots to see it there is room in that slot for the given item.
The source with a lot of details here : viewtopic.php?p=128592#p128592 (and the following posts).
Koub - Please consider English is not my native language.
boran_blok
Long Handed Inserter
Long Handed Inserter
Posts: 94
Joined: Fri Mar 01, 2019 7:56 am
Contact:

Re: What consumes UPS?

Post by boran_blok »

oh, I see, and does this loop take an early exit when it encounters an X? Since then by definition no following slot can accept the item either.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: What consumes UPS?

Post by darkfrei »

Koub wrote: Sat Apr 27, 2019 7:09 am What is UPS unfriendly with large warehouses is that every time an inserter wants to ... insert something in a container, it has to cycle through all the slots to see it there is room in that slot for the given item.
The source with a lot of details here : viewtopic.php?p=128592#p128592 (and the following posts).
So. If we trying to insert 3 items of coal to chest with coal, it tries to insert it to every slot, from first one?

It looks like some infinity chest can have better performance just with inventory[stack.name] = inventory[stack.name] + stack.amount, without checking if we have place for it.
DerGraue
Fast Inserter
Fast Inserter
Posts: 151
Joined: Mon May 30, 2016 12:12 pm
Contact:

Re: What consumes UPS?

Post by DerGraue »

There is a guy, mulark, who has done a lot of UPS testing and benchmarking.

He has a website with his test results, very nice read. It should answer a lot of your questions.

I only found out about his site a few days ago when reading randomly on factorio discord.

I hope it is ok if I link it:

https://mulark.github.io/index.html
Eketek
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Mon Oct 19, 2015 9:04 pm
Contact:

Re: What consumes UPS?

Post by Eketek »

Koub wrote: Sat Apr 27, 2019 7:09 am What is UPS unfriendly with large warehouses is that every time an inserter wants to ... insert something in a container, it has to cycle through all the slots to see it there is room in that slot for the given item.
The source with a lot of details here : viewtopic.php?p=128592#p128592 (and the following posts).
Seems to me that an appropriate optimization would be to do away with the notion of inventory slots and item stack size and replace it with volume and/or weight properties - that way it can use a simple numeric comparison to determine if something can fit and would only ever have to iterate through as many entries in a chest as there are types of items.
Koub
Global Moderator
Global Moderator
Posts: 7784
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: What consumes UPS?

Post by Koub »

My intuition tells me that this "simple" change would have way more side effects on the rest of the game. Like the player's inventory for example.
Koub - Please consider English is not my native language.
Post Reply

Return to “Gameplay Help”