Re: Friday Facts #260 - New fluid system
Posted: Sat Sep 15, 2018 11:42 am
Make sure to read comments to FFF on steam too, some people seem to have good ideas too.
Actually, nuclear fuel reprocessing does (still) exist and was one of the first sources of plutonium for atomic bombs.
That's somewhat similar than my suggestion. But I believe if you go with a fixed source *current*, you will do not respect the pipe throughput limitations. You could basically connect any number of sources to a single chain of pipes. The voltage drop would go nuts, but I don't see anything in your model to limit throughput.FasterJump wrote: ↑Sat Sep 15, 2018 12:21 pmI think that using the electric network is a good idea. I propose a model based on real life water piping, the one you have in your houses. This allows to get rid of water "level" and use only pressure as variable.
Each source (ex offshore pump) works as a power source that has a fixed tension delivery (pressure).
Each drain (ex boilers) works as a power drain that demand a specific intensity consumption (flow rate).
Intermediate circuitry behave like electric resistance (1Ω for 1 tile).
A little similar, but I'm a big step further. The only similar thing is that straight pipe are calculated are one. But there's a complex calculation for each group.Jap2.0 wrote: ↑Fri Sep 14, 2018 10:14 pmThat's very similar to what they ended up doing.Elok wrote: ↑Fri Sep 14, 2018 9:07 pmAbout the pipe calculation.
Why don't you do the calculation per group instead of one calculation per piece of pipe?
Example,
To make thing simpler, let's say each pipe can hold a total number of 100 'unit' of water
Group A have 22 pipe total, 2200 unit total.
You fill the first pipe with 100 unit of water. The group A have 100/2200 unit with water. So each pipe need 1/2 unit each, in other words ~4.5/100 unit of water.
Of course, if you do that instantly, you will lose all the animation, but you can always update pipe value smoothly. In the end, it's 1 calculation per group and 1 value update per pipe.
And you'll lose the "wave" effect that we see on the FF. But, honestly, who noticed such wave feature existed? It's a gimmick that doesn't bring much to the game and is very harsh on the CPU.
Thank you!Dominik wrote: ↑Sat Sep 15, 2018 2:23 pm
@Dooces as I already wrote earlier I am considering such optimisations, although they have, so far, been low in the list. Reason is that I am afraid that it would explode to many issues of how to define the networks etc. Also, if I do it too well, imagine a huge smooth running pipe system, then due to something the refineries do not satisfy 100% demand anymore and suddenly booom, ups drop cos the optimisation does not work anymore. So I am still not sure about it.
Again, thanks everyone
No problem. I just repeat my proposal:
Will PM regarding GPU.Dominik wrote: ↑Sat Sep 15, 2018 2:23 pm<lots of snipping>
@Vxsote: I did not really mention gravity in the FFF, forgot to. I started my simulator by modelling gravity. Right now it is there, but I might just cut it out as it does not contribute anything useful, except for a bit of realism in edge cases for imo too much computation. Similar for friction - too complex and just annoying. About the GPU - how would you use it? I don't know very much about GPU computation, I recon it is good for parallel algebra, matrix operation and such. I don't know how to apply it here. PM?
@toxinate: Resistance only works proportionally, can't give you a hard limit. The Kirchoff's law computation works nicely cos all can be modelled by simple linear functions and a hard throughput limit breaks that.
@FasterJump more and more electricity proposals I am having this bad feeling that I might have made one mistake - being stuck with the assumption that a pipe must have a hard constant throughput limit. But without that, having just a soft limit that is modelable by the resistance could be good enough. Ugh.
I'm inclined to agree. Whereas belts have an alternative in bots, pipes don't, and are tricky to optimize due to the way they connect. Good! I like the puzzle.meganothing wrote: ↑Sat Sep 15, 2018 12:37 amObjection!
The autoconnecting pipes separate pipe building from belt building. If pipes work largely like belts you don't have to think differently, don't have other topological problems to solve.Ghoulish wrote: ↑Fri Sep 14, 2018 6:38 pmInteresting FFF! Great write up.
Please do add this feature, flow control is a mod which adds these and it truly does improve fluid handling, especially in the later part of the game where the pipework turns in to the proverbial spaghetti. We've all been there - you need to sneak a pipe through a gap but can't because it'll connect to the pipe next to it and different fluids would mix..
Yeah, I know the ratios need to be recalculated with every tick and nearly every traversal of the graph would be different, however, that does not change the directions of edges in the graph, it only changes which segments would need to be included in the simulation at that particular tick. However, if you do have a counter-example (and you are willing to spare the time and effort to share it) I would like to see it, to see where exactly I went wrong in my assumptions.Dominik wrote: ↑Sat Sep 15, 2018 2:23 pm@Homepage I see you have thought about it a lot, but you need to go deeper still. The graph search and drain:source ratios need to be recalculated +- every tick as the production and consumption changes +- every tick. Everything can change by that. Now if you do that and address all the details to make it work right (e.g. in your case if you have a straight saturated pipe and and a side dead branch from it, no fluid will ever reach it), you end up with the same thing I have. The topology sort I do is linear, it is really not very different.
Disagree. They made rails able to go straight or turn for a reason: reduce number of different type of stuff in your inventory. Or you drop a pipe and then hit R several times.Ghoulish wrote: ↑Fri Sep 14, 2018 6:38 pmInteresting FFF! Great write up.
Please do add this feature, flow control is a mod which adds these and it truly does improve fluid handling, especially in the later part of the game where the pipework turns in to the proverbial spaghetti. We've all been there - you need to sneak a pipe through a gap but can't because it'll connect to the pipe next to it and different fluids would mix..