Removing fluid temperature - thoughts?

Place to post guides, observations, things related to modding that are not mods themselves.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 3550
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Removing fluid temperature - thoughts?

Post by Klonan » Sat Jan 19, 2019 1:00 pm

We have an idea, that it might worthwhile to remove the temperature concept from fluidboxes.
There are a few problems with temperature:
  • It is hard to know how much energy is in a given volume of hot fluid, without knowing some internal hidden values.
  • Mixing of fluids of different temperatures can cause the same problems as mixing different fluids.
  • The temperature filters are not shown or intuitive.
  • There is not much support, usage or interactions for temperature in the game.
  • We could make some reasonably large performance gains by removing the temperature.
For its replacement, we already have the prototype defined 'fuel value', which can intuitively show how much energy it has per unit.

What are your thoughts?
Do you do something super interesting that is only possible with temperature?
Would it be a huge loss if we removed temperature?
If it were to be removed, would you request some functionality in its place?
Do you have any differing suggestions for the fluid and temperature systems?

Hexicube
Fast Inserter
Fast Inserter
Posts: 192
Joined: Wed Feb 24, 2016 9:50 pm
Contact:

Re: Removing fluid temperature - thoughts?

Post by Hexicube » Sat Jan 19, 2019 1:14 pm

How will this affect steam engines and turbines? Currently turbines only draw double the steam but produce far more power due to the vastly increased temperature, and engines attempting to use that 500C steam will be inefficient.

My assumption is that the output rate of exchangers and input rate of turbines will be increased dramatically in order to roughly maintain the existing ratio.

theolderbeholder
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Wed Sep 20, 2017 5:45 pm
Contact:

Re: Removing fluid temperature - thoughts?

Post by theolderbeholder » Sat Jan 19, 2019 1:15 pm

Except for water being turned into steam, temperature is currently unused anyway, isn´t it? I seem to remember it being possible to use other fluids in boilers as well, but do we really want (still) hot sulfuric acid (or lubricant) dissolvig (or burn down) parts of our power plant?

Modders might disagree (and most probably will rather soon), but I would not miss temperature.

Boodals
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Sun Feb 11, 2018 7:10 pm
Contact:

Re: Removing fluid temperature - thoughts?

Post by Boodals » Sat Jan 19, 2019 1:17 pm

Klonan wrote:
Sat Jan 19, 2019 1:00 pm
Do you do something super interesting that is only possible with temperature?
Being able to mix fluids of different temperature to a more-useful temperature is something that i'd like to explore.

For example, a mod adds:
A fluid "coolant"
Certain machines that heat coolant to a high temperature.
A cooling machine to cool the coolant back to a usable temperature, but it can't accept coolant that is as hot as the other machines output.

The solution? Mix hot coolant with freshly made (cold) coolant to a temperature that is safe for the cooling machine to handle. A new, interesting and unique mechanic.

However, thinking the idea through further.. Once a factory is set up, it would work somewhat like coal liquefaction. A small amount of heavy oil (cold coolant) is required to convert the coal (hot coolant) into more heavy oil (cold coolant).
If we instead had two fluids, "[cold] coolant" and a separate "hot coolant", we could get a similar result without temperatures. The only difference would be that the temperature mixing would be done "in the cooling machine" instead of in the pipe network. This would remove the "fun" of getting the hot-cold ratio correct, for the better or worse.

theolderbeholder
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Wed Sep 20, 2017 5:45 pm
Contact:

Re: Removing fluid temperature - thoughts?

Post by theolderbeholder » Sat Jan 19, 2019 1:18 pm

Hexicube wrote:
Sat Jan 19, 2019 1:14 pm
How will this affect steam engines and turbines?
Easiest might be a second steam (hot or high pressure?) steam emulating current temperature behavior with steam engine/turbines.

Amarula
Fast Inserter
Fast Inserter
Posts: 116
Joined: Fri Apr 27, 2018 1:29 pm
Contact:

Re: Removing fluid temperature - thoughts?

Post by Amarula » Sat Jan 19, 2019 3:23 pm

I would not be upset if fluid temperature was removed; having two items, hot fluid and cold fluid, handles a lot of use cases, and having the fuel value provides more fine-grained control when that is needed.
theolderbeholder wrote:
Sat Jan 19, 2019 1:15 pm
I seem to remember it being possible to use other fluids in boilers as well, but do we really want (still) hot sulfuric acid (or lubricant) dissolvig (or burn down) parts of our power plant?
I learn new things every time I come to the forums. Excuse me while I go pipe some acid into my boilers :D

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 3550
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Removing fluid temperature - thoughts?

Post by Klonan » Sat Jan 19, 2019 3:26 pm

Boodals wrote:
Sat Jan 19, 2019 1:17 pm
Klonan wrote:
Sat Jan 19, 2019 1:00 pm
Do you do something super interesting that is only possible with temperature?
The solution? Mix hot coolant with freshly made (cold) coolant to a temperature that is safe for the cooling machine to handle. A new, interesting and unique mechanic.

However, thinking the idea through further.. Once a factory is set up, it would work somewhat like coal liquefaction. A small amount of heavy oil (cold coolant) is required to convert the coal (hot coolant) into more heavy oil (cold coolant).
If we instead had two fluids, "[cold] coolant" and a separate "hot coolant", we could get a similar result without temperatures. The only difference would be that the temperature mixing would be done "in the cooling machine" instead of in the pipe network. This would remove the "fun" of getting the hot-cold ratio correct, for the better or worse.
How would you control this? You would need to use pumps and measure the temperature of the fluid and only add hot/cold water when the temperature is out of the desired range,
But still, the temperature mixing isn't ideal, so you would get hotspots or cold spots in the middle of a system, which can't really be accounted for easily

User avatar
disentius
Fast Inserter
Fast Inserter
Posts: 183
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: Removing fluid temperature - thoughts?

Post by disentius » Sat Jan 19, 2019 4:08 pm

From play and performance perspective:
Excellent idea!

How would you adjust the (only) current use case, the two steam temperatures? for nuclear/steam engines?

Boodals
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Sun Feb 11, 2018 7:10 pm
Contact:

Re: Removing fluid temperature - thoughts?

Post by Boodals » Sat Jan 19, 2019 5:19 pm

Klonan wrote:
Sat Jan 19, 2019 3:26 pm
Boodals wrote:
Sat Jan 19, 2019 1:17 pm
...
How would you control this? You would need to use pumps and measure the temperature of the fluid and only add hot/cold water when the temperature is out of the desired range,
But still, the temperature mixing isn't ideal, so you would get hotspots or cold spots in the middle of a system, which can't really be accounted for easily
I was envisioning a custom scripted temperature sensor hooked up to a tank, with two pumps in and one out. Pump-out only activates when the temperature is in the acceptable range. Pumps-in activate to add more hot/cold coolant.
Using a tank should solve the hotspot/coldspot issue as you can more finely adjust the temperature thanks to the larger capacity. The pump-out is for safety, incase the input coolant is the wrong temperature for whatever reason, etc.

nosports
Fast Inserter
Fast Inserter
Posts: 166
Joined: Fri Jan 19, 2018 5:44 pm
Contact:

Re: Removing fluid temperature - thoughts?

Post by nosports » Sat Jan 19, 2019 5:46 pm

Boodals wrote:
Sat Jan 19, 2019 1:17 pm
However, thinking the idea through further.. Once a factory is set up, it would work somewhat like coal liquefaction. A small amount of heavy oil (cold coolant) is required to convert the coal (hot coolant) into more heavy oil (cold coolant).
If we instead had two fluids, "[cold] coolant" and a separate "hot coolant", we could get a similar result without temperatures. The only difference would be that the temperature mixing would be done "in the cooling machine" instead of in the pipe network. This would remove the "fun" of getting the hot-cold ratio correct, for the better or worse.
Indeed i think you should take this approach......

create a recipe category 'heat-exchange' and model the heat exchanger to be able to recieve this category and working like a assembler
So you can eliminate the whole temperature mechanic and have a full functioning like now.

You only need to make a recipe from water to steam (taking some energy, either electricyty or heat) for the steam-engine.
for the steam turbine you need to have a recipe water to overheated-steam.
You need to set the filters rigth then for the steam engine to recieve steam and the turbin for recieving overheated-steam

In my adventure for modding i used some similar approach for the blast-furnace which will need hot-air in the smelting recipe

Advantage of this approach is that you don't need to make the building different, just the heatexchanger to work like an assember.
Additional possibilites are to generate cool fluids the same manner (just little energy for the pump) but you can make then water to cool-water and use the same mechanic for cooling items (Think a battery which works with bricks which will be heated (storage) and you can get the energy back with a recipe hot-brick to brick plus steam for the turbine)

see here viewtopic.php?f=25&t=63762 used it in a chemical-factory

also this method will take out some problems with not working recipes when all the ingredients are available but the temperature......

User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1579
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: Removing fluid temperature - thoughts?

Post by Arch666Angel » Sun Jan 20, 2019 3:53 pm

I'd rather have the wonky fluid temp mechanic removed and/replaced and have more options regarding recipes or use of the energy value in other places.

My suggestion:
Scrap the temperature value as it is currently. Introduce fixed "states/stages" for fluids, each "states/stage" is bound to an multiplier for the energy value. Example:
Aliengoo - fluid - energy value 5

stage 0 multiplier 1 (fixed, base energy value)
stage 1 multiplier 1.5
stage 2 multiplier 2

Different stages just indicated different energy states of the fluid.

Generators would have to be changed so that they are efficient for a certain stage.
Example:
Steam engine would be most efficient for steam - stage 1, would run with stage 2 but could only harness the energy stage 1 would deliver.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2022
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Removing fluid temperature - thoughts?

Post by Optera » Sun Jan 20, 2019 4:50 pm

From a modders perspective I'd like the way boilers could gradually heat, or cool, fluids from 0.14 and the conversion of water-steam at 100°C from early 0.15 back.
Gradually heating water for steam engines might have been an mildly annoying puzzle in vanilla. Having support for it though allowed added realism for mods making use of realistic fluid temps for crafting by running fluids through boilers or coolers to get it just into the proper temperature range.

User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1579
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: Removing fluid temperature - thoughts?

Post by Arch666Angel » Sun Jan 20, 2019 8:58 pm

Alternative:
Scrap the temperature and states system altogether and bring fluids closer to the item and recipe system. If you want different temperatures you need to create additional fluids. One change that also comes to mind is have then generators changed to take special recipes, that determine which fluid can be converted to energy, currently that's fixed for one fluid per entity bring that closer to the rest of the game. Additional idea is to work with multiple fluids then, have one fluid e.g. oil that has an energy value and another fluid e.g. oxygen that has a multiplier, if both are supplied to the generator it generates value * multiplier energy.

User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1579
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: Removing fluid temperature - thoughts?

Post by Arch666Angel » Sun Jan 20, 2019 9:00 pm

Optera wrote:
Sun Jan 20, 2019 4:50 pm
From a modders perspective I'd like the way boilers could gradually heat, or cool, fluids from 0.14 and the conversion of water-steam at 100°C from early 0.15 back.
Gradually heating water for steam engines might have been an mildly annoying puzzle in vanilla. Having support for it though allowed added realism for mods making use of realistic fluid temps for crafting by running fluids through boilers or coolers to get it just into the proper temperature range.
Question is how hard is it to emulate in a system without temperature and how much of a gain in your gaming experience would that make if you compare it? The old system and also the current one are not that intuitive.

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

Re: Removing fluid temperature - thoughts?

Post by bobingabout » Sun Jan 20, 2019 9:22 pm

My main question about this would be how you would handle base game's temperature difference between Boilers and Heat exchangers, IE the 165 vs 500 temperature steam.

Also would there be anything in place to seperate current fuel value fluids in mods, from steam power, because feeding steam into an oil boiler, or fuel oil into a steam engine wouldn't make sense. Perhaps some kind of fuel category on fluids like you have on items?
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.

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

Re: Removing fluid temperature - thoughts?

Post by darkfrei » Mon Jan 21, 2019 6:08 am

So we get three fluids: cold-water, low-pressure-steam from boilers and high-pressure-steam from heat exchangers?

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2022
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Removing fluid temperature - thoughts?

Post by Optera » Mon Jan 21, 2019 6:26 am

Arch666Angel wrote:
Sun Jan 20, 2019 9:00 pm
Optera wrote:
Sun Jan 20, 2019 4:50 pm
From a modders perspective I'd like the way boilers could gradually heat, or cool, fluids from 0.14 and the conversion of water-steam at 100°C from early 0.15 back.
Gradually heating water for steam engines might have been an mildly annoying puzzle in vanilla. Having support for it though allowed added realism for mods making use of realistic fluid temps for crafting by running fluids through boilers or coolers to get it just into the proper temperature range.
Question is how hard is it to emulate in a system without temperature and how much of a gain in your gaming experience would that make if you compare it? The old system and also the current one are not that intuitive.
Funny, I thought you of all people enjoy added realism and complexity in production chains. ;)
Emulating temperatures could be done by duplicating a fluid to a different fuel value.
There's 2 main drawbacks of this though:
1) multiple copies of one fluid will clutter signal selection and barrel fill/empty recipes
2) since they are different fluids for the game, mixing temperatures inside pipes or tanks is impossible. Instead that would also have to be handled by recipes in an assembler entity cluttering recipes even more.

JimBarracus
Fast Inserter
Fast Inserter
Posts: 165
Joined: Mon Jul 03, 2017 9:14 am
Contact:

Re: Removing fluid temperature - thoughts?

Post by JimBarracus » Mon Jan 21, 2019 7:29 am

About the problem with steam temperature and the engines/ turbines

quick math:

You could reduce the steam output/ consumption for the steam engine to 5 steam/s and boiler to 10 steam/s and reduce the output to 450kW.
The turbine makes 96kW from one unit of steam
The engine makes now 30kW from one unit of steam
with my suggestion the engine would make 90kW from one unit of steam.

Benefit: you would need 6 boilers to run one steam turbine compensating for the different temperature
and the energy that is used/ produced is roughly the same.
Last edited by JimBarracus on Mon Jan 21, 2019 8:07 am, edited 2 times in total.

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

Re: Removing fluid temperature - thoughts?

Post by darkfrei » Mon Jan 21, 2019 8:00 am

Can we have both of fluids, with and without temperature?

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

Re: Removing fluid temperature - thoughts?

Post by bobingabout » Mon Jan 21, 2019 9:35 am

darkfrei wrote:
Mon Jan 21, 2019 8:00 am
Can we have both of fluids, with and without temperature?
I think the point of removing temperature is to get rid of extra maths. Currently to calculate the energy in a unit of fluid based on it's temperature you have to use the formula (current temperature - default temperature) * energy per degree. Water at 165C is 30kJ and water at 500C is 97kJ. on top of this you need a floating point variable saved in every fluid box using more RAM and increasing savegame size. And probably the biggest concern right at the moment with the fluid system being actively worked on... How does this effect when fluids of different temperatures flow through each other? more maths to do.

The point of removing temperature is to simplify all of this maths, and streamline the memory usage, so the formula (current temperature - default temperature) * energy per degree would be replaced with a lookup of fluid->prototype().fuelValue which would return 30kJ for steam, or 97kJ for high-preasure steam.

So, from the perspective of someone who's seen the source code, removing temperature makes sense if the only temperatures you're going to encounter are 2 grades of steam.
Bob's mods has 5 grades of steam, and could just expand upon that. My main concern is keeping steam vs oil separate.
If the base game just adds a filter of steam165 to the steam engine, and Steam500 to the steam turbine... that won't work for me, because you'd then still be able to to put steam in the oil boiler or fluid generator, since currently they allow ALL fuel value fluids to give energy in them.

My sugested fix for this is to add a category to fluids, similar to how you have fuel_category in items.
Currently, on a boiler and steam engine input you have a filter = "water" and filter = "steam". What if that filter was... category_filter = "water" and category_filter = "steam"? add category = "steam" to both steam165 and steam500 and then the fluidbox would only need to check for category == "steam" rather than going through a whole array on a filter (the reason given for why it was implemented only as a single value is that it would take too much processing time if every fluidbox had to check a filter array. with this sugestion it's increased from 1 (specific fluid) to 2 (Specific fluid and specific category)

For modding, This would extend to the boiler to change the specific fluid input from "water" to category "water", and I can add this category to pure-water and lithia-water in my mod to allow any type to be an input to the boiler.
And for my oil boiler and fluid generator, a category filter of "fuel-oil" would allow me to filter it to oils only, and stop steam from entering.


Another point of concern is those recipes that currently just look for steam >= 100C, like coal liquifaction. How would that work with 2 different definitions of steam? steam165 and steam 500? do you make a recipe for both?
If it were possible to add {type = "fluid-category", name = "steam", amount = "20"} to the line that currently looks for steam, then that would solve the problem there too. though if such a system was implemented, I'd want one for items too, so for example, on a recipe that accepts {type = "item", name = "wood"} I could use {type = "item-category", name = "wood"}, with category = "wood" (or similar non-conflicting tag) being on wood and synthetic-wood. (as an example, synthetic wood isn't in my mods anymore)

Even if the fluid category system I suggested is implemented, I don't see it as likely that recipe's accepting a category as an ingredient would be. Coal Liquefaction recipe will likely just be set to Steam165, because if you were going to use Steam500 in the recipe, well, you're wasting huge amounts of energy to heat it that high.


So this is my list of thoughts and sugestions, for what would work for the base game and me personally.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.

Post Reply

Return to “Modding discussion”

Who is online

Users browsing this forum: No registered users