Fluid temperature influencing operating speed of machines

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
protocol_1903
Fast Inserter
Fast Inserter
Posts: 156
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Fluid temperature influencing operating speed of machines

Post by protocol_1903 »

As said in title, I believe that fluid temperature should influence the operating speed of machines (crafting speed, inserter speed, etc)
I'll be using steam as an example for the remainder of this post, but it applies to fluids with temperatures as a whole.

This is technically already a "feature" in that you can have an entity underpowered per se, where it desires 500C steam but is receiving 250C steam so it runs at half speed (ish, probably less due to minimum temperature). The way this is done, however, is by setting rates and values such that it will reach normal crafting speed at whatever the maximum temperature of the steam is. There is no way to "overclock" the entity by powering it with hotter steam. This would be fine, however if you wish for a basic steam temperature to operate the machine at normal speed, you need to pre-calculate your fluid_usage_per_tick, maximum temperature, and energy_usage to calculate what crafting speed it will be at the highest steam temperature so that it will scale down properly at lower temperatures. I believe this functionality should be changed to be properly and officially supported, where fluid_usage_per_tick, min/max temperature, energy_usage, and a new value optimal_temperature are used to have the machine operate at normal rates when at optimal_temperature, but still be able to be overclocked with max_temperature. Perhaps autocalculate fluid_usage_per_tick so that energy_usage reaches it's normal value at optimal_temperature.

So something in the new system would look like

Code: Select all

prototype.energy_source = {
  type = "fluid",
  fluid_box = {
    -- volume, pipe connections, and covers not added for brevity
    production_type = "input-output",
    filter = "steam",
  },
  burns_fluid = false,
  scale_fluid_usage = false,
  fluid_usage_per_tick = (1 / 60), -- uses 1 steam every second
  minimum_temperature = 250, -- must have 250C steam to run
  optimal_temperature = 500, -- runs at normal speed at 500C
  maximum_temperature = 1000, -- runs at double speed (?) at 1000C
}
prototype.crafting_speed = 1
prototype.energy_usage = "300kW"
I don't know exactly how it's calculated in the current system, I believe it's some form of LERP from min to max temp, but also respecting the machine's energy_usage somewhere in there. If no changes are going to be made, it would be welcome to receive some better documentation as to the current implementation so that it can be understood and used easier.
If you need to reach me, message me on discord.

I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
MrSmoothieHuman
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Sat Aug 05, 2023 1:20 am
Contact:

Re: Fluid temperature influencing operating speed of machines

Post by MrSmoothieHuman »

+1 +1 +1 +1 i beg of this feature, temperature-based fluids need more uses
even if we get some improved documentation on heating fluids and the fluid box shenagians related to it, it'd be a big help
coder? i hardly know her!
Post Reply

Return to “Modding interface requests”