You won't like but here's what would fix fluids:

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

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

Re: You won't like but here's what would fix fluids:

Post by mmmPI »

You don't need to fit pumps everywhere, it would be like saying that for splitters or balancers, you just build them because that's part of the factory.

I don't think fluids are broken so I didn't see the need for any fix, now i feel like you don't want to use the pipes the way they were intended to and instead advocate for them to be removed for everyone that managed to enjoy using them and you pretend "that's what someone wants when he design a factory"

i don't like it you have that one correct ! :)

You could use barrels, and fluidwagons for long distance, or just don't make super long pipes, you can use 17 pipes between each pump and still have a flow of 1200/sec according to the wiki https://wiki.factorio.com/Fluid_system#Pipelines Underground pipes can be 10 tile apart and only count for 2 pipes, so that would mean 1 pump every 160 tiles or so, to provide the full flow of an offshore pump on ANY DISTANCE as long as you place a pump every 160 tiles that leaves some room for eletric poles for sure.

On another aspect, how ugly do you think a nuclear reactor, or just the starting engine would look if you could just place 100 steam engine in one place, and let say , 100000 tiles away, you place all the boilers, all in 1 long lane, with one super long pipe to connect them I don't think that would correspond to what people expect when building a factory and maybe is one of the reason it was discarded earlier in development.

No that's not what you meant ? because I have hard time figuring how you would prevent that if you remove flow mechanic. If the flow SPEED is infinite, in practice, the flow itself is infinite !

fluid flow rate = area of the pipe or channel × velocity of the liquid
Q = Av
Q = liquid flow rate (m3/s or L/s)
A = area of the pipe or channel (m2)
v = velocity of the liquid (m/s)

The area of the pipe is the width of the pipe in the game so if you keep it the same but puts v to infinity, then Q is infinite too.

I had to look that one up for fluid to make sure that's not only my instinct here !

Fluid mix prevention already forbid a lot of designs where you only use 1 tank to unload different liquid for example. To make the game easier, i can understand it and that flatter my ego but i would have prefered an option so that i could keep the old behavior since it feels very easy when you are use to it and makes for more interesting puzzle, but this is too much of the game to take away, and parts that i like !

Asking for it to be removed is an arbitrary request to break a fine system !

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

Re: You won't like but here's what would fix fluids:

Post by FuryoftheStars »

StephenLynx wrote:
Fri Jul 12, 2019 2:42 am
You simply can't fit pumps everywhere. Because not only you require the space for the pump itself, but also to provide electricity to it.
{...}
And mind you, unless you have a long, unbending series of pumps, you will lose output based on the distance.
mmmPI wrote:
Fri Jul 12, 2019 4:50 am
You don't need to fit pumps everywhere, it would be like saying that for splitters or balancers, you just build them because that's part of the factory.
{...}
You could use barrels, and fluidwagons for long distance, or just don't make super long pipes, you can use 17 pipes between each pump and still have a flow of 1200/sec according to the wiki https://wiki.factorio.com/Fluid_system#Pipelines Underground pipes can be 10 tile apart and only count for 2 pipes, so that would mean 1 pump every 160 tiles or so, to provide the full flow of an offshore pump on ANY DISTANCE as long as you place a pump every 160 tiles that leaves some room for eletric poles for sure.
I think mmmPI pretty well sums it up what I was going to say. But to reiterate, your distance is not limited. Just to be sure, I ran a setup with over 3.6k pipe segments (if these had been undergrounds, I could've run this a theoretical distance of almost 20k tiles / >600 chunks(!)) and I was still able to provide full water for 40 steam engines from a single offshore pump (albeit over that distance I think there were some rounding errors that occurred, but I was able to solve those by removing and re-adding one of the steam engines). Only used around 225 pumps +/- a couple.
StephenLynx wrote:
Fri Jul 12, 2019 2:42 am
Using pumps to make up for a system deficiency doesn't excuse the deficiency. And is still an arbitrary requirement.
I don't think they're being used to make up for a deficiency. Pumps are actually used irl for the exact same purpose as they're being used in game. This is far from an "arbitrary" requirement. And anyway, what would happen to pumps in an instant flow system? If they're not needed for pumping pressure, then they'd only be good for fluid wagons and as powered one way valves.
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

mudcrabempire
Fast Inserter
Fast Inserter
Posts: 110
Joined: Sun Oct 28, 2018 2:44 pm
Contact:

Re: You won't like but here's what would fix fluids:

Post by mudcrabempire »

FuryoftheStars wrote:
Fri Jul 12, 2019 5:57 am
I don't think they're being used to make up for a deficiency. Pumps are actually used irl for the exact same purpose as they're being used in game. This is far from an "arbitrary" requirement. And anyway, what would happen to pumps in an instant flow system? If they're not needed for pumping pressure, then they'd only be good for fluid wagons and as powered one way valves.
I don't think it's a good idea to argue physics here. It's a game, not an attempt to make an arbitrarily precise simulation of fluid mechanics. You can easily bring any personal computer to a grinding halt with that kind of calculations.

What you need is a system that:
-Does it's job (I don't know what exactly the factorio team wants pipes to do, except transporting liquids, so I can't argue here)
-Is easy enough to code and calculate to not have too much impact on performance
-Is fun
--as a corollary to "fun", it should probably have some degree of realisticity

But just because I consider arguing physics to be fun, here's one for the argument kitchen:
Fluid velocity in a pipe is related to pressure and limited by friction and pipe design. Theoretically, you could reach arbitrarily high velocities with arbitrarily high pressure, but the pipes are going to burst at some point.
To increase the pressure, just connect a source of it to the pipe (eg. a pump):

P=============

To get twice the pressure, just connect another pump:

P===================
.//
P

Or a third, for triple pressure:
P
.\\
P================
.//
P

User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 2420
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: You won't like but here's what would fix fluids:

Post by BlueTemplar »

Fun ! :P

Well, IRL you also have to deal with laminar and turbulent flow...
Image
The transition from the laminar to turbulent happens as you increase flow speed, qualified by the Reynolds number.
The Reynolds number depends on the density, viscosity and velocity of the fluid on one hand, and the diameter of the pipe on the other hand.
It looks like that in practice, in the industry, crude oil is going to be moved using laminar flow (except when flushing pipes), and water using turbulent flow.
The implications are :
- pressure drop is going to be linear with flow rate in laminar flow, but (flow rate)² in turbulent flow !
- In turbulent flow, pipe "roughness" starts to matter :
Image
So, assuming a constant pipe diameter and roughness, for water (turbulent), as you increase flow speed, you are going to need to put pumps ever closer, "faster" than you increase the speed !
For oil (laminar) though, pump distance is going to be (inversely) proportional to flow speed.

And Factorio actually has two flow types (at lest in 0.16), with a similar pressure drop increase effect when entering "turbulent flow" mode ! (Though seems like this might have happened by coincidence ?)
factorio_0.16_pipe_flow_to_distance_rotate&mirror.png
factorio_0.16_pipe_flow_to_distance_rotate&mirror.png (75.05 KiB) Viewed 2027 times
(source)
And "factorio-laminar" seems to be inversely-linear too : for instance halving from ~17.5L/tick (at breakpoint) to 8.75L/tick doubles distance from 200 pipes to 400 !
Near that breakpoint, "factorio-turbulent" is probably even more inverse-squared than IRL : doubling from ~17.5L/tick to 35L/tick reduces distance from 200 to 3-4 pipes !
OTOH, going from 1 pipe to 2 only goes from 90L/tick to 50L/tick, that's even sub-inversely-linear.
Hmm, I really would need to redraw those graphs, and superpose inversely-linear and inversely-squared on them...

(Also, both pressure_to_speed_ratio and flow_to_energy_ratio are set to the same values for all the vanilla fluids, in 0.16 at least.)
Last edited by BlueTemplar on Sat Jul 13, 2019 11:12 am, edited 1 time in total.
BobDiggity (mod-scenario-pack)

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

Re: You won't like but here's what would fix fluids:

Post by FuryoftheStars »

mudcrabempire wrote:
Sat Jul 13, 2019 6:01 am
I don't think it's a good idea to argue physics here.
I wasn’t. I was arguing the point that pumps being in the game are arbitrary.
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: 2728
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: You won't like but here's what would fix fluids:

Post by mmmPI »

https://factorio.com/blog/post/fff-274

For what i understand, the laminar/turbulent is not taken in account. It is not logical to expect a game to behave like the real world. There only exist in the game world what has been coded by devs.

The velocity of the liquid is the result of simulated physical properties with hardcoded value to artificially represent different behavior for water and oil given different height in the pipe.

If you get rid of that, then you get infinite flow rate and the ugly all turbine in a row, as that's the only reason explaining why things takes time.

User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 2420
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: You won't like but here's what would fix fluids:

Post by BlueTemplar »

Well, I'm just going to link this previous thread explaining how the two modes happen in Factorio (pre-0.17 at least) :
viewtopic.php?p=288850#p288850

The two hardcoded (hopefully open to modding again later) parameters, are for now the same for all (unmodded) fluids.
BobDiggity (mod-scenario-pack)

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

Re: You won't like but here's what would fix fluids:

Post by mmmPI »

BlueTemplar wrote:
Sat Jul 13, 2019 12:47 pm
The two hardcoded (hopefully open to modding again later) parameters, are for now the same for all (unmodded) fluids.
The new algorithm
The new algorithm follows realistic wave equations. It works with two variables.
The volume of a fluid in a fluidbox (FB) and the corresponding column height.
The flow speed in a connection between fluidboxes.
The exact behavior then depends on two constants:
C^2 - corresponds to the mass of the liquid. Affects how quickly changes (waves) propagate.
Friction - affects how quickly throughput drops with pipe length.
The first good news is that these variables can now be set for fluids separately so different behaviour can be achieved. E.g. crude oil pipeline will require some pumps while steam will be totally fine.

What you get over 0.16 is that the fluids now behave correctly and intuitively, performance is consistent (pipes to ground won’t help you with throughput anymore), different fluids actually move differently.

It is from FF 274. It is from 0.17, it is the actual behavior of pipe i presume. Just to make sure we debate with the same information, in this case, if you change the flow speed between boxes to infinite you have infinite flow in volume.

User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 2420
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: You won't like but here's what would fix fluids:

Post by BlueTemplar »

This part seems to be pretty much the same as in 0.16, from the point of view of the wave equation model.
(No, I don't understand why it was presented like this.)
It's the changes in algorithm implementation that matter.

c² seems to be the new pressure_to_speed_ratio.
Friction seems to be the new flow_to_energy_ratio (probably, the FFF doesn't go into maths about it) (EDIT : I really need to find some hours to go over my numerical simulation courses again and then see what TheYeast did !)

EDIT : See bob modding these values in his mods in 0.15 here.

The difference that I see is that previously it was the flow component coming from the previous flow speed that was clamped to 10% of fluidbox capacity, now it's the final flow speed that would be clamped to 25% fluidbox capacity ?

But then, the biggest difference might be that previously it was all done in a single pass, which resulted in unequally split flow depending on the direction (just like inserters work unequally between separate chunks), while the new algorithm uses multiple passes, fixing that issue.

EDIT2 : underground pipes conserving the same number of fluidboxes, their behavior shouldn't change.
(at least until segment merging is implemented - but that might require a radically new physical model, so will it ?)
BobDiggity (mod-scenario-pack)

slippycheeze
Filter Inserter
Filter Inserter
Posts: 587
Joined: Sun Jun 09, 2019 10:40 pm
Contact:

Re: You won't like but here's what would fix fluids:

Post by slippycheeze »

mmmPI wrote:
Sat Jul 13, 2019 1:22 pm
BlueTemplar wrote:
Sat Jul 13, 2019 12:47 pm
The two hardcoded (hopefully open to modding again later) parameters, are for now the same for all (unmodded) fluids.
The new algorithm

It is from FF 274. It is from 0.17, it is the actual behavior of pipe i presume. Just to make sure we debate with the same information, in this case, if you change the flow speed between boxes to infinite you have infinite flow in volume.
I thought some-but-not-all the new fluid system made it in, and that part was not in the game yet. What stayed were some performance improvements on the 0.16 version of the fluid flow system. The new stuff will come later, when 17 is stable, or whatever. Not cut forever, but no schedule yet either.

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

Re: You won't like but here's what would fix fluids:

Post by mmmPI »

BlueTemplar wrote:
Sat Jul 13, 2019 1:57 pm
It's the changes in algorithm implementation that matter.
For a physical realistic behavior, i have not much understanding and knowledge, with fluids and real life those graphics are overwhelming to me !, i'm reasoning on the consequences of choosing one model over another based of how it would behave in game.

For now the data i estimate needed to predict the behavior of my factory are the quantity of material per time. Which correspond to the flow rate, 100 crude per second. The 100 is a volume or a quantity, it represent the same thing from a game point of view as receipe.

It need to go from A to B via a channel. The channel is the pipe. The pipe has a throughput, you can read the throughput increase and max out, and predict what you would read, and plan accordingly, with parralel pipes, or closer pumps.

Now the fact that i don't know much about real life physics is a thing that prevent me from telling you in advance which math you need to predict the throughput of the pipe, I can only get those information from a table, or i would need to test the differents setups, or try to understand https://jsfiddle.net/TheYeast/c9d2azjo/show can't tell you if it's realistic either.

The thing that i can tell though, is that there is a flow mechanic, contrary to the eletrical network, in this one, all the power from the power plant can go through 2 wooden power pole you don't need to worry about throughput, or flow.

The consequences in game are that the pipes don't act as 1 giant tank ( or several larger segment) where you can pull/push as if it was "teleporting", it means that every pipe is simulated individually and that i can identify which precise pipe is limiting the flow.

Those are 2 things that are linked with the generic formula : flow rate = (speed at which a quantity of a liquid is moved) x ( quantity of liquid ). Make infinite flow speed and you have infinite flow rate.

Not that i can pretend saying if the way we get those numeric value correspond to IRL.

But i'd gladly read about how close/different from IRL the factorio model of simplified flow mechanic is based on what players measure ! , that is a soft approach for me, as long as it still exist ! ;)

That is a player learning on the thing modeled in the game, good thing for factorio playerbase that they can, even if it makes the game a little harder, maybe mods can help lowering the complexity, either as a more arcade version for less math, or as to lower the age for students.

I could also learn on how you code an algorithm that is supposed to model the physical world for players to think it's a game, but that's is a player learning how the game was made, it's a little different, it would be understanding how you code so that the laminar/turbulent flow are represented in a way that is good enough visually/for gameplay/ for physicist . that's seems to be what you are into @BlueTemplar :).

User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 2420
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: You won't like but here's what would fix fluids:

Post by BlueTemplar »

Yeah, not being able to directly tell what the maximum flow speed is going to be is certainly a problem. It's a bit like the situation with inserter speed, but even worse...
There's the debug show-fluid-box-fluid-info setting, but it only shows instantaneous speed (and visually, relative to... something?). And the moving bubbles effect could perhaps be improved? (So does the fill graphics compared to the actual fill rate...)

If in 0.17 there's already a system that already checks any changes to fluid networks, then perhaps a pipe could store and show the top flow speed that already went through it (maybe only sampled every N tick?), and reset that number when there's any change anywhere in that fluid network ?
BobDiggity (mod-scenario-pack)

Post Reply

Return to “Ideas and Suggestions”