0.15.10 Fluid wagon leaving even though condition is not met
-
- Inserter
- Posts: 22
- Joined: Sat Mar 04, 2017 11:10 am
- Contact:
0.15.10 Fluid wagon leaving even though condition is not met
This is not a big bug, but still.
How to reproduce:
1, build a train with fluid wagon and fill it with crude oil (I tried crude oil, probably doesnt matter what you fill it with)
2,Build a station, set the leaving condition of the train to fluid count: empty
3, Pump out the crude oil.
4, watch train leave even though it has 0,8 crude oil in it
Only one part of the wagon was empty, other two had 0,4 crude oil in them.(screenshot)
Is this a bug or is the fluid count rounded down so 0.8 was considered 0 and train left? Not sure so posted it.
How to reproduce:
1, build a train with fluid wagon and fill it with crude oil (I tried crude oil, probably doesnt matter what you fill it with)
2,Build a station, set the leaving condition of the train to fluid count: empty
3, Pump out the crude oil.
4, watch train leave even though it has 0,8 crude oil in it
Only one part of the wagon was empty, other two had 0,4 crude oil in them.(screenshot)
Is this a bug or is the fluid count rounded down so 0.8 was considered 0 and train left? Not sure so posted it.
- Attachments
-
- 20170515164622_1.jpg (816.29 KiB) Viewed 7599 times
Re: 0.15.10 Fluid wagon leaving even though condition is not met
Signals only work in integers, therefore anything < 1 is considered empty.
Re: 0.15.10 Fluid wagon leaving even though condition is not met
Oh this damned fluids.Loewchen wrote:Signals only work in integers, therefore anything < 1 is considered empty.
What happens if i fill water in the wagon after that?
Greetings, steinio.
Re: 0.15.10 Fluid wagon leaving even though condition is not met
PUSH
Why is this on not a bug?
This damned fluid behavior is so annoying.
What should we do with an unempty rail tanker with 0.1 liquid?
Get this sorted out!
Why is this on not a bug?
This damned fluid behavior is so annoying.
What should we do with an unempty rail tanker with 0.1 liquid?
Get this sorted out!
Re: 0.15.10 Fluid wagon leaving even though condition is not met
Use the 'inventory empty' condition if you want the train to leave when its emptysteinio wrote:PUSH
Why is this on not a bug?
This damned fluid behavior is so annoying.
What should we do with an unempty rail tanker with 0.1 liquid?
Get this sorted out!
Re: 0.15.10 Fluid wagon leaving even though condition is not met
This workaround is not usable if you have a train set to unload only part of it's contents.Klonan wrote: Use the 'inventory empty' condition if you want the train to leave when its empty
e.g. have a train picking up lubricant and sulfuric acid to distribute it to 2 different stations.
Schedule checks for fluid contents should always round up.
My Mods: mods.factorio.com
Re: 0.15.10 Fluid wagon leaving even though condition is not met
what happens if you multiply the signal by 100,000?
Would that work?
Would that work?
Re: 0.15.10 Fluid wagon leaving even though condition is not met
0.1 is rounded to 0, 0*100k = 0.BenSeidel wrote:what happens if you multiply the signal by 100,000?
Would that work?
I have no idea if circuit signals would actually round 0.6 up. Pumps are now so powerful it's hard to get them to leave anything between 0.5 and 0.9 in a tank.
My Mods: mods.factorio.com
Re: 0.15.10 Fluid wagon leaving even though condition is not met
Yeah, for some reason I thought that the rounding happened as the signal entered the combinator, not as it left the storage tank. But now I think about it I realise how stupid that sounds.Optera wrote:0.1 is rounded to 0, 0*100k = 0.BenSeidel wrote:what happens if you multiply the signal by 100,000?
Would that work?
I have no idea if circuit signals would actually round 0.6 up. Pumps are now so powerful it's hard to get them to leave anything between 0.5 and 0.9 in a tank.
The only solution is to simply not use floating point numbers in computer software.
Re: 0.15.10 Fluid wagon leaving even though condition is not met
The only solution is to round to int according to application.BenSeidel wrote:The only solution is to simply not use floating point numbers in computer software.
This application is especially simple since there is no case where rounding down is required. No one cares if a train set to leave at fluid >= 75k leaves at 74999.1, but if a train set to fluid = 0 leaves a 0.9 that's a problem.
My Mods: mods.factorio.com
Re: 0.15.10 Fluid wagon leaving even though condition is not met
Can't find the original thread, but it rounds that way because of the UI rounds. People were setting conditions that tested for full tanks, such as "crude oil = 2500" and it was never true, due to the rounding issues, so the rounding was changed to what it is now. It hasn't been an issue because checking if something is empty is fine, because the tanks didn't get disconnected. It would still play havoc with pumps in some extreme cases though.Optera wrote:The only solution is to round to int according to application.BenSeidel wrote:The only solution is to simply not use floating point numbers in computer software.
This application is especially simple since there is no case where rounding down is required. No one cares if a train set to leave at fluid >= 75k leaves at 74999.1, but if a train set to fluid = 0 leaves a 0.9 that's a problem.
Re: 0.15.10 Fluid wagon leaving even though condition is not met
The last change to rounding of fluids in circuit network I recall was when I reported Combinator displays inconsistent values on mouse over.BenSeidel wrote:Can't find the original thread, but it rounds that way because of the UI rounds. People were setting conditions that tested for full tanks, such as "crude oil = 2500" and it was never true, due to the rounding issues, so the rounding was changed to what it is now. It hasn't been an issue because checking if something is empty is fine, because the tanks didn't get disconnected. It would still play havoc with pumps in some extreme cases though.Optera wrote:The only solution is to round to int according to application.BenSeidel wrote:The only solution is to simply not use floating point numbers in computer software.
This application is especially simple since there is no case where rounding down is required. No one cares if a train set to leave at fluid >= 75k leaves at 74999.1, but if a train set to fluid = 0 leaves a 0.9 that's a problem.
However with fluid wagons and stops reporting train contents requirements for circuit network have changed. I'd gladly take a minor discrepancy between mouse over and circuit network if it means I can discern if that wagon is truly empty or still has a 0.01 residue locking it to that fluid.
Rounding to next full integer wouldn't break existing setups either. A condition = 2500 would just trigger a bit earlier on 2499.1 instead of 2499.5
My Mods: mods.factorio.com
Re: 0.15.10 Fluid wagon leaving even though condition is not met
Hi,BenSeidel wrote:Can't find the original thread, but it rounds that way because of the UI rounds. People were setting conditions that tested for full tanks, such as "crude oil = 2500" and it was never true, due to the rounding issues, so the rounding was changed to what it is now. It hasn't been an issue because checking if something is empty is fine, because the tanks didn't get disconnected. It would still play havoc with pumps in some extreme cases though.Optera wrote:The only solution is to round to int according to application.BenSeidel wrote:The only solution is to simply not use floating point numbers in computer software.
This application is especially simple since there is no case where rounding down is required. No one cares if a train set to leave at fluid >= 75k leaves at 74999.1, but if a train set to fluid = 0 leaves a 0.9 that's a problem.
the thread was this: viewtopic.php?f=11&t=24558 but the point was not the displayed value but the wrong rounding - the same groundhog as every day.
But why should the developers listen to the users, they just decided to multiply fluids by 10 - what a wonderful idea...
- pezzawinkle
- Fast Inserter
- Posts: 113
- Joined: Thu Jan 12, 2017 1:28 am
- Contact:
Re: 0.15.10 Fluid wagon leaving even though condition is not met
In that case, you should be able to "round to even", or embed the "greater or less than" with each appropriate rounding method. Either would solve the edge cases. I know its not a simple conversion, but it should be do-able. The other quick fix (this may still bugger with a few things), is to have the fluid count be made an integer by passing 100* (or 10*) fluid to the circuit network so it is still detected below a threshold?Optera wrote:The last change to rounding of fluids in circuit network I recall was when I reported Combinator displays inconsistent values on mouse over.BenSeidel wrote:Can't find the original thread, but it rounds that way because of the UI rounds. People were setting conditions that tested for full tanks, such as "crude oil = 2500" and it was never true, due to the rounding issues, so the rounding was changed to what it is now. It hasn't been an issue because checking if something is empty is fine, because the tanks didn't get disconnected. It would still play havoc with pumps in some extreme cases though.Optera wrote:The only solution is to round to int according to application.BenSeidel wrote:The only solution is to simply not use floating point numbers in computer software.
This application is especially simple since there is no case where rounding down is required. No one cares if a train set to leave at fluid >= 75k leaves at 74999.1, but if a train set to fluid = 0 leaves a 0.9 that's a problem.
However with fluid wagons and stops reporting train contents requirements for circuit network have changed. I'd gladly take a minor discrepancy between mouse over and circuit network if it means I can discern if that wagon is truly empty or still has a 0.01 residue locking it to that fluid.
Rounding to next full integer wouldn't break existing setups either. A condition = 2500 would just trigger a bit earlier on 2499.1 instead of 2499.5