[REQUEST] Oil product-fueled train

This is the place to request new mods or give ideas about what could be done.
Sub6258
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Jan 09, 2018 2:41 am
Contact:

[REQUEST] Oil product-fueled train

Post by Sub6258 »

Basically I want a new train type that can be fueled by crude oil, or any of the byproducts, and loaded with a pump.

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

Re: [REQUEST] Oil product-fueled train

Post by bobingabout »

Sub6258 wrote:Basically I want a new train type that can be fueled by crude oil, or any of the byproducts, and loaded with a pump.
Using current standard methods (not including scripting, it MIGHT be possible to fudge it with scripting, I personally avoid trying to do these kinds of things with scripting), a locomotive(train engine) can only be fuelled with items because it doesn't have a energy_source = line, it instead has a burner = line.

Having said that, I have requested that the ability to use fluids as a fuel source be added to the game....
Current progress with that is that fluids can now have a fuel value, and be burned specifically in an appropriately modded generator entity (The steam engine and turbine) to produce electricity straight from fluid fuels.

Which kind of sucks in it's limitation, because you can't even make oil burning boilers, which I would totally add to the game if it would let me...

and if it were possible, I'd add an oil burning train too for that matter. However, unlike your request, the train would specifically be powered by "Fuel oil", which is a fluid in my huge mod package made from light oil.



Looking at the possibility of your request using scripting... (I am not going to do this personally) it could be possible to have fuel in a fluid wagon behind the locomotive, and a script that checks to see if the fuel box on the locomotive is empty, and if so, removes a certain quantity of fluid from this wagon to add a piece of coal (or other virtual fuel item) which is consumed instantly while the train is running, to simulate it being powered by the fluid in the wagon... you CAN'T add fluids to the locomotive directly, because it can't have a fluid box, and energy remaining appears to be read only. (Hence why it needs to place an item in there to add energy to the entity)
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

batorfly
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Mon Oct 23, 2017 2:57 pm
Contact:

Re: [REQUEST] Oil product-fueled train

Post by batorfly »

That feature is just me gusta, and really fits Factorio. I wish Dev's add this even to vanilla someday.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [REQUEST] Oil product-fueled train

Post by eradicator »

With a slight immersion break you could use fuel packed into one-time containers. I.e. assembler 1000 oil + 1 plastic = 1 burnable fuel canister. The canister can then have a fuel value like a normal item. And as long as you don't add a reverse recipe it can't be used for anything else. (you could do that conversion in script, but then you run into the problem of players taking the container out of the locomotive).
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ—₯本θͺž, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

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

Re: [REQUEST] Oil product-fueled train

Post by bobingabout »

eradicator wrote:With a slight immersion break you could use fuel packed into one-time containers. I.e. assembler 1000 oil + 1 plastic = 1 burnable fuel canister. The canister can then have a fuel value like a normal item. And as long as you don't add a reverse recipe it can't be used for anything else. (you could do that conversion in script, but then you run into the problem of players taking the container out of the locomotive).
Isn't that basically what solid fuel blocks do?

Also, to note, going back to my "Maybe scripting can do this" example, this fluid wagon fuelling the train could possible be an invisible fluid wagon in the same location of the locomotive, that is moved to the locomotive's position whenever the locomotive stops moving, so you can simulate putting a fuel pump hard against the train's engine to fuel it. The issue just comes when trying to see how much fuel is in the train, because all you'd see is the fuel box for putting burnable items in, and a progress bar displaying fuel remaining (of the last item that is being burned).
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [REQUEST] Oil product-fueled train

Post by eradicator »

bobingabout wrote:
eradicator wrote:With a slight immersion break you could use fuel packed into one-time containers. I.e. assembler 1000 oil + 1 plastic = 1 burnable fuel canister. The canister can then have a fuel value like a normal item. And as long as you don't add a reverse recipe it can't be used for anything else. (you could do that conversion in script, but then you run into the problem of players taking the container out of the locomotive).
Isn't that basically what solid fuel blocks do?
When i wrote that i was somehow sure it would be different. Maybe because you're not in-lore making the fluid a non-fluid, merly itemifying it for mechanic reasons. Also originally i wanted to suggeste that this "canister" conversion should only be possible with special assemblers that are attached to stations. But then i thought bleh, that's too close to full scripting again. If it was someone possible to specify that items can't be taken out of a locomotive it would still work :/. (Actually i'd like that feature for several inventories, wonder how likely a feature request would be to work.)
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ—₯本θͺž, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

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

Re: [REQUEST] Oil product-fueled train

Post by darkfrei »

Wood or plastic barrels are very good for burning them with liquids inside.

User avatar
mrudat
Fast Inserter
Fast Inserter
Posts: 229
Joined: Fri Feb 16, 2018 5:21 am
Contact:

Re: [REQUEST] Oil product-fueled train

Post by mrudat »

It isn't what the poster requested, but would it be close to redefine oil (and oil product) barrels to be fuel, with an empty oil barrel as the burnt result?

You'd need to edit the burner energy source of various things, but in theory, this should allow you to fuel anything that now uses coal with oil (in barrels) as well?

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

Re: [REQUEST] Oil product-fueled train

Post by darkfrei »

mrudat wrote:It isn't what the poster requested, but would it be close to redefine oil (and oil product) barrels to be fuel, with an empty oil barrel as the burnt result?
Done: https://mods.factorio.com/mod/BurnBarrels
Now working with:
fuel_values = {
['crude-oil'] = 44, -- MJ/kg
['diesel'] = 45,
['heavy-oil'] = 45,
['biodiesel'] = 38,
['light-oil'] = 38,
['natural-gas'] = 55,
['petroleum-gas'] = 55,
}
Actual fuel values are 60 times lower for balance reason.

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

Re: [REQUEST] Oil product-fueled train

Post by bobingabout »

mrudat wrote:It isn't what the poster requested, but would it be close to redefine oil (and oil product) barrels to be fuel, with an empty oil barrel as the burnt result?

You'd need to edit the burner energy source of various things, but in theory, this should allow you to fuel anything that now uses coal with oil (in barrels) as well?
yes
darkfrei wrote:Done: https://mods.factorio.com/mod/BurnBarrels
Now working with:
fuel_values = {
['crude-oil'] = 44, -- MJ/kg
['diesel'] = 45,
['heavy-oil'] = 45,
['biodiesel'] = 38,
['light-oil'] = 38,
['natural-gas'] = 55,
['petroleum-gas'] = 55,
}
Actual fuel values are 60 times lower for balance reason.
That is a direct conflict with my mod.
Firsly, RL research told me that crude oil was 38MJ/kg, but, lets put that to one side for a moment.
Calculations told me that the old fluid unit measurements were pretty accurate for 1 unit of oil being 1kg of that fluid, so when the "all fluids are multiplied by 10" thing happened, this would mean that you should divide real life values by 10.
This means crude oil should have 3.8MJ as a fuel value.
Plugging in other fuel values in relation to things like solid fuel blocks (25MJ from 10 light oil) means that light oil should have AT LEAST 2.5MJ fuel value per unit, because there's generally a fuel value loss when converting it. (I went with 3MJ)
if you were to take 38 then divide by 60, this gives a fuel value of 633kJ, meaning it only costs 6.33 MJ of liquids to make a 25MJ solid fuel block, which isn't realistic.

since you're burning the barrel which contains 50 units of the fluid (I think), that would mean that you should be multiplying the value by 5 to give the fuel for each barrel.

I have no issue with you using fuel values different from my own, but I would request you try and keep it in the same kind of area... between 1 and 10MJ per unit for base game fluids. (on that point, I have 2 fluids less than 1MJ in my mod. Hydrazine and Hydrogen)
for reference, the devs specified crude oil in the base game as being 8MJ per unit, but then commented it out, which is about double of what I think it should be.

I put a lot of effort into calculating balance for these sorts of things, as should be highlighted by the fact that I pretty much just reeled off everything above off the top of my head. the only thing I had to look up was how many light oil it takes to make a fuel block. (Which I should honestly have remembered, the good old days before the fluid multiplication, it was 2, 1, 2. That's a cost of 2 for Heavy oil and Petroleum Gas, or 1 for light oil.)

Another reference I used was KS Power, Klonan's mod because he's a game dev. I think all his fuel values were between 1MJ and 5MJ.

oh, right, Fluids CAN have a fuel value.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

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

Re: [REQUEST] Oil product-fueled train

Post by darkfrei »

Thanks for the reply, bobingabout.
The main reference by me was the table from https://en.m.wikipedia.org/wiki/Heat_of_combustion and http://www.world-nuclear.org/informatio ... fuels.aspx
But it's can't be used as_is by the Factorio: it looks too powerful.

So I've opened https://wiki.factorio.com/Solid_fuel and get: one solid fuel has more or less the same energy as 20 amounts of heavy oil. Then one amount of heavy oil has about 1.25 MJ energy. If this fluid is the same as diesel, the I need some factor to get more or less same energy. For the first time I've got 60, it's the standard factor for all things in Factorio.

Now I see that this factor must be 36: then 1 kg of this liquid is exactly 36 amounts of the game fluid.

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

Re: [REQUEST] Oil product-fueled train

Post by bobingabout »

Where did my reply go?...

I posted another very long reply going through my maths.

summery though...
I used light oil as the pivot point, not heavy oil, which only costs 10 to make a fuel block, not 20. So that puts light oil as 2.5MJ per unit.
Then I said... converting from a liquid to a solid is a convenience thing, and therefore should have an energy loss, so lets give light oil 3MJ
but light oil isn't designed to be a fuel, lets add diesel as a fuel with an even better fuel value, lets go with 4MJ, to encourage you to process oils into that to use as a fuel.
then compare that to your RL numbers for fuels, and you end up about 10. (your values would actually make it 12.5)

I actually went through all my maths, but I'm not typing all that up again.

Also, I looked at KS power as a starting point, even though Klonan admitted "I just threw in some random numbers and it seemed to work."
those numbers I think were like, 2MJ for heavy oil, 3MJ for light oil, and 4MJ for diesel, or something like that, which is why I used 3MJ for light oil as a lossy value.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

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

Re: [REQUEST] Oil product-fueled train

Post by darkfrei »

bobingabout wrote: ↑
Wed Sep 12, 2018 8:11 am
Where did my reply go?
viewtopic.php?f=33&t=56384#p378314

Heavy oil is something like heavy crude ouil, light oil is something like light crude oil. The light oil in this case is the best fuel for cars and tanks.
The petroleum gas is something like liquefied petroleum gas.

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

Re: [REQUEST] Oil product-fueled train

Post by bobingabout »

darkfrei wrote: ↑
Wed Sep 12, 2018 10:49 am
bobingabout wrote: ↑
Wed Sep 12, 2018 8:11 am
Where did my reply go?
viewtopic.php?f=33&t=56384#p378314
no, I actually wrote ANOTHER long reply, that fully explained everything I summarised in the previous one.
I think the forum update might have eaten it.

According to my notes, these are the fuel values I added to fluids. (yes, to fluids, as used by fuel burning entities)

crude oil = 3.8MJ
Petroleum Gas = 4.6MJ
Light oil = 3MJ (same as KS Power)
Heavy oil = 2MJ (same as KS Power)
Liquid Fuel = 4MJ (same as Diesel in KS Power)
glycerol = 1.46MJ
Hydrogen = 90kJ (IRL 142MJ/kg makes it 7.1MJ in my mod. In my mod Hydrogen has a 2x ratio compared to other fluids. Other gasses have a 2.5x ratio)
hydrazine = 380kJ

Hydrogen has an "unrealistic" number for balancing reasons. The alternative would be to have far less of it produced than actually is, but then use tiny amounts like 0.05 for recipes, which seems silly... so hydrogen is taken to be not compressed.

also in my notes:
LPG has a typical specific calorific value of 46.1 MJ/kg compared with 42.5 MJ/kg for fuel oil and 43.5 MJ/kg for premium grade petrol (gasoline)
probably from Wikipedia or google or something.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

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

Re: [REQUEST] Oil product-fueled train

Post by darkfrei »

bobingabout wrote: ↑
Wed Sep 12, 2018 4:55 pm
According to my notes, these are the fuel values I added to fluids. (yes, to fluids, as used by fuel burning entities)

crude oil = 3.8MJ
Petroleum Gas = 4.6MJ
Light oil = 3MJ (same as KS Power)
Heavy oil = 2MJ (same as KS Power)
Liquid Fuel = 4MJ (same as Diesel in KS Power)
glycerol = 1.46MJ
Hydrogen = 90kJ (IRL 142MJ/kg makes it 7.1MJ in my mod. In my mod Hydrogen has a 2x ratio compared to other fluids. Other gasses have a 2.5x ratio)
hydrazine = 380kJ
So, new version has
light-oil.fuel_value = "2.5MJ"
petroleum-gas.fuel_value = "1.25MJ"
heavy-oil.fuel_value = "1.25MJ"
heavy-oil-barrel.fuel_value = "62.5MJ"
light-oil-barrel.fuel_value = "125MJ"
petroleum-gas-barrel.fuel_value = "62.5MJ"
All values are coming automatically, here can be some errors for not-vanilla-like-standard-recipes.
https://mods.factorio.com/mod/BurnBarrels

So with bob&angel:
light-oil.fuel_value = "2.5MJ"
petroleum-gas.fuel_value = "1.25MJ"
heavy-oil.fuel_value = "1.25MJ"
water.fuel_value = "0MJ"
water.fuel_value = "1.6MJ"
water.fuel_value = "3MJ"
water.fuel_value = "5.4MJ"
water.fuel_value = "6.4MJ"
hydrogen.fuel_value = "0.14285714285714MJ"
gas-hydrogen.fuel_value = "0.6MJ" -- why not just hydrogen?
gas-carbon-dioxide.fuel_value = "0.51428571428571MJ" -- wrong
water-purified.fuel_value = "0.2MJ" -- wrong
gas-carbon-monoxide.fuel_value = "0.5MJ"
gas-methane.fuel_value = "0.5MJ"
liquid-naphtha.fuel_value = "0.5MJ"
liquid-fuel-oil.fuel_value = "1MJ"
gas-synthesis.fuel_value = "0.5MJ"
gas-hydrazine.fuel_value = "1MJ"
water.fuel_value = "2.08MJ" -- wrong
water.fuel_value = "2.8MJ" -- wrong
water.fuel_value = "4.16MJ" -- wrong
water.fuel_value = "0.8MJ" -- wrong
water.fuel_value = "0.8MJ" -- wrong
water-light-mud.fuel_value = "0.8MJ"
water-light-mud.fuel_value = "0.8MJ"
water-saline.fuel_value = "0.8MJ" -- wrong
water-saline.fuel_value = "0.8MJ" -- wrong
water-barrel.fuel_value = "40MJ" -- wrong
heavy-oil-barrel.fuel_value = "62.5MJ"
light-oil-barrel.fuel_value = "125MJ"
petroleum-gas-barrel.fuel_value = "62.5MJ"
water-saline-barrel.fuel_value = "40MJ" -- wrong
water-purified-barrel.fuel_value = "10MJ"
water-light-mud-barrel.fuel_value = "40MJ"
gas-hydrogen-barrel.fuel_value = "30MJ"
gas-carbon-monoxide-barrel.fuel_value = "25MJ"
gas-carbon-dioxide-barrel.fuel_value = "25.714285714286MJ" -- wrong
gas-methane-barrel.fuel_value = "25MJ"
liquid-naphtha-barrel.fuel_value = "25MJ"
liquid-fuel-oil-barrel.fuel_value = "50MJ"
gas-synthesis-barrel.fuel_value = "25MJ"
gas-hydrazine-barrel.fuel_value = "50MJ"
Last edited by darkfrei on Sun Sep 16, 2018 2:38 pm, edited 1 time in total.

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

Re: [REQUEST] Oil product-fueled train

Post by bobingabout »

That looks reasonable... except water, WTF is going on there?
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

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

Re: [REQUEST] Oil product-fueled train

Post by darkfrei »

bobingabout wrote: ↑
Thu Sep 13, 2018 10:02 pm
That looks reasonable... except water, WTF is going on there?
It looks like the script has found water as inreduent and some burnable item as result in one of a lot enabled mods. Or I can solve the energy crysis in whole world. :o

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [REQUEST] Oil product-fueled train

Post by eradicator »

darkfrei wrote: ↑
Fri Sep 14, 2018 5:19 am
bobingabout wrote: ↑
Thu Sep 13, 2018 10:02 pm
That looks reasonable... except water, WTF is going on there?
It looks like the script has found water as inreduent and some burnable item as result in one of a lot enabled mods. Or I can solve the energy crysis in whole world. :o
Water is 66% Hydrogen :p.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ—₯本θͺž, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

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

Re: [REQUEST] Oil product-fueled train

Post by darkfrei »

eradicator wrote: ↑
Fri Sep 14, 2018 6:20 am
Water is 66% Hydrogen :p.
Or 11%: only 2 units masses of hydrogen in 18 units masses water.

If the script found hydrogen (fluid), it will ignore it. Only items are allowed as reference for fuel energy. I must test it more and ignore this situations.

If I made some fuel from the water, why water can't be fuel? This recipe must have very long time, then the energy in the result item can be bigger than in ingredient fluid.

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

Re: [REQUEST] Oil product-fueled train

Post by bobingabout »

darkfrei wrote: ↑
Fri Sep 14, 2018 7:11 am
If the script found hydrogen (fluid), it will ignore it. Only items are allowed as reference for fuel energy. I must test it more and ignore this situations.
I would say Carbon Dioxide should be ignored too, but then when does the list of exclusions end?
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Post Reply

Return to β€œIdeas and Requests For Mods”