Inserter optimization question

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
Guenni7
Fast Inserter
Fast Inserter
Posts: 144
Joined: Thu May 18, 2017 5:53 am
Contact:

Inserter optimization question

Post by Guenni7 »

Still trying to optimize my factory and while watching and thinking I noticed that
Inserters move whatever they can get hands on, so worst case is a stack inserter with capacity 12 moves 1 item.
Wouldn't it be much UPS friendlier, if they move only when they get a full stack? Maye not as default, but as an option?
(Yes I know you can build a timer for inserters, but that's not very handy in mixed production areas as all assemblers have different timings)

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3699
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Inserter optimization question

Post by DaveMcW »

Guenni7 wrote:
Tue Jan 12, 2021 5:30 am
(Yes I know you can build a timer for inserters, but that's not very handy in mixed production areas as all assemblers have different timings)
Just make a timer for each recipe. If you are building big enough to care about UPS, there will be many machines running the same recipe. Then it is simply a wiring challenge.
Guenni7 wrote:
Tue Jan 12, 2021 5:30 am
Wouldn't it be much UPS friendlier
The best case scenario is +30% UPS, which is decent but not "much" better.

Guenni7
Fast Inserter
Fast Inserter
Posts: 144
Joined: Thu May 18, 2017 5:53 am
Contact:

Re: Inserter optimization question

Post by Guenni7 »

DaveMcW wrote:
Tue Jan 12, 2021 5:37 am
Just make a timer for each recipe. If you are building big enough to care about UPS, there will be many machines running the same recipe. Then it is simply a wiring challenge.
I build everything from raw material to science on several sites, that would make 50 or so timers per site.... You think that's more UPS friendly?
DaveMcW wrote:
Tue Jan 12, 2021 5:37 am
The best case scenario is +30% UPS, which is decent but not "much" better.
Inserters are the highest consumers of UPS after bots and assemblers in my game, 30% sounds like worth a try.

Would it be possible to try this out with a mod before suggesting it to the devs?

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3699
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Inserter optimization question

Post by DaveMcW »

50 or so timers per map. Then you have to wire all the sites together so they can share the same timer. :P

Luckily wires do not suffer any distance penalty!

blazespinnaker
Filter Inserter
Filter Inserter
Posts: 665
Joined: Wed Sep 16, 2020 12:45 pm
Contact:

Re: Inserter optimization question

Post by blazespinnaker »

Guenni7 wrote:
Tue Jan 12, 2021 6:53 am
Would it be possible to try this out with a mod before suggesting it to the devs?
Probably not. This would require C++ changes I suspect for UPS improvements. You could look at loaders though, different mods have them.

However, if it's your 3rd biggest issue for UPS, you probably aren't going to see very compelling gains.

I'd start on bots and assemblers if they are your worst culprits:

/c game.player.force.worker_robots_storage_bonus=63
OptimaUPS Mod, pm for info.

Guenni7
Fast Inserter
Fast Inserter
Posts: 144
Joined: Thu May 18, 2017 5:53 am
Contact:

Re: Inserter optimization question

Post by Guenni7 »

blazespinnaker wrote:
Tue Jan 12, 2021 10:53 am
I'd start on bots and assemblers if they are your worst culprits:
/c game.player.force.worker_robots_storage_bonus=63
Hehe, that's a nice cheat :) Just setting the bonus to 4 gave back my 60UPS.
After making belts multithreaded I think (hope) natural next step would be to multithread the bots, that would have a massive impact on performance.

blazespinnaker
Filter Inserter
Filter Inserter
Posts: 665
Joined: Wed Sep 16, 2020 12:45 pm
Contact:

Re: Inserter optimization question

Post by blazespinnaker »

Yeah, though you'll want some nice CPU fans. I have to put an ice pack under my laptop when I play factorio.
OptimaUPS Mod, pm for info.

Guenni7
Fast Inserter
Fast Inserter
Posts: 144
Joined: Thu May 18, 2017 5:53 am
Contact:

Re: Inserter optimization question

Post by Guenni7 »

blazespinnaker wrote:
Thu Jan 14, 2021 2:43 pm
Yeah, though you'll want some nice CPU fans. I have to put an ice pack under my laptop when I play factorio.
That's a good sign, Factorio at least uses all your processor power :)
My laptop runs at 91°C when Factorio is working.

BTW: To test the multithreaded belts I started to rebuild the smelter arrays from bot to belt,
but I have the imagination that the inserter time usage is growing faster than the bot time usage is going down.
Inserters to belts are incredibly UPS-hungry as it seems.

User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Inserter optimization question

Post by ptx0 »

Guenni7 wrote:
Fri Jan 15, 2021 2:26 am
blazespinnaker wrote:
Thu Jan 14, 2021 2:43 pm
Yeah, though you'll want some nice CPU fans. I have to put an ice pack under my laptop when I play factorio.
That's a good sign, Factorio at least uses all your processor power :)
My laptop runs at 91°C when Factorio is working.

BTW: To test the multithreaded belts I started to rebuild the smelter arrays from bot to belt,
but I have the imagination that the inserter time usage is growing faster than the bot time usage is going down.
Inserters to belts are incredibly UPS-hungry as it seems.
make sure they're sleeping. see in debug output, show-active-state. red circle is the goal.

Guenni7
Fast Inserter
Fast Inserter
Posts: 144
Joined: Thu May 18, 2017 5:53 am
Contact:

Re: Inserter optimization question

Post by Guenni7 »

ptx0 wrote:
Fri Jan 15, 2021 4:10 am
make sure they're sleeping. see in debug output, show-active-state. red circle is the goal.
That's easier to say than to do actually, I find it a bit hard to time them, because they a) need so much time to get rid of the 12 items and b) you never know when there is space on the belt. I have them be activated twice the time as when doing inserters->chest just to not get the assemblers filled up :(

Well, just one more thing why inserters should only move with full hands (optionally), to get rid of the timer thingy :)

BTW: I don't need gameplay help on this one, why was this moved from general discussion? If general doesn't fit I think Development Suggestions would be it, or doesn't it?

Zanthra
Fast Inserter
Fast Inserter
Posts: 207
Joined: Fri Mar 25, 2016 8:18 am
Contact:

Re: Inserter optimization question

Post by Zanthra »

How would inserters only moving with full hands actually reduce CPU usage though? I expect inserters to belt to be most UPS efficient at a stack size of 1, since the inserter only needs to look at the belt for a minimum of 1 tick on a swing to drop the item. With more items in hand, it needs to check each tick until the hand is empty.

Guenni7
Fast Inserter
Fast Inserter
Posts: 144
Joined: Thu May 18, 2017 5:53 am
Contact:

Re: Inserter optimization question

Post by Guenni7 »

Zanthra wrote:
Wed Jan 20, 2021 7:21 pm
How would inserters only moving with full hands actually reduce CPU usage though? I expect inserters to belt to be most UPS efficient at a stack size of 1, since the inserter only needs to look at the belt for a minimum of 1 tick on a swing to drop the item. With more items in hand, it needs to check each tick until the hand is empty.
With a stack-size of 1 the inserter is constantly moving/active.
With stack size 12 and a full hand it would move, unload, sleep for x seconds (x depending on assembler speed) until it has a new full hand (if there's enough free space on the belt).

Zanthra
Fast Inserter
Fast Inserter
Posts: 207
Joined: Fri Mar 25, 2016 8:18 am
Contact:

Re: Inserter optimization question

Post by Zanthra »

Guenni7 wrote:
Wed Jan 20, 2021 7:33 pm
Zanthra wrote:
Wed Jan 20, 2021 7:21 pm
How would inserters only moving with full hands actually reduce CPU usage though? I expect inserters to belt to be most UPS efficient at a stack size of 1, since the inserter only needs to look at the belt for a minimum of 1 tick on a swing to drop the item. With more items in hand, it needs to check each tick until the hand is empty.
With a stack-size of 1 the inserter is constantly moving/active.
With stack size 12 and a full hand it would move, unload, sleep for x seconds (x depending on assembler speed) until it has a new full hand (if there's enough free space on the belt).
It would depend on how expensive the inserter swing is vs how expensive it is to check for space on the belt. I guess without knowing the time complexity of each, it's hard to determine.

I suppose you could make a mod that automatically moves assembler products to an adjacent chest, then make a circuit between that chest and the inserter to only activate the inserter when the chest has at least X items.

Guenni7
Fast Inserter
Fast Inserter
Posts: 144
Joined: Thu May 18, 2017 5:53 am
Contact:

Re: Inserter optimization question

Post by Guenni7 »

Zanthra wrote:
Wed Jan 20, 2021 8:43 pm
I suppose you could make a mod that automatically moves assembler products to an adjacent chest, then make a circuit between that chest and the inserter to only activate the inserter when the chest has at least X items.
That would just double the amount of inserters, don't think that's any better for UPS... :(

Edit: maybe if I wire both inserters to the chest it could work, I will try...

Zanthra
Fast Inserter
Fast Inserter
Posts: 207
Joined: Fri Mar 25, 2016 8:18 am
Contact:

Re: Inserter optimization question

Post by Zanthra »

Guenni7 wrote:
Wed Jan 20, 2021 8:46 pm
Zanthra wrote:
Wed Jan 20, 2021 8:43 pm
I suppose you could make a mod that automatically moves assembler products to an adjacent chest, then make a circuit between that chest and the inserter to only activate the inserter when the chest has at least X items.
That would just double the amount of inserters, don't think that's any better for UPS... :(

Edit: maybe if I wire both inserters to the chest it could work, I will try...
If you make a mod you could transfer to the chest without inserters. Transfering to belts by mod is more difficult if the loader mods are any indication.

Post Reply

Return to “Gameplay Help”