Removing fluid temperature - thoughts?

Place to post guides, observations, things related to modding that are not mods themselves.
nosports
Filter Inserter
Filter Inserter
Posts: 274
Joined: Fri Jan 19, 2018 5:44 pm
Contact:

Re: Removing fluid temperature - thoughts?

Post by nosports »

bobingabout wrote:
Mon Jan 21, 2019 9:35 am
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.
I think its best to rework the boiler to act as assemblers with a recipe category 'heat-exchange'/'energy-exchange'
This would lead for current builds just to select the right recipes, without any change of blueprints or factorys and you don't have a different mechanic for this matter as the existing with assemblers
Added benefit is that you then could even heat some items in this manner not only just fluids ( who knows sometimes you will need a super heated loco :twisted: )

with 0.17 and the 'void' for energy_usage you could even make this recipe/boiler working without electicty if wanted

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

Re: Removing fluid temperature - thoughts?

Post by bobingabout »

nosports wrote:
Mon Jan 21, 2019 9:44 am
I think its best to rework the boiler to act as assemblers with a recipe category 'heat-exchange'/'energy-exchange'
This would lead for current builds just to select the right recipes, without any change of blueprints or factorys and you don't have a different mechanic for this matter as the existing with assemblers
I don't see what benefit this would bring.

The boiler as it is now accepts an input "water" and an output "steam". it then calculates how much water it transforms into steam per tick based on energy available, and energy capacity of the water (the only difference with removing temperature for this last part is instead of having to calculate it, it's a known value).

An assembling machine on the other hand has a known input quantity, and a known output quantity, and the variable is time and energy consumption.

A boiler gives a much steadier flow of fluid than an assembling machine, and I would use it in more places if it wasn't reliant on temperature. Even more if I could specify an energy per unit instead of it being calculated by the energy capacity of the fluid.(though I doubt this last part will happen)
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
mexmer
Filter Inserter
Filter Inserter
Posts: 870
Joined: Wed Aug 03, 2016 2:00 pm
Contact:

Re: Removing fluid temperature - thoughts?

Post by mexmer »

bobingabout wrote:
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.
well, with this change, i can imagine continuously running refinery, instead of production cycle :D

you will just set "recipe" with output ratio, and input fluid (raw oil), will be converted to output fluids, just based on ratio continuously without wave pushes, whenever batch is finished (current refinery)

User avatar
brunzenstein
Smart Inserter
Smart Inserter
Posts: 1082
Joined: Tue Mar 01, 2016 2:27 pm
Contact:

Re: Removing fluid temperature - thoughts?

Post by brunzenstein »

Why not make the temperature (given the CPU demand) an option in the setup?

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

Re: Removing fluid temperature - thoughts?

Post by darkfrei »

Ohh, if we haven't temperature by fluids, then steam-165 can be done with assembling machine or with furnace. No need for boiler type prototype anymore.

If this furnace has "heat" energy source then heat exchanger is also not needed. All can be done with recipes.

christian
Long Handed Inserter
Long Handed Inserter
Posts: 64
Joined: Fri Jun 08, 2018 12:44 am
Contact:

Re: Removing fluid temperature - thoughts?

Post by christian »

I've played 4 maps, one is a 12k SPM map and I don't think I've ever paid attention to the fluid temperature. I haven't played in a couple of months (waiting for 0.17) so I may be forgetting something. But yeah I agree that it might be better to just remove it.

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

Re: Removing fluid temperature - thoughts?

Post by bobingabout »

brunzenstein wrote:
Mon Jan 21, 2019 1:15 pm
Why not make the temperature (given the CPU demand) an option in the setup?
It's either remove it from everything, or remove it from nothing, because if it's only on some fluids, you still need to run all the "Does this fluid have a temperature" checks.
darkfrei wrote:
Mon Jan 21, 2019 1:17 pm
Ohh, if we haven't temperature by fluids, then steam-165 can be done with assembling machine or with furnace. No need for boiler type prototype anymore.

If this furnace has "heat" energy source then heat exchanger is also not needed. All can be done with recipes.
Why is everyone assuming that if we don't have a temperature, then boilers shouldn't exist anymore? it's just a number to the calculator. (temp out - temp in) * heat capacity = energy... the change is that the energy would be stored on the fluid prototype instead of being calculated on the fly. That's the change. Boiler still does now what the boiler has always done since 0.15.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

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

Re: Removing fluid temperature - thoughts?

Post by mrvn »

Arch666Angel wrote:
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.
I think it would be better to make 3 fluids then with similar icons. Otherwise how do you work those stages into signals or filters? How do I program my LTN station to request stage 2 Aliengoo?

Different fluids for boiler steam and heat exchanger steam would make it possible to ship cheap steam for chemical processes and hot steam for power generation around the map with LTN or monitor the availability of both using signals.

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

Re: Removing fluid temperature - thoughts?

Post by darkfrei »

bobingabout wrote:
Mon Jan 21, 2019 2:25 pm
Why is everyone assuming that if we don't have a temperature, then boilers shouldn't exist anymore? it's just a number to the calculator. (temp out - temp in) * heat capacity = energy... the change is that the energy would be stored on the fluid prototype instead of being calculated on the fly. That's the change. Boiler still does now what the boiler has always done since 0.15.
While I can make absolutely same with the assembling machine, all calculations must be done in data stage, where energy will be defined by production time of recipe and power of this assembling machine. If I can done the same with assembling machine and boiler, why I need both of them?

epr
Inserter
Inserter
Posts: 23
Joined: Thu Jul 05, 2018 7:36 pm
Contact:

Re: Removing fluid temperature - thoughts?

Post by epr »

I'm in favor of removing the fluid temperature. It doesn't really add much to the game and better performance would be preferable, imo.

_italics_
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sat Jan 05, 2019 3:28 pm
Contact:

Re: Removing fluid temperature - thoughts?

Post by _italics_ »

My main gripe is that hot things should get colder. It shouldn't be possible to store steam in tanks indefinitely, or transport it long distance in pipes/trains without any temperature loss.

However, I don't see that implementing more realism here would improve the game. Cooling steam would quickly return to water, for example. Dealing with temperature and state changes is interesting and a lot of fun in a game about gases and liquids like Oxygen Not Included, but it would detract from the abstract fluid model of Factorio.

Could even get rid of nuclear steam entirely, replacing the current nuclear setups with something else, perhaps some expensive, huge self-contained buildings more like the ones in the real world? I think the interesting part there is the uranium mining and processing anyway, not the heat/steam part. I guess a fluid-less system would make them viable alternatives to solar for megabases too.

I'm not sure if I follow the fuel_value idea. I think it's simpler to use the amount available as if it was any other fluid input. For example, if there's not a full steam turbine's consumption of steam available in the pipe, you don't get the full amount of electricity.

/late Friday night thoughts

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

Re: Removing fluid temperature - thoughts?

Post by bobingabout »

_italics_ wrote:
Sat Jan 26, 2019 3:43 am
I'm not sure if I follow the fuel_value idea.
Fuel value on fluids already exists, and is used by modders. It's basically the same as fuel value on an item, except it's per unit of fluid. The proposal is that instead of calculating the energy in the water, you just defined it as a fuel value and use that. Currently the following happens every time you consume steam: (current temperature - default temperature) * energy per degree = (165 - 15) * 0.2kJ = 150 * 0.2kJ = 30kJ. So if you know the value of 165 degree steam coming out of a boiler is 30kJ, why not just set fuel_value = 30kJ and have done with it? Keep in mind that default temperature and energy capacity (per degree) are already values defined in data, not only would you be simplifying the data, but also reducing calculations on steam consumption.

And that's before you even consider the main reason why they want to remove temperature in the first place. When 2 fluids of the same type but different temperature touch, you'd need to calculate a new temperature. a whole system that needs to be supported on ALL fluids, and checked at ALL fluidbox transitions, just because steam can be more than 1 temperature.

then you have 500 degree super heated steam too, that would have a fuel value of 97kJ (doesn't need to stay at such an odd value) and the devs would need to look at whether or not this should change, or how to incorporate it into a temperature-less system.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

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

Re: Removing fluid temperature - thoughts?

Post by mrvn »

bobingabout wrote:
Mon Jan 28, 2019 10:00 am
_italics_ wrote:
Sat Jan 26, 2019 3:43 am
I'm not sure if I follow the fuel_value idea.
Fuel value on fluids already exists, and is used by modders. It's basically the same as fuel value on an item, except it's per unit of fluid. The proposal is that instead of calculating the energy in the water, you just defined it as a fuel value and use that. Currently the following happens every time you consume steam: (current temperature - default temperature) * energy per degree = (165 - 15) * 0.2kJ = 150 * 0.2kJ = 30kJ. So if you know the value of 165 degree steam coming out of a boiler is 30kJ, why not just set fuel_value = 30kJ and have done with it? Keep in mind that default temperature and energy capacity (per degree) are already values defined in data, not only would you be simplifying the data, but also reducing calculations on steam consumption.

And that's before you even consider the main reason why they want to remove temperature in the first place. When 2 fluids of the same type but different temperature touch, you'd need to calculate a new temperature. a whole system that needs to be supported on ALL fluids, and checked at ALL fluidbox transitions, just because steam can be more than 1 temperature.

then you have 500 degree super heated steam too, that would have a fuel value of 97kJ (doesn't need to stay at such an odd value) and the devs would need to look at whether or not this should change, or how to incorporate it into a temperature-less system.
Wouldn't steam then be burnable in a boiler to make more steam?

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

Re: Removing fluid temperature - thoughts?

Post by darkfrei »

mrvn wrote:
Mon Jan 28, 2019 10:55 am
Wouldn't steam then be burnable in a boiler to make more steam?
In the game the burning is just removing of item / fluid and production some amount of energy. This energy can be converted to electric energy or another types of energy, like heat.

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

Re: Removing fluid temperature - thoughts?

Post by mrvn »

darkfrei wrote:
Mon Jan 28, 2019 11:25 am
mrvn wrote:
Mon Jan 28, 2019 10:55 am
Wouldn't steam then be burnable in a boiler to make more steam?
In the game the burning is just removing of item / fluid and production some amount of energy. This energy can be converted to electric energy or another types of energy, like heat.
Sure. But the fluid burning entity accepts any fluid with a fuel value. Which is used to filter for things that can be burned. So you can't "burn" water and I would expect it to not "burn" steam. Adding a fuel value to steam would break that filter.

User avatar
leadraven
Filter Inserter
Filter Inserter
Posts: 354
Joined: Fri Jan 18, 2019 7:23 pm
Contact:

Re: Removing fluid temperature - thoughts?

Post by leadraven »

Ooooh, that's why steam cannot be stored in barrel... Barrels do not store information of temperature!
I don't like temperature in its current implementation.
I don't like possibility to mix steam of different temperatures.
I don't like to have steam of different temperatures as different liquids.
And I don't know how to make it pretty. Yet. But I will think it over! Nice topic.

P.S. To heat liquids to speed up chemical reactions... That's a thing to think over!

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

Re: Removing fluid temperature - thoughts?

Post by bobingabout »

mrvn wrote:
Mon Jan 28, 2019 11:45 am
Sure. But the fluid burning entity accepts any fluid with a fuel value. Which is used to filter for things that can be burned. So you can't "burn" water and I would expect it to not "burn" steam. Adding a fuel value to steam would break that filter.
if you go back to my post... I think it's the last post of page 1, you'll see I suggest adding a fluid_category (or fuel_category) to fluids which acts much the same way as filter to a specific fluid works on fluidboxes now, except instead of being able to filter to a specific fluid, you'd instead filter to a group of fluids (like, steam, oil or water as examples)

So using fluid_value by itself is an incomplete solution.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
leadraven
Filter Inserter
Filter Inserter
Posts: 354
Joined: Fri Jan 18, 2019 7:23 pm
Contact:

Re: Removing fluid temperature - thoughts?

Post by leadraven »

Let's unify steam temperature and regulate energy production only with steam throughput.
Currently with 165C steam 1 pump can provide 36MW energy. 100 pumps for 3.6GW. I don't think we need overheated stem... Moreover, I'd say we can reduce steam energy capacity or pump throughput. 1 pump for ~10MW would be totally ok.

User avatar
MoleOnDope
Inserter
Inserter
Posts: 44
Joined: Tue Jan 29, 2019 12:16 am
Contact:

Re: Removing fluid temperature - thoughts?

Post by MoleOnDope »

So, hear what I say. I've done over a day of research in thermodynamics and nuclear power generation now and the answer really isn't easy. But first, let me explain why I personally think that removing fluid temperature makes sense from an averagage user's perspective:
  • Currently, there's only three temperature states for liquids that are being used: 15°C, 165°C and 500°C, two of which only apply exclusively to steam. This setup provides a well tuned framework for its purpose and would "work as intended" even without all the background math of a temperature gradient.
  • Performance improvements: From what I understand, quite a bit of computing can be simply skipped without the continous temperature scale. The game already runs nice even on my laptop (0.16) but another fps/ups is always good plus I'd be really excited to see just how far the concept "megabase" can be pushed with further optimisations.
  • I love figuring out perfect nuclear reactor setups and ratios, but temperature/energy calculations are just such a chore and really useless from a gameplay perspective: boilers and steam engines are a perfect match just like heat exchangers and steam turbines, why should I mix those two worlds? And with keeping both seperate I really don't care about the linear heat/energy correlation of steam, I only need two discrete values for my calculations 😏
However, there's more to it as I mentioned before. I will not go to much in depth because honestly, nobody cares about about Vapor Pressure and VT/PT-diagrammes :lol:
What I will say is:
  • 165°C Steam For the (quite historical looking) steam engine is maybe a bit high, but an ok value and works fine balancing wise
TL;DR

Generally speaking I would say mixing steam of different temperatures makes no sense at all (vast differences in many properties like pressure, saturation etc.). Also, I have no clue why someone would like to change the temperature of any other liquid in factorio...?
In conclusion, that's why I think making different temperatures of steam seperate liquids with fixed energy values is not only theoretically justified, but also makes stuff so much easier especially for new players. How realistic that is implementation wise, unfortunately, I can't tell.
And if you're ever going to add in fossil energy as a DLC or whatever I'll be happy to take my 500°C Turbines back :D :D :D

In all seriousness though, please let me know if I overlooked something or made a mistake.

Edit: Coal burning in boilers of course is, strictly spoken, fossil energy, but what I had in mind was a modern, large scale, turbine based power plant running on either coal, oil or gas.

_italics_
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sat Jan 05, 2019 3:28 pm
Contact:

Re: Removing fluid temperature - thoughts?

Post by _italics_ »

After playing a bit more with nuclear I've realized that the heat pipe/steam/turbine part is not that uninteresting, it was my designs that were uninteresting.

Post Reply

Return to “Modding discussion”