Let us override inserters remove fuel from furnaces

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

JackGruff
Fast Inserter
Fast Inserter
Posts: 134
Joined: Tue Oct 15, 2013 4:44 pm
Contact:

Let us override inserters remove fuel from furnaces

Post by JackGruff »

Wouldn't it be great if I could smelt steel early game by letting the inserter behind the 1st furnace take coal out to give to the second furnace?

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by darkfrei »

JackGruff wrote:Wouldn't it be great if I could smelt steel early game by letting the inserter behind the 1st furnace take coal out to give to the second furnace?
https://mods.factorio.com/mods/Klonan/BurnerLeech
https://mods.factorio.com/mods/niki1233 ... 0A15%20Fix

bobucles
Smart Inserter
Smart Inserter
Posts: 1669
Joined: Wed Jun 10, 2015 10:37 pm
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by bobucles »

Filter inserters are literally red science. You don't need any mods to accomplish this, just a handful of green circuits.

JohnyDL
Filter Inserter
Filter Inserter
Posts: 533
Joined: Fri May 16, 2014 3:44 pm
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by JohnyDL »

I think that there's no way to take the fuel out of a furnace at present are you asking for this ability? cause that would mess up automation of plates since coal would go onto those belts

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by mrvn »

No. It's about:

a) burner inserters taking fuel out of a furnace to use it themself.
b) inserters taking fuel out of a furnace IF they insert it into a fuel using entity

The two mentioned mods make that change and coal does not end up on your output belt.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7351
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by bobingabout »

It's hard to keep track of how things work like this, since the devs keep changing it.

Currently though, you can ripple science packs through labs by having inserters remove them from one lab to put in another.... unless they turned that off again.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 883
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by Oktokolo »

+1 as it could convince me using burner inserters for the first smelting setups (even outputting plates from a furnace with a burner inserter would massively profit from not having to dedicate one line of the output belt to fuel).

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2631
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by steinio »

This all sounds like you need BurnerLeech which Bobingabout mentioned before.

If mods get popular there is a higher chance they get implemented in vanilla.
Image

Transport Belt Repair Man

View unread Posts

Caine
Fast Inserter
Fast Inserter
Posts: 213
Joined: Sun Dec 17, 2017 1:46 pm
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by Caine »

You could have the ripple effect on all factories, i.e. pass through both inputs and outputs between identical factories.
However, this would trivialize many setups and be detrimental to the challenges of the game.

I think the same holds for passing fuel between furnaces. -1

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by mrvn »

Caine wrote:You could have the ripple effect on all factories, i.e. pass through both inputs and outputs between identical factories.
However, this would trivialize many setups and be detrimental to the challenges of the game.

I think the same holds for passing fuel between furnaces. -1
There is a big difference between normal inputs and fuel. On the other hand for most things the recipe time and number of inputs makes ripple effects highly inefficient for most cases. It only works for fuel (and science) because of the slow consumption.

I've never considered using a ripple effect between furnaces for fuel but now that you mentioned it I will try.

User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 883
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by Oktokolo »

Tried BurnerLeech and will use it for next start. Works fine at furnace-to-furnace and furnace-to-belt use cases with burner inserters (doesn't work with electric inserters feeding the steel smelters though).
Might even use it in my current game as it definitely looks nice and burner inserters do not need copper. You still have to hand-fuel inserters that do not grab fuel as their first item (wich is fine).

Look at that poor inserter, that starved with a block of solid fuel in his hands):
Burner steel.png
Burner steel.png (161.69 KiB) Viewed 7636 times
P.S.: Filed a feature request for adding electric inserter support to the mod.

Caine
Fast Inserter
Fast Inserter
Posts: 213
Joined: Sun Dec 17, 2017 1:46 pm
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by Caine »

mrvn wrote:There is a big difference between normal inputs and fuel. On the other hand for most things the recipe time and number of inputs makes ripple effects highly inefficient for most cases. It only works for fuel (and science) because of the slow consumption.
Hmmm... you do got a point there. Well, I suppose if the ripple effect only works for fuel and only with burner inserters (like the mod seems to do) that there actually is an interesting tradeoff to be made.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by mrvn »

Oktokolo wrote:Tried BurnerLeech and will use it for next start. Works fine at furnace-to-furnace and furnace-to-belt use cases with burner inserters (doesn't work with electric inserters feeding the steel smelters though).
Might even use it in my current game as it definitely looks nice and burner inserters do not need copper. You still have to hand-fuel inserters that do not grab fuel as their first item (wich is fine).

Look at that poor inserter, that starved with a block of solid fuel in his hands):
Burner steel.png
P.S.: Filed a feature request for adding electric inserter support to the mod.
When you blueprint or build this connect the fuel part first and let it run till it stops. Only then connect the ore.

I think there a 2 problems with burner inserters:

1) At start it has enough fuel that it will deliver ore / plates instead of waiting for fuel. If it is picking up from a belt it will pick whatever item comes along first. If that isn't fuel it will run out.

2) The inserter runs low on fuel one tick after picking up ore / plates. It then has to deliver the ore / plate before it can pick up fuel. I think then it runs out of fuel before refueling itself. This might be a problem with Bobs adjustable inserters because that can increases the time it takes to deliver items.

Basically they are both the same problem. The burner inserter should compute how much fuel it needs to deliver an item and refuel itself. If the current fuel level is below that then it should wait for fuel. Currently it only prefers to refuel but will try to deliver items if there is no fuel and get stuck.

User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 883
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by Oktokolo »

mrvn wrote:The burner inserter should compute how much fuel it needs to deliver an item and refuel itself. If the current fuel level is below that then it should wait for fuel. Currently it only prefers to refuel but will try to deliver items if there is no fuel and get stuck.
Burner inserters indeed start with less fuel than they would need to refuel after delivering something else. That is by design, i guess.
But they also do not interrupt transporting other stuff to refuel themself when their fuel inventory gets empty. To fix the problem with burner inserters running out of fuel, they would just have to refuse picking up anything that they can't use as fuel when their fuel inventory is empty.
I am currently researching a way to implement this for my (to-be-released) fork of BurnerLeech.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by mrvn »

Oktokolo wrote:
mrvn wrote:The burner inserter should compute how much fuel it needs to deliver an item and refuel itself. If the current fuel level is below that then it should wait for fuel. Currently it only prefers to refuel but will try to deliver items if there is no fuel and get stuck.
Burner inserters indeed start with less fuel than they would need to refuel after delivering something else. That is by design, i guess.
But they also do not interrupt transporting other stuff to refuel themself when their fuel inventory gets empty. To fix the problem with burner inserters running out of fuel, they would just have to refuse picking up anything that they can't use as fuel when their fuel inventory is empty.
I am currently researching a way to implement this for my (to-be-released) fork of BurnerLeech.
They might run quite a while on that last fuel, consider the nuclear fuel. But it would be way better to do it that way if computing when fuel pickup becomes an absolute necessity rather than a precaution is to CPU expensive.

As for modding this how do you plan to do this? Having an on_tick event handler that checks fuel levels would be a CPU killer. Is there a better event for this that only triggers once per pickup?

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by darkfrei »

mrvn wrote:Having an on_tick event handler that checks fuel levels would be a CPU killer. Is there a better event for this that only triggers once per pickup?
You can check only one inserter per tick. This code you can find by BurnerLeech.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by mrvn »

darkfrei wrote:
mrvn wrote:Having an on_tick event handler that checks fuel levels would be a CPU killer. Is there a better event for this that only triggers once per pickup?
You can check only one inserter per tick. This code you can find by BurnerLeech.
And then when you have 10000 inserters they will run out of fuel because checking takes to long to come around.

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2631
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by steinio »

How about steam powered smelters which can be connected with pipes to substituate solid fuel?
Image

Transport Belt Repair Man

View unread Posts

User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 883
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by Oktokolo »

mrvn wrote:
Oktokolo wrote:But they also do not interrupt transporting other stuff to refuel themself when their fuel inventory gets empty. To fix the problem with burner inserters running out of fuel, they would just have to refuse picking up anything that they can't use as fuel when their fuel inventory is empty.
I am currently researching a way to implement this for my (to-be-released) fork of BurnerLeech.
As for modding this how do you plan to do this? Having an on_tick event handler that checks fuel levels would be a CPU killer. Is there a better event for this that only triggers once per pickup?
I am still searching for the proper way to fix that. But i implemented some pretty reliable workaround in my (just released) fork of Klonan's BurnerLeech, InserterFuelLeech. I memorize each newly placed inserter. Then on each tick i calculate how much inserters i have to process so that they all get processed after a configurable amount of ticks (i default to 90 ticks, a value i determined okayish UPS-wise for mid-game with some dozens smelter columns). This is needed so i can guarantee, they all get checked often enough to make my new behaviour and the backup workaround work:

The behaviour is implemented as checking for empty hand hovering above pickup location and then teleporting/leeching an appropriate stack of fuel from the pickup target's burner inventory into the hand if inserter or drop target needs refuelling (less than configurable amount of fuel items for drop target or empty burner inventory for self).

The backup workaround for extremely busy inserters that get never catched empty-handed hovering above the pickup target (mostly, because of 90 ticks between updates) is pure cheating: If no fuel items left and less of a confifgurable amount of energy left (i chose 1MJ), i teleport one fuel item from the pickup target into the inserters burner inventory.
But if a burner inserter gets fully drained somehow, it keeps beeing that way. Once it is blinking, you have to refuel it by hand or other inserter. So you have still to connect the coal first ;)

As said earlier: I still look for a method to get full control over the behaviour of inserters. For burner inserters the vanilla behaviour still really sucks. You have to use double burners for ore-to-steel columns to get them reliably refuelling the steel smelters (i restricted the fallback cheat mode to the inserter only, so steel smelters run dry if dumb inserters only care about moving the plates).

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Let us override inserters remove fuel from furnaces

Post by mrvn »

Oktokolo wrote:
mrvn wrote:
Oktokolo wrote:But they also do not interrupt transporting other stuff to refuel themself when their fuel inventory gets empty. To fix the problem with burner inserters running out of fuel, they would just have to refuse picking up anything that they can't use as fuel when their fuel inventory is empty.
I am currently researching a way to implement this for my (to-be-released) fork of BurnerLeech.
As for modding this how do you plan to do this? Having an on_tick event handler that checks fuel levels would be a CPU killer. Is there a better event for this that only triggers once per pickup?
I am still searching for the proper way to fix that. But i implemented some pretty reliable workaround in my (just released) fork of Klonan's BurnerLeech, InserterFuelLeech. I memorize each newly placed inserter. Then on each tick i calculate how much inserters i have to process so that they all get processed after a configurable amount of ticks (i default to 90 ticks, a value i determined okayish UPS-wise for mid-game with some dozens smelter columns). This is needed so i can guarantee, they all get checked often enough to make my new behaviour and the backup workaround work:

The behaviour is implemented as checking for empty hand hovering above pickup location and then teleporting/leeching an appropriate stack of fuel from the pickup target's burner inventory into the hand if inserter or drop target needs refuelling (less than configurable amount of fuel items for drop target or empty burner inventory for self).

The backup workaround for extremely busy inserters that get never catched empty-handed hovering above the pickup target (mostly, because of 90 ticks between updates) is pure cheating: If no fuel items left and less of a confifgurable amount of energy left (i chose 1MJ), i teleport one fuel item from the pickup target into the inserters burner inventory.
But if a burner inserter gets fully drained somehow, it keeps beeing that way. Once it is blinking, you have to refuel it by hand or other inserter. So you have still to connect the coal first ;)

As said earlier: I still look for a method to get full control over the behaviour of inserters. For burner inserters the vanilla behaviour still really sucks. You have to use double burners for ore-to-steel columns to get them reliably refuelling the steel smelters (i restricted the fallback cheat mode to the inserter only, so steel smelters run dry if dumb inserters only care about moving the plates).
I think burner inserters should have 2 states: Normal and refuel. You need some way to switch it from normal mode to only picking up fuel for itself. Setting a filter for a non-existent item should make it only pick up fuel. Burner inserters should only be switched to refuel state when they have no fuel left in their fuel slot (but still stored energy). Otherwise they might be unable to pick up fuel because it doesn't match their fuel slot contents.

Next lets assume for a moment that the user won't interfere and take out fuel out of a burner inserter. If he does and things break then he gets to keep the pieces.

Then when you check a burner inserter you see how much fuel it has, you know how much fuel it consumes running nonstop and you can calculate how much fuel it needs left to empty its hand and pick up more fuel. So you can calculate the earliest time T it might need to stop doing its normal work and pick up only fuel for itself. In refuel state you can calculate the minimum time it takes to (finish) refuel and that too gives you a T value.

So now you know the inserter will be good up to at least T. Checking the inserter before T is pointless and checking after T might be too late. I would create a priority queue (heap in an array is probably a good data structure for it). Put all inserter into the queue sorted by T. Then each tick you check the top of the heap. While T <= tick count you re-check the fuel situation of the inserter and either switch it to refuel state or normal and reinsert it into the queue. To smooth things out you can also switch an inserter to refuel state if T > tick count but the fuel slot is already empty. I would do that once each tick if no inserter has reached it's T time.

Now there is a little complications. Burner inserters can leach fuel from other burner inserter. In that case the one they leach from needs it's T value reset. And lets hope it doesn't run out of fuel. Maybe you can leach fuel only if there is more than one item in the fuel slot? You would need a third state then: waiting.

Post Reply

Return to “Ideas and Suggestions”