[0.15] Different behavior of train stop and circuit network

Things that has been reported already before.
Post Reply
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 882
Joined: Sun Mar 20, 2016 2:51 am
Contact:

[0.15] Different behavior of train stop and circuit network

Post by Impatient »

Stripped down, the problem is:
For values from 0 < x < 1 the train stop says a fluid wagon is not empty (with test [cargo inventory empty] ), while the circuit network says it is empty.

This results from the facts that

a) - the test in the circuit network ( fluid > 0 ) is also FALSE for everything <1. It is TRUE for everything >= 1. This appears to be the rounding behavior of factorio.
b) - the test in the train stop conditions ( cargo inventory empty ) is only TRUE for ( fluid = 0 exactly ).


An issue resulting from a) alone is, that for values between 0 and 1 it is impossible to determine what kind of fluid is in a fluid wagon. The circuit network test ( fluid > 0 ) is always FALSE.

I ran into this, when trying to build a fluid unloading station, where several pumps, attached to pipe networks of different fluids, would unload from the same wagon location, depending on what kind of fluid is in the wagon. (eg I want to unload water and oil from the same station. Even more, the water wagon or the oil wagon would stand in the same car slot. At this car slot are two pumps. One is for water and the other one is for oil. They activate, depending on the type of fluid in the fluid wagon. All 3 tanks on one fluid wagon are connected in each case. So there is only one type of fluid in a fluid wagon.) To test what kind of fluid is in the wagon, I test for ( fluid > 0 ) in the circuit network, connected to the train station, eg ( water > 0 ). But this does not work if the wagon is almost empty. (Side question: Can I determine what fluid is in the wagon, in a different manner?)

No biggie. True that. But non-exact. Other follow up problems emerge. One is, that the pumps are deactivating before the wagon is empty. And the train, waiting for its inventory to be emptied, does not leave the station ever again. So I can not test for (cargo inventory empty) in the train stop conditions. I test for ( Fluid count fluid < 1 ). Then it works. The train leaves almost empty.


User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 882
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: [0.15] Different behavior of train stop and circuit network

Post by Impatient »

Loewchen wrote:47626
yeah. very interesting. so, how do I determine, what is in a fluid wagon, when there is something in it, but lower than 1? You got a link for that as well?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13198
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.15] Different behavior of train stop and circuit network

Post by Rseding91 »

Impatient wrote:
Loewchen wrote:47626
yeah. very interesting. so, how do I determine, what is in a fluid wagon, when there is something in it, but lower than 1? You got a link for that as well?
You don't through the circuit network.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 882
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: [0.15] Different behavior of train stop and circuit network

Post by Impatient »

Rseding91 wrote:
Impatient wrote:
Loewchen wrote:47626
yeah. very interesting. so, how do I determine, what is in a fluid wagon, when there is something in it, but lower than 1? You got a link for that as well?
You don't through the circuit network.
Feature request?

User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 882
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: [0.15] Different behavior of train stop and circuit network

Post by Impatient »

Rseding91 wrote:
Impatient wrote:
Loewchen wrote:47626
yeah. very interesting. so, how do I determine, what is in a fluid wagon, when there is something in it, but lower than 1? You got a link for that as well?
You don't through the circuit network.
will this problem be addressed by "fluid squashing" in 0.16? https://wiki.factorio.com/Upcoming_features

Rseding91
Factorio Staff
Factorio Staff
Posts: 13198
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.15] Different behavior of train stop and circuit network

Post by Rseding91 »

Impatient wrote:
Rseding91 wrote:
Impatient wrote:
Loewchen wrote:47626
yeah. very interesting. so, how do I determine, what is in a fluid wagon, when there is something in it, but lower than 1? You got a link for that as well?
You don't through the circuit network.
will this problem be addressed by "fluid squashing" in 0.16? https://wiki.factorio.com/Upcoming_features
No, "fluid squashing" is eliminating small amounts of fluid when a different fluid type tries to flow into the thing holding it.
If you want to get ahold of me I'm almost always on Discord.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13198
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.15] Different behavior of train stop and circuit network

Post by Rseding91 »

Impatient wrote:Feature request?
The circuit network specifically rounds fluids down when putting them in the network. I don't think that's going to change since it did at one point round up and caused all kinds of other problems.

There's no perfect answer if you want to use the circuit network since it doesn't deal with floating point values.
If you want to get ahold of me I'm almost always on Discord.


User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 882
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: [0.15] Different behavior of train stop and circuit network

Post by Impatient »

Rseding91 wrote:
Impatient wrote:
Rseding91 wrote:
Impatient wrote:
Loewchen wrote:47626
yeah. very interesting. so, how do I determine, what is in a fluid wagon, when there is something in it, but lower than 1? You got a link for that as well?
You don't through the circuit network.
will this problem be addressed by "fluid squashing" in 0.16? https://wiki.factorio.com/Upcoming_features
No, "fluid squashing" is eliminating small amounts of fluid when a different fluid type tries to flow into the thing holding it.
This actually could also solve the "locked by residual fluid fluid wagon" issue if also applied to fluid wagons with x<1 amounts in it.

Post Reply

Return to “Duplicates”