Fluid Level Indicator


Numerical display showing the fluid/gas level in a system.

Tweaks
a month ago
1.1 - 2.0
55.9K
Fluids

g Fluid level limit?

4 months ago

Hi, this is a long shot and you may or may not be able or willing to help me.

I made a personal mod that increases the pipes capacity to 600, by setting base_area to 6 and height to 1 for pipes and pumps.

I modified your mod so that the fluid box of all pipes, straight or 4 way, standard or k2 (steel) also have base_area 6 and height 1

In game your pipes show was having 600 capacity but they never fill past 100 even though there is a pump and it's surrounded by pipes filled to 600.

I'm running out of ideas and I'm hoping you could have a insight of what I must be missing.

4 months ago

Hi,

I am happy to help, but I need more info. I tested this on my setup with the code below, and it seems to work fine for me. Screenshot here

Do you mind sharing a screenshot and you code? What other mods are you using?

fluid_level_indicator.fluid_box = 
{
      base_area = 6,
      base_level = 0,
      height = 1,
4 months ago

oh man the fluid system in this game is just so weird!

this is what I have for my fluid box:

    fluid_box = {
      base_area = fluid_box_area,
      height = fluid_box_height,
      pipe_connections = {
        { position = { 0, -1 } },
        { position = { 1, 0 } },
        { position = { 0, 1 } },
        { position = { -1, 0 } },
      },
    },

the area and height are variables because I use the function this code it is to create two entities, one where base area is 6 and height 1, and another where base area is 1 and height is 6, I just tried different stuff and I kinda gave up. Update 2.0 is coming soon and it will fix the fluid system so I will just let it go for the time being.

thanks for replying man! you're awesome!

4 months ago

It does take some getting used to :)
I don't see it specifically, but is the base_level = 0 in your code? If that is higher that could be the reason why the fluid isn't flowing into it.

4 months ago

it's not set explicitly, it assumes 0 by default

4 months ago

I feel like this is an issue that affects long chains of pipes and so far the best alternative I found was to override the pipe behavior by processing the fluids on every few ticks, but that feels so waste in UPS terms

4 months ago

Not sure about your setup, but yes long chains of pipes need a pump from time to time to keep the fluid moving faster.
So is it more of a speed issue on your end, not that the fluid just can't go above 100/600? Do you mind uploading a screenshot?

4 months ago

Here is a screenshot that shows the issue:
https://www.dropbox.com/scl/fi/k8no1cs9weotq7aozahuy/fluid-mechanics.png?rlkey=6fj6x4527zfzv53oa4zjto5rv&dl=0

I understand now that the reason it happens is because the two pipes exchange fluid not in absolute terms, but in percentage, so they try to balance their percentage fill level, which is lame, in my opinion. I feel like if there is 450 units of liquid in one side and 70 on the other side, that other side should have been filled to its capacity of 100 and the fact it's not, it's just bonkers!

4 months ago

Not exactly, you have to imagine them as actual fluid containers. The dimensions of the fluid box are what matter, and the fluid level (in terms of height). You are comparing two different base area fluid boxes.
The reason is the following: Imagine the fluid boxes next to each other. You have a massive base area pool, like a huge swimming pool with the same height as a tiny pool next to each other. When you join them, the water level will be at the same height in both pools, therefore the large base area pool will have a lot more fluid in it compared to the small pool. The water levels will be equal but because of the base area difference, the actual fluid volume will be totally different.

4 months ago

oh wow... that's a very interesting analogy, it makes more sense now

New response