Friday Facts #274 - New fluid system 2

Regular reports on Factorio development.
Post Reply
Dominik
Factorio Staff
Factorio Staff
Posts: 505
Joined: Sat Oct 12, 2013 9:08 am
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by Dominik » Fri Dec 28, 2018 1:22 pm

featherwinglove wrote:
Thu Dec 27, 2018 5:16 pm
...
Ah, there it is. So approaching an adjacent run like this would confuse the game because it doesn't know which of the two nets you're trying to connect to. So, click on the net you want to extend into this gap, say the water on the right and then drag it into the gap, the water net extends and does not connect to the light oil net. Then build the pipe south, build the light oil pipe also south by dragging from its end to tell the game which net you're extending, and wala, you've got Pipe Control in vanilla. This might need an explanation in Tips & Tricks, but it'll be pretty inherent to anyone who's used to extending power grids as I do: try to place your power pole on an existing power pole, yes that makes the placement error beep, hold the button and run (or train/car as I often do) and off goes a perfectly wire spaced power line to that new resource patch.
As I wrote before - better controls of pipe laying would be handy and it is on the list, but no time to spare right now.

User avatar
featherwinglove
Filter Inserter
Filter Inserter
Posts: 578
Joined: Sat Jun 25, 2016 6:14 am
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by featherwinglove » Fri Dec 28, 2018 6:31 pm

I'm looking at the relative download numbers of therax mods and it looks like PipeLayer's kinda in the subterranean range ;) compared to his other mods.
meganothing wrote:
Fri Dec 28, 2018 1:13 pm
My guess is that the adjacent limitation may have been done mainly for a simpler UI but effectively it is now part of the puzzle. Sure, there are mega-factory builders who are not interested in such puzzles anymore and want "cheap" limitations removed. But it is one of the entry problems for beginners and should stay (IMHO)
That won't be satisfactory to some players. I'm far from being allergic to spaghetti, but after plunking down my first oil refinery, I had this great feeling. Twenty minutes and two stacks of UGP later, I zoomed out and said like Anakin's most sensible and best delivered line in Revenge of the Sith, "WHAT HAVE I DONE???"
Apart from the simple solution of pointing to mods Wube could implement a type of advanced pipe that allows adjacent placement, IF they really want such pipes available in vanilla.
That's an interesting idea. Somebody should mod that in and see how it goes. It has a lot of catching up to do to get anywhere near the loaders, liek holy :shock: ppl like loaders! (Not as much as they like axes apparently!)
Last edited by featherwinglove on Sat Jan 05, 2019 1:49 am, edited 1 time in total.

GenBOOM
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Tue May 16, 2017 11:39 pm
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by GenBOOM » Sat Dec 29, 2018 10:00 pm

In addition to friction, shouldn't the fluid have an inertia? so that when cornering some energy is lost, and the speed will slow down, increasing pressure build up behind the curve of the pipe. so if you zig-zag pipes it will fill up the backed up fluid slightly faster and slosh around less, or slosh around at a higher frequency but for a shorter duration. This should happen at every junction, but be most drastic at 90 degree corner turns where there only a single pipe connection and no other junctions to outlet the pressure buildup.

This makes me realize that straight pipes would need much more reinforcements whenever there is a T junction because there is no curve to the pipe like a 90 degree corner turn, its basically a cannon of fluid hitting a wall of pipe, instead of centrifugal force acting its just taking the full brunt of the impact and dispersing the liquid as a reaction to the impact. I would imagine that T junctions would need to be replaced or maintained quite a lot. There is an opportunity there for some art changes to reflect some realism. Unless there is some fluid guiding done within the pipe that is unseen.

User avatar
featherwinglove
Filter Inserter
Filter Inserter
Posts: 578
Joined: Sat Jun 25, 2016 6:14 am
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by featherwinglove » Sat Dec 29, 2018 10:37 pm

GenBOOM wrote:
Sat Dec 29, 2018 10:00 pm
In addition to friction, shouldn't the fluid have an inertia? so that when cornering some energy is lost, and the speed will slow down, increasing pressure build up behind the curve of the pipe. so if you zig-zag pipes it will fill up the backed up fluid slightly faster and slosh around less, or slosh around at a higher frequency but for a shorter duration. This should happen at every junction, but be most drastic at 90 degree corner turns where there only a single pipe connection and no other junctions to outlet the pressure buildup.

This makes me realize that straight pipes would need reinforcements whenever there is a T junction because there is no curve to the pipe like a 90 degree corner turn, its basically a cannon of fluid hitting a wall of pipe, instead of centrifugal force acting its just taking the full brunt of the impact and dispersing the liquid as a reaction to the impact. I would imagine that T junctions would need to be replaced or maintained quite a lot. There is an opportunity there for some art changes to reflect some realism. Unless there is some fluid guiding done within the pipe that is unseen.
In real life, fluid systems are generally overbuilt for these kinds of scenarios - unless they're huge or part of spacecraft. I don't like the first paragraph being implemented because it would penalize diagonal runs unless special rules were put in place for those - I'm hoping for visual straightening of diagonal pipes, and since that's already in for heat pipes, I'm fairly sure it's coming to normal pipes and walls soon. If you look at household supply pipes (see if you can drive to a local development that's not finished construction, or get a plumber who doesn't mind you staring at him while he works on your next routine household repair), you'll notice that T and elbow fittings are made of a considerably thicker chunk of material than straight runs for this reason. The effect is called "water hammer" (even if it's some other liquid in the pipes.) Realistic travel of gases through plumbing is even more esoteric because they transfer pressure between static and dynamic pressure, and at high speed (more dynamic pressure, less static pressure), more friction losses. The most efficient way of getting a gas around a sharp corner in a system with high flow speeds (I haven't seen any in person, but I'd expect to see it in some car factories using a lot of pneumatic tools) is to put a little tank on the corner, let the gas diffuse to a slow speed in it, and then run the outlet line out in the new direction.

GenBOOM
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Tue May 16, 2017 11:39 pm
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by GenBOOM » Fri Jan 04, 2019 3:45 am

featherwinglove wrote:
Sat Dec 29, 2018 10:37 pm
In real life, fluid systems are generally overbuilt for these kinds of scenarios... If you look at household supply pipes ... you'll notice that T and elbow fittings are made of a considerably thicker chunk of material than straight runs for this reason. The effect is called "water hammer" (even if it's some other liquid in the pipes.)
thanks for clarifying
so you are saying making corners and T junctions thicker visually has a pretty solid argument behind it if the game wants to go for realism.
will they change it now tho? I doubt it.

User avatar
featherwinglove
Filter Inserter
Filter Inserter
Posts: 578
Joined: Sat Jun 25, 2016 6:14 am
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by featherwinglove » Fri Jan 04, 2019 5:58 am

GenBOOM wrote:
Fri Jan 04, 2019 3:45 am
featherwinglove wrote:
Sat Dec 29, 2018 10:37 pm
In real life, fluid systems are generally overbuilt for these kinds of scenarios... If you look at household supply pipes ... you'll notice that T and elbow fittings are made of a considerably thicker chunk of material than straight runs for this reason. The effect is called "water hammer" (even if it's some other liquid in the pipes.)
thanks for clarifying
so you are saying making corners and T junctions thicker visually has a pretty solid argument behind it if the game wants to go for realism.
will they change it now tho? I doubt it.
I think they should change it visually, and then see if that drives calls for changing recipes, which I think is probably not going to happen. But, it's hard to predict the Factorio crowd, and certainly some of the holy wars that have erupted under the FFFs have caught the devs by surprise :lol:

Dominik
Factorio Staff
Factorio Staff
Posts: 505
Joined: Sat Oct 12, 2013 9:08 am
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by Dominik » Fri Jan 04, 2019 3:30 pm

Guys, seriously? Half of you wanted fluid teleportation.

User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 491
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by Oktokolo » Fri Jan 04, 2019 3:53 pm

Dominik wrote:
Fri Jan 04, 2019 3:30 pm
Guys, seriously? Half of you wanted fluid teleportation.
But the other half wants water hammers killing refineries if not building water hammer arresters at the right locations (minimal exaggeration). Personally i would like that too. I am fine with such stuff not making it into vanilla though.

That said: Factorio pipes are massive in comparison to the machines they feed. So maybe, the water hammer has already be taken into account...

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2161
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by steinio » Fri Jan 04, 2019 4:19 pm

Oktokolo wrote:
Fri Jan 04, 2019 3:53 pm
Dominik wrote:
Fri Jan 04, 2019 3:30 pm
Guys, seriously? Half of you wanted fluid teleportation.
But the other half wants water hammers killing refineries if not building water hammer arresters at the right locations (minimal exaggeration). Personally i would like that too. I am fine with such stuff not making it into vanilla though.

That said: Factorio pipes are massive in comparison to the machines they feed. So maybe, the water hammer has already be taken into account...
Water hammer is usually a problem with fast closing valves.
Factorio doesn't provide valves so don't overcomplicate things.

https://www.youtube.com/watch?v=xoLmVFAFjn4
Image
Transport Belt Repair Man
My little mods: Link | My favourite mods: Bob's Mods | Angel's Mods | Yuoki Railway Core | EvoGUI | Logistic Train Network
Factorio Cheat Sheet by Denis Zholob

View unread Posts

Jap2.0
Smart Inserter
Smart Inserter
Posts: 1934
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by Jap2.0 » Fri Jan 04, 2019 5:35 pm

steinio wrote:
Fri Jan 04, 2019 4:19 pm
Oktokolo wrote:
Fri Jan 04, 2019 3:53 pm
Dominik wrote:
Fri Jan 04, 2019 3:30 pm
Guys, seriously? Half of you wanted fluid teleportation.
But the other half wants water hammers killing refineries if not building water hammer arresters at the right locations (minimal exaggeration). Personally i would like that too. I am fine with such stuff not making it into vanilla though.

That said: Factorio pipes are massive in comparison to the machines they feed. So maybe, the water hammer has already be taken into account...
Water hammer is usually a problem with fast closing valves.
Factorio doesn't provide valves so don't overcomplicate things.

https://www.youtube.com/watch?v=xoLmVFAFjn4
Pumps and any machine handling fluids have valves in them.
There are 10 types of people: those who get this joke and those who don't.

lacika2000
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sat Jul 07, 2018 7:25 am
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by lacika2000 » Sat Jan 05, 2019 3:05 pm

Dominik wrote:
Fri Jan 04, 2019 3:30 pm
Guys, seriously? Half of you wanted fluid teleportation.
If we could get away with it: YES! :mrgreen:

User avatar
featherwinglove
Filter Inserter
Filter Inserter
Posts: 578
Joined: Sat Jun 25, 2016 6:14 am
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by featherwinglove » Sat Jan 05, 2019 3:59 pm

lacika2000 wrote:
Sat Jan 05, 2019 3:05 pm
Dominik wrote:
Fri Jan 04, 2019 3:30 pm
Guys, seriously? Half of you wanted fluid teleportation.
If we could get away with it: YES! :mrgreen:
What_have_I_done.png
What_have_I_done.png (21.64 KiB) Viewed 1251 times
You know what this reminds me of? :lol: :lol: :lol:

Avezo
Filter Inserter
Filter Inserter
Posts: 439
Joined: Fri Apr 01, 2016 3:53 pm
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by Avezo » Sat Jan 05, 2019 6:21 pm

"Fluid teleportation" weren't that bad idea, given potential UPS gains.

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

Re: Friday Facts #274 - New fluid system 2

Post by christian » Sat Jan 05, 2019 7:21 pm

Does anybody know if the belt system can also be multi-threaded in this way?

Zavian
Smart Inserter
Smart Inserter
Posts: 1384
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by Zavian » Sat Jan 05, 2019 8:10 pm

christian wrote:
Sat Jan 05, 2019 7:21 pm
Does anybody know if the belt system can also be multi-threaded in this way?
I'm pretty sure it can't (at least not as simply), since belts interact with inserters who interact assemblers who interact with more inserters who then interact with other belts. Since this all needs to happen in 100% deterministic order to support multiplayer, so multiple threads working on the same or adjacent chunks is like to lead to multiplayer desyncs.

See this post viewtopic.php?f=5&t=39893&start=60#p238247 by Harkonnen for more details, and viewtopic.php?f=5&t=39893&p=307819#p307388 for another suggestion of how to separate networks.

astroshak
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Thu May 10, 2018 9:59 am
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by astroshak » Sun Jan 06, 2019 2:13 am

featherwinglove wrote:
Sat Dec 29, 2018 10:37 pm
In real life, fluid systems are generally overbuilt for these kinds of scenarios - unless they're huge or part of spacecraft. I don't like the first paragraph being implemented because it would penalize diagonal runs unless special rules were put in place for those - I'm hoping for visual straightening of diagonal pipes, and since that's already in for heat pipes, I'm fairly sure it's coming to normal pipes and walls soon. If you look at household supply pipes (see if you can drive to a local development that's not finished construction, or get a plumber who doesn't mind you staring at him while he works on your next routine household repair), you'll notice that T and elbow fittings are made of a considerably thicker chunk of material than straight runs for this reason. The effect is called "water hammer" (even if it's some other liquid in the pipes.) Realistic travel of gases through plumbing is even more esoteric because they transfer pressure between static and dynamic pressure, and at high speed (more dynamic pressure, less static pressure), more friction losses. The most efficient way of getting a gas around a sharp corner in a system with high flow speeds (I haven't seen any in person, but I'd expect to see it in some car factories using a lot of pneumatic tools) is to put a little tank on the corner, let the gas diffuse to a slow speed in it, and then run the outlet line out in the new direction.
While water hammer is a concern, joints are not thicker due to it. Typically, current gen construction inside housing is going to be PVC. The plastic pipe uses slip/slip (one pipe slips into one side of the fitting, and another into the other) that are glued together. The reason the Tee’s, 90’s, 45’s, reducers, straight couplings, etc. are bigger than the PVC pipe is to allow said pipe to slip into the fitting.

While there is welding of some type, and/or threading, involved with cast or ductile iron, or copper lines, the reason the connective pieces are bigger than the pipes they connect is the same as that of PVC.

Some new construction is using PE (I’ve also heard it called PEX) which is a type of flexible plastic tube. This tubing uses compression couplings for 90’s, Tee’s, and straight couplings. And those joining pieces are, once more, larger than that which they are connecting, because the PE slips into the compression.

For mains, you typically restrain them in the ground. This is through the use of a restrained mechanical joint, or through the use of some solid barrier that absorbs the force of the water due to its inertia called a Thrust Block. Ideally, both are used (it makes things a lot simpler if having to deal with some kind of a break if all of the valves and such are restrained; it prevents things from coming apart and making an even bigger, more-watery hole) though that costs more money and isn’t very common in my experience. Thrust blocks are mostly used, in my experience, at 90’s and especially at fire hydrants (where the water 90’s from horizontal to vertical).

I work for a county water department in Florida, if you’re wondering where I’m coming up with this stuff. We generally use PE coming from the main to our meters, and the builders usually use PVC to go from the meter into, and through, the housing here. Other places may, of course, be very different.

Nightinggale
Fast Inserter
Fast Inserter
Posts: 120
Joined: Sun May 14, 2017 12:01 pm
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by Nightinggale » Wed Jan 09, 2019 5:43 pm

Zavian wrote:
Sat Jan 05, 2019 8:10 pm
christian wrote:
Sat Jan 05, 2019 7:21 pm
Does anybody know if the belt system can also be multi-threaded in this way?
I'm pretty sure it can't (at least not as simply), since belts interact with inserters who interact assemblers who interact with more inserters who then interact with other belts. Since this all needs to happen in 100% deterministic order to support multiplayer, so multiple threads working on the same or adjacent chunks is like to lead to multiplayer desyncs.

See this post viewtopic.php?f=5&t=39893&start=60#p238247 by Harkonnen for more details, and viewtopic.php?f=5&t=39893&p=307819#p307388 for another suggestion of how to separate networks.
While you are completely right with your arguments regarding the importance of deterministic code, your conclusion is way off.

The question is if the pipe approach can be used with belts and yes it should be possible. It requires setting up a deterministic sequence of events, which affects the same data (in this case items on belts). It doesn't need to be 100% the same order between versions of Factorio. It just needs to be 100% the same order in network games where everybody use the same version. This gives the freedom of altering the order if needed.

The answer is actually surprisingly simple. Make groups of entities of the same type like:
  • Belts
  • Inserters
  • Assemblers
  • Power production
  • Miners
  • ...
Instead of looping a list of entities for each tick, loop the groups and each group loops the entities of that group. Now we are free to reorder the list and while the result can depend on the order, any order will provide the deterministic calculations required by multiplayer.

With this foundation, belts can be made to run multi-threaded like pipes using the same system. Once done, it releases a lock. Inserters can't run in parallel with belts, meaning we move inserters to be last in the list and then just before inserters, we freeze the main thread until the belts have released the lock. This way belts can run multithreaded without the risk of race conditions with inserters.

However you have to think this through. Miners can also add to belts, meaning they too should run after the lock is released. Belt splitters/loaders etc could also be an issue if not considered when they should fire. Belt reading/control by circuit network could also cause issues unless it has a well defined order.

Last, but not least, mods should have access to place entities in each of the groups, meaning the groups should be defined in the modding API documentation.

Or if we go completely simple, belts will not run in parallel to anything. It will just start all belts multithreaded and the main thread will be frozen until belts are finished. This will make it even easier to avoid issues, but at the same time it won't be as UPS friendly as running say assemblers in parallel to belts.

I didn't say it's trivial (nothing is when it comes to multi-threading), but it seems a whole lot more doable to use the pipe approach on belts than "I'm pretty sure it can't (at least not as simply)" would indicate.

It's also worth adding that running entities by type could boost performance due to better memory organization, just like looping fluid boxes now loops memory sequentially. This means the sorted approach could boost performance even without adding to the core count.

User avatar
Twisted_Code
Inserter
Inserter
Posts: 45
Joined: Sat Jun 06, 2015 1:15 am
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by Twisted_Code » Fri Jan 11, 2019 6:55 pm

a scorpion species named after the game? Interesting. I'd like to think that makes all of the scorpions of that species just a bit better than the rest.
I'm looking forward to seeing how these changes to the fluid system pan out. It seems like it might complicate things a bit by telling the player "you can't place that here" and not making it clear how to fix it, but I'm sure you'll work that out in a satisfactory way in the end.
How to report bugs effectively because everyone should know this.
The game's tech tree, a visual reference guide (soon to be depreciated).

Bizz Keryear
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Thu Oct 22, 2015 5:08 am
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by Bizz Keryear » Sat Feb 02, 2019 6:10 am

Since I'm late to the party probably nobody ever will read this, but because of
Animal named after the game (kovarex)
A new species of scorpion Neobuthus Factorio was just identified and classified. My father has a hobby of going (not only) to dangerous places and identifying undiscovered species of scorpions and spiders. He offered to name one of his classifications after the game for fun. You can find the full publication here. http://www.kovarex.com/scorpio/pdf/2018 ... us_271.pdf
this Scorpion has to make it into the game ... Bossmob?

meganothing
Fast Inserter
Fast Inserter
Posts: 158
Joined: Thu Sep 15, 2016 3:04 pm
Contact:

Re: Friday Facts #274 - New fluid system 2

Post by meganothing » Mon Apr 08, 2019 12:53 pm

Bizz Keryear wrote:
Sat Feb 02, 2019 6:10 am
Animal named after the game (kovarex)
...
this Scorpion has to make it into the game ... Bossmob?
No. Scorpiontron instead of Spidertron !!!!

Post Reply

Return to “News”

Who is online

Users browsing this forum: No registered users