I don't know why 'factorio' makes such a fuss about "leeching"

Post all other topics which do not belong to any other category.
Post Reply
StupidInserter
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Nov 09, 2022 7:20 pm
Contact:

I don't know why 'factorio' makes such a fuss about "leeching"

Post by StupidInserter »

Hi guys,
New to this game and its great! So great that i feel the urge to write here about my frustration.

What on earth is fuel leeching?

I simply dont understand why an inserter can put fuel into a boiler and take it out, but that same stupid inserter can't do that with the locomotive

For an idea i have for a "train refuel station" i need the inserters to be able to:
Put into the locomotive AND take out 1,2 or whatever number of fuel items i want. (Circuit controlled)

Trying to "bruteforce" my way, i looked for mods, but i don't like that route, bc of fear of crashes. But I eventually did try one, but even that didnt work.

So i dug further and wanted to challenge me and make my own "mod",.... along the simplistic thought of add a line somewhere.....only to find out that

1. There was a version some time ago where it was possible for locomotive to get their fuel taken out (but no longer possible now)
And
2. That there is some 'feature' called allow_burner_leech = true/false, but it can't be simply set to true/false via the command line console. At least i dont know how . I did in this process learn how to use teleport and fill my inventory and be in god-mode, but no f*k ;) setting where my stupid inserter takes that fuel out the other one just put in.
BTW.! I don't even know if allow_burner_leech = true/false would help me...
I can make so many things through the command line console, but not make a inserter take out fuel? Even though it was once even a normality in a previous version?

Oh well, long story short: please put somewhere a checkbox (on the inserter?, in general startup settings?) That makes inserters put stuff in AND out of stuff and not like a black hole...it goes in but not out. If its potentially exploitable, solve the exploit not hammer it like this by simply stopping stuff to work in a logical way: Put In / Put Out

And second what was the rational to remove this ability, since once it was possible??? I'd love to know

Ps: just to be clear: i only want the inserters to be able to take out the "fuel-item" i see in the "fuel storage"...not some "magic" "fuel-sucking" inserter that takes some amount of fuel represented by that red bar/indicator under the fuel storge and "converts" it back into a piece of fuel. Just 1 to 1.


Thanks and sorry if this post comes across as a rant. Take it as a "please implement in the future"
Vanilla, not by mod. Or at least simple command access via console just as teleporting around.

Pi-C
Smart Inserter
Smart Inserter
Posts: 1639
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: I don't know why 'factorio' makes such a fuss about "leeching"

Post by Pi-C »

StupidInserter wrote:
Wed Nov 09, 2022 8:16 pm
2. That there is some 'feature' called allow_burner_leech = true/false, but it can't be simply set to true/false via the command line console.
You can use inserter.prototype.allow_burner_leech to read whether an inserter can leech fuel. However, the property can only be changed in the prototype, which is only possible during the data stage. You could add something like this to data-final-fixes.lua:

Code: Select all

for i, inserter in pairs(data.raw.inserter) do
  inserter.allow_burner_leech = true
end
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2483
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: I don't know why 'factorio' makes such a fuss about "leeching"

Post by FuryoftheStars »

StupidInserter wrote:
Wed Nov 09, 2022 8:16 pm
I simply dont understand why an inserter can put fuel into a boiler and take it out, but that same stupid inserter can't do that with the locomotive
Iirc, there's already a thread on the subject (probably in the suggestion section) where it was explained that when fuel leeching from locomotives was allowed, it was causing too many problems for people trying to create train stops that could service different sized trains, or trains that would park in offset positions, and the devs decided the easiest way to handle it was just to simply disable the behavior.

Really, though, the only "fuss" about it has been created by the people that want it.

Are there ways the devs could probably handle it without disabling it completely? I'm sure there is. They just haven't done so yet, most likely because they're not considering it a high gain issue.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

StupidInserter
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Nov 09, 2022 7:20 pm
Contact:

Re: I don't know why 'factorio' makes such a fuss about "leeching"

Post by StupidInserter »

Thanks guys! thanks for the help to add Code and explain why it was disabled


But i tried what you suggested but the inserter still doesnt take coal out of the locomotive,
maybe as i already worte: adding allow_burner_leech isnt afterall the solution to my problem

here is what i did:

1.edited data-updates.lua in folder factorio/data/base with your code -> it works, see below
2.started a new game...all cheats enabled.
3.added a track,a locomotive,a inserter,put in coal in loco.
4.wrote this in command line:

Code: Select all

/c for key,ent in pairs (game.player.surface.find_entities_filtered{type="inserter"}) do   
	game.player.print(ent.prototype.allow_burner_leech)
	game.player.print(key)
end
and it gives true result with 1 found

i also tried with:
created the folder structure for MODs as per wiki added two files:
1.info.json
2.data-final-fixes.lua
3.edited info.json as per wiki with dummy data -> my "mod" shows up after startup
4.edited data-final-fixes.lua as per your suggestion -> same it shows true but doesnt make the inserter take fuel out of loco


Tso as i understand:

allow_burner_leech does nothing for this kind of behavior and
inserters are "hard-coded" to not allow to take fuel out of fuel inventory

i noticed something probably irrelevant, but anyways:

I added afterwards a second inserter (command line above now shows 2 and true) to put coal IN the loco and at the same time
the first inserter _should_ take out the coal, well the second inserter does put in coal and the first still does not take
the coal OUT. So I enabled "show-debug-info-in-tooltips" via F4, and in the tooltips the in "wakeup list count" is flickering
between 1 and 0 for the first inserter. So he gets for a tick the command to take it out and at the second tick it gets disabled.

What do you think should this post go under "Suggestions for the Future"?


Concering the rational to disable this feature bc it made problems for players that had a bad train design(stoping loco in wrong spots, ect.)
i understand, but the happiness of some is the unhappines of others if you dont do it right. Hail democracy!

yours,
stupidinserter

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2483
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: I don't know why 'factorio' makes such a fuss about "leeching"

Post by FuryoftheStars »

StupidInserter wrote:
Thu Nov 10, 2022 10:24 am
Concering the rational to disable this feature bc it made problems for players that had a bad train design(stoping loco in wrong spots, ect.)
i understand, but the happiness of some is the unhappines of others if you dont do it right. Hail democracy!
You misunderstand. They weren't bad train designs.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

mmmPI
Smart Inserter
Smart Inserter
Posts: 2674
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: I don't know why 'factorio' makes such a fuss about "leeching"

Post by mmmPI »

FuryoftheStars wrote:
Thu Nov 10, 2022 12:56 pm
StupidInserter wrote:
Thu Nov 10, 2022 10:24 am
Concering the rational to disable this feature bc it made problems for players that had a bad train design(stoping loco in wrong spots, ect.)
i understand, but the happiness of some is the unhappines of others if you dont do it right. Hail democracy!
You misunderstand. They weren't bad train designs.
I think if the design were loading fuel on cargo wagon by mistake, they were indeed "bad" (station) design, like they didn't function properly/as expected. There were complaints for the game to be changed to make those design viable when they weren't.

I think i remember that since that time some things have changed about loading/unloading trains at a station/ immobile at a signal which had also caused sometimes wrong loading/unloading and complaints.

However, the concept of "refueling station" is also imo a "bad" design as it creates an unecessary bottleneck/ additionnal non-redundant potential failure point. It's "better" (imo) to have one or several "refueling train" used to distribute the fuel, at least in case of a problem in the fuel supply ( or at the refueling station) you don't end up with all your trains queued up in the same location.

Such similar argument must have been weighted at the time of the removal of the fuel leech, which broke some designs. It is not made to be easy in the vanilla game to create such refueling station as it is also not possible to read the fuel in a locomotive/train , and/or to make a dynamic train schedule.

I think the current "leeching" refers to when a burner inserter take fuel out of a boiler, to give it to another boiler, or for themselves so that can continue transfering fuel from a boiler to another as you described, and that to achieve what you expected you'd need to change the locomotive.

I played with a mod in which a train's fuel is a barrel of fuel, and when it's empty you got an empty barrel that inserter can take out of the locomotive. https://mods.factorio.com/mod/kj_warrig, that seem like a big change though. not just 1 line somewhere. ( plus the mod add custom looking rail and the locomotive has a truck sprite) I'm not sure the method used would function in a case where you want to remove a "fuel" and not a "burnt fuel" but maybe it can help as an example of code that allow inserter to remove things out of a locomotive.

Now when using this mod i had trains that would park in offset positions which forced me to use filter inserter to unload the cargo to avoid grabbing the empty barrel by mistake not the most elegant solution if you consider the multi purpose station, as you quickly need to add combinators to change the inserter's filter depending on trains, and it's not easy to identify a train because their ID is modified if a wagon is destroyed. For a refueling station it would be more appropriate, but it's a refueling station :( .

One thing to keep in mind is that you can have infinite fuel with the crude oil=> solid fuel receipe and the inserted fuel in a locomotive will eventually get burnt if given time and if the train is needed, therefore in the current state of the game there is little need to "remove" something from a locomotive, it can 'mostly' be solved with just waiting and adding more/new fuel.

Maybe it would allow more compact design to be able to daisy-chain the fuel on locomotive like for boilers, but rails uses a 2x2 grid and if you load or unload them somewhere there is most likely already enough room there to have an underground belt bringing the fuel perpendicular to the track(s). Overall i didn't mind the removal of the leeching ( even if it broke some designs potential in favor of simplicity ) for those reasons.
StupidInserter wrote:
Thu Nov 10, 2022 10:24 am
What do you think should this post go under "Suggestions for the Future"?
Sometimes a suggestion sparks a discussion, sometimes the other way around, it's not easy to pick the correct place the fit the rigid boxes of the forum, but also it's no big deal :) , maybe you'd get more specific help for modding in the modding help part without the "fuss" that can arise in discussions

I think there is very little chances that this become possible again in the vanilla game, as it was a quite a frequent 'problem' players encountered when trying to design a train station, which is already amongst the "difficult things" in factorio, if you look at the steam achievement % of players get. But it occasionnaly happen that there is a request or a question about this, there must be a existing thread/suggestion that you could +1 somewhere, it's not as frequent as the opposite suggestion was regarding the democratic aspect of things.

There is another thing that exist on the forum that is "suggestion for things to be available to modders for modification" that's not the real name but you can request a thing to be changed in the game so that it unlock new possibilities for mod making. It's not very democratic because you need to have quite some knowledge about programming in general and factorio code experience to make a proposition that make sense in the first place, but i'm not complaining about that x), it sort of come as "last resort" when no elegant solution can be currently proposed to a shared use case.

Tertius
Filter Inserter
Filter Inserter
Posts: 650
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: I don't know why 'factorio' makes such a fuss about "leeching"

Post by Tertius »

StupidInserter wrote:
Wed Nov 09, 2022 8:16 pm
I simply dont understand why an inserter can put fuel into a boiler and take it out, but that same stupid inserter can't do that with the locomotive
As far as I see it, this is the core of your thread.

Simple answer: it was made like this by the devs.

Extended answer: It gives the opportunity for a static installation like a boiler array to be fed from a single point. Locomotive locations are not static. Chaining fuel provision makes no sense for locomotives, because they are never next to each other. You also don't have a large amount of locomotives in comparison to boilers.
Then there is the concept of an inventory. The fuel inventory of a locomotive is not meant to be an inventory similar to the inventory of a wagon, which has the purpose to transport items from one location to another. In comparison to that, the fuel inventory of a locomotive is just an internal buffer for the fuel supply in case the locomotive runs out of fuel out in the field. If you actually want to transport fuel from one location to another, use a mechanic that is made for this: belts, wagons, logistic robots.

A comment by me: chaining fuel provision is usually not feasible, because it makes a factory unreliable. It always happens that a fueled device runs out of fuel, because an inserter just took the fuel away to give it the next device in the row. I never use this.

The self-providing burner inserter is a completely different thing: it needs fuel and just taps the fuel supply it is to transport. It's a convenience function the inserter doesn't need an inserter itself to be fueled, or just a solution of a chicken-egg problem.

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2483
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: I don't know why 'factorio' makes such a fuss about "leeching"

Post by FuryoftheStars »

Tertius wrote:
Thu Nov 10, 2022 7:23 pm
I think the main reason I've seen why some people want fuel "leeching" with locomotives is more so for "sub-par" fuel removal (remove all the coal once solid fuel is available, remove solid fuel once rocket fuel is available, etc), though there have been the occasional people that just want it so they can feed their parked trains in a line with pure inserters and save themselves a few belts.... :roll:
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

StupidInserter
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Nov 09, 2022 7:20 pm
Contact:

Re: I don't know why 'factorio' makes such a fuss about "leeching"

Post by StupidInserter »

Thanks again for all the answers!
However, the concept of "refueling station" is also imo a "bad" design as it creates an unecessary bottleneck/ additionnal non-redundant potential failure point. It's "better" (imo) to have one or several "refueling train" used to distribute the fuel, at least in case of a problem in the fuel supply ( or at the refueling station) you don't end up with all your trains queued up in the same location.
Yes, i agree that every non-redundant design is not super reliable per definition, hence to have a refueling station "on top" of other design considerations.
Such similar argument must have been weighted at the time of the removal of the fuel leech, which broke some designs. It is not made to be easy in the vanilla game to create such refueling station as it is also not possible to read the fuel in a locomotive/train , and/or to make a dynamic train schedule.
Yes, the "read the fuel in a locomotive" would all together eliminate my necessity for a remove fuel from locomotive, so maybe ill +1 on whoever
as already ased for this to be implemented for the future. dynamic train schedule...WOW would also be great!
I think the current "leeching" refers to when a burner inserter take fuel out of a boiler, to give it to another boiler, or for themselves so that can continue transfering fuel from a boiler to another as you described, and that to achieve what you expected you'd need to change the locomotive.
Yes, I also understand now that Leeching has nothing to do with the possibility to take out fuel from burners.. but is only something for
specifically "burner inserters"... so not relevent for the problem.
I played with a mod in which a train's fuel is a barrel of fuel, and when it's empty you got an empty barrel that inserter can take out of the locomotive. https://mods.factorio.com/mod/kj_warrig, that seem like a big change though. not just 1 line somewhere. ( plus the mod add custom looking rail and the locomotive has a truck sprite) I'm not sure the method used would function in a case where you want to remove a "fuel" and not a "burnt fuel" but maybe it can help as an example of code that allow inserter to remove things out of a locomotive.
I'll happily look into your suggestion of mod "kj_warring" , but as stated in the first post...i'm not so in to mod's...don't wanna risk breaking
save games...even though, as i could understand from the "data lifecycle" on the official factorio api documentation its pretty foolproof.


overall a really appreciate the time you gave for your thorough anwser!


Simple answer: it was made like this by the devs.
Thanks for explaining
Indeed its "hard-coded" - and has not to do with burner leech
Its not that obvious that the "fuel inventory" is different for "normal inventory" , but thats more of a grafical/gui thingy.



I think the main reason I've seen why some people want fuel "leeching" with locomotives is more so for "sub-par" fuel removal (remove all the coal once solid fuel is available, remove solid fuel once rocket fuel is available, etc), though there have been the occasional people that just want it so they can feed their parked trains in a line with pure inserters and save themselves a few belts.... :roll:
No not at all. This does not apply to my "refuel station".
I was building on top of an idea i read on reddit to measure the difference in "acceleration" of the train and by that to determin
if the loco is running out of fuel.

So in essence , what i wish is to read how much fuel a loco has left. I only needed the "take the fuel out of loco" feature
to be able to make this idea work.
overview idea: put better acceleration fuel first and worse last: say 50+50 solid fuel and 50 coal...when loco runs out of fuel
i can measure that, then send a signal to activate "train refuel staion 1 and 2 and 3", in sequence. at first station loc gets all fuel removed at second gets 50+50 solid fuel filled at third gets 50 coal filled... done! Train ran out of fuel, was send to refuel itself, and is back on his way to do its stuff


Great forum!

Thanks guys... meanwhile my base is getting overrun by bitters....buhhuhaha

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: I don't know why 'factorio' makes such a fuss about "leeching"

Post by kovarex »

Being able to remove fuel from locomotives will be (is already) avilable in 1.2, it actually has a good reason, to be able to automatically upgrade fuel type in your train system (apart the obvious system where you put fuel from locomotive to locomotive)

astroshak
Filter Inserter
Filter Inserter
Posts: 597
Joined: Thu May 10, 2018 9:59 am
Contact:

Re: I don't know why 'factorio' makes such a fuss about "leeching"

Post by astroshak »

Always figured fuel upgrading would be accomplished by feeding it better fuel as it consumed the (now obsolete) existing fuel, not by draining the existing fuel and replacing with better fuel.

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2483
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: I don't know why 'factorio' makes such a fuss about "leeching"

Post by FuryoftheStars »

astroshak wrote:
Sat Nov 19, 2022 3:29 pm
Always figured fuel upgrading would be accomplished by feeding it better fuel as it consumed the (now obsolete) existing fuel, not by draining the existing fuel and replacing with better fuel.
Me too. This would be my preferred option.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

Tertius
Filter Inserter
Filter Inserter
Posts: 650
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: I don't know why 'factorio' makes such a fuss about "leeching"

Post by Tertius »

I don't see a point in removing fuel from a locomotive as well. If I upgrade the fuel supply, the locomotive will just consume its old fuel and refills with the new fuel as slots become available. I would not build a facility to remove fuel for this purpose. The speed improvement from fuel type to fuel type does not justify that for me. And what should I do with the extracted fuel? Just keep it and burn it in the locomotive. Of course this is only how I personally would handle this.

mmmPI
Smart Inserter
Smart Inserter
Posts: 2674
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: I don't know why 'factorio' makes such a fuss about "leeching"

Post by mmmPI »

I have now updated my belief about the possibility of removing fuel from a locomotive in the future :)

I would definitly try to play with that, it would make it easier to "read" the fuel in a loco as you can simply put the fuel back !

versus the current possibility of counting the fuel you add in a locomotive which is not convenient: as for the refueling station obvisouly it is not easy to detect a low-on-fuel train to be sent somewhere or trigger logic if the measurement is made at the same time as the refiling , also i always had this idea in the back of my head that you could measure the fuel consumption of a train and compare it with the time it needs to complete a journey ( by timing when/where train ID is detected) to get a estimation of growing congestion overtime, triggering logic or just some alerts :)

I think it's best of both world if it's possible again, as i expect the current easy-to-avoid-removing-fuel-by-mistake-behavior will be the norm, but i guess there will be the option available to also set things up to do more advanced things. I expect more changes to the train system in general from reading other threads than only the possibility to remove fuel from loco, maybe conditionnal schedule who knows :D

Brambor
Fast Inserter
Fast Inserter
Posts: 125
Joined: Thu May 07, 2015 1:52 pm
Contact:

Re: I don't know why 'factorio' makes such a fuss about "leeching"

Post by Brambor »

kovarex wrote:
Sat Nov 19, 2022 1:52 pm
Being able to remove fuel from locomotives will be (is already) avilable in 1.2, it actually has a good reason, to be able to automatically upgrade fuel type in your train system (apart the obvious system where you put fuel from locomotive to locomotive)
I wanted to do the
> apart the obvious system where you put fuel from locomotive to locomotive

Anyway, was 1.2 scrubbed? I was hoping for that feature in my current gameplay. I wanted to read the train fuel, then learned, you cannot even remove fuel from trains by inserter.
I ended up installing https://mods.factorio.com/mod/Train_Control_Signals for refuelling stations.

But I liked my idea of trains passing fuel on better. It would be a fun challenge!

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2483
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: I don't know why 'factorio' makes such a fuss about "leeching"

Post by FuryoftheStars »

Brambor wrote:
Wed May 03, 2023 11:14 pm
Anyway, was 1.2 scrubbed?
If you'll check out the bug section of the forums, you'll see a subsection for "Fixed for 1.2". They are still moving some reports in there, which tells me no, 1.2 had not been scrubbed.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

Post Reply

Return to “General discussion”