Let us override inserters remove fuel from furnaces

Post your ideas and suggestions how to improve the game.
JackGruff
Fast Inserter
Fast Inserter
Posts: 115
Joined: Tue Oct 15, 2013 4:44 pm

Let us override inserters remove fuel from furnaces

Post by JackGruff » Thu Dec 07, 2017 9:34 am

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: 1516
Joined: Thu Nov 20, 2014 11:11 pm

Re: Let us override inserters remove fuel from furnaces

Post by darkfrei » Thu Dec 07, 2017 11:25 am

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: 1357
Joined: Wed Jun 10, 2015 10:37 pm

Re: Let us override inserters remove fuel from furnaces

Post by bobucles » Thu Dec 07, 2017 3:17 pm

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: 503
Joined: Fri May 16, 2014 3:44 pm

Re: Let us override inserters remove fuel from furnaces

Post by JohnyDL » Thu Dec 07, 2017 3:52 pm

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: 2579
Joined: Mon Sep 05, 2016 9:10 am

Re: Let us override inserters remove fuel from furnaces

Post by mrvn » Thu Dec 07, 2017 3:56 pm

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: 6039
Joined: Fri May 09, 2014 1:01 pm

Re: Let us override inserters remove fuel from furnaces

Post by bobingabout » Fri Dec 08, 2017 9:14 am

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.

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

Re: Let us override inserters remove fuel from furnaces

Post by Oktokolo » Thu Jan 25, 2018 2:49 am

+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: 1977
Joined: Sat Mar 12, 2016 4:19 pm

Re: Let us override inserters remove fuel from furnaces

Post by steinio » Thu Jan 25, 2018 5:29 am

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[url=steam://friends/add/'.76561198315557255.']Image[/url]
Transport Belt Repair Man
My little mods: Link | My favourite mods: Bob's Mods | Angel's Mods | Yuoki Railway Core | EvoGUI | Logistic Train Network
Factorio Cheat Sheet by Denis Zholob

View unread Posts

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

Re: Let us override inserters remove fuel from furnaces

Post by Caine » Thu Jan 25, 2018 9:07 am

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: 2579
Joined: Mon Sep 05, 2016 9:10 am

Re: Let us override inserters remove fuel from furnaces

Post by mrvn » Thu Jan 25, 2018 12:59 pm

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: 401
Joined: Wed Jul 12, 2017 5:45 pm

Re: Let us override inserters remove fuel from furnaces

Post by Oktokolo » Thu Jan 25, 2018 5:39 pm

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 1408 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

Re: Let us override inserters remove fuel from furnaces

Post by Caine » Thu Jan 25, 2018 6:16 pm

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: 2579
Joined: Mon Sep 05, 2016 9:10 am

Re: Let us override inserters remove fuel from furnaces

Post by mrvn » Mon Jan 29, 2018 9:28 am

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: 401
Joined: Wed Jul 12, 2017 5:45 pm

Re: Let us override inserters remove fuel from furnaces

Post by Oktokolo » Mon Jan 29, 2018 2:56 pm

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: 2579
Joined: Mon Sep 05, 2016 9:10 am

Re: Let us override inserters remove fuel from furnaces

Post by mrvn » Tue Jan 30, 2018 10:27 am

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: 1516
Joined: Thu Nov 20, 2014 11:11 pm

Re: Let us override inserters remove fuel from furnaces

Post by darkfrei » Tue Jan 30, 2018 11:20 am

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: 2579
Joined: Mon Sep 05, 2016 9:10 am

Re: Let us override inserters remove fuel from furnaces

Post by mrvn » Tue Jan 30, 2018 12:00 pm

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: 1977
Joined: Sat Mar 12, 2016 4:19 pm

Re: Let us override inserters remove fuel from furnaces

Post by steinio » Tue Jan 30, 2018 12:15 pm

How about steam powered smelters which can be connected with pipes to substituate solid fuel?
Image[url=steam://friends/add/'.76561198315557255.']Image[/url]
Transport Belt Repair Man
My little mods: Link | My favourite mods: Bob's Mods | Angel's Mods | Yuoki Railway Core | EvoGUI | Logistic Train Network
Factorio Cheat Sheet by Denis Zholob

View unread Posts

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

Re: Let us override inserters remove fuel from furnaces

Post by Oktokolo » Tue Jan 30, 2018 6:34 pm

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: 2579
Joined: Mon Sep 05, 2016 9:10 am

Re: Let us override inserters remove fuel from furnaces

Post by mrvn » Tue Feb 06, 2018 10:35 am

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”