Page 5 of 6

Re: round up fluids reading train inventory

Posted: Tue Dec 05, 2017 1:37 am
by doktorstick
please rito

Re: round up fluids reading train inventory

Posted: Tue Dec 05, 2017 9:49 am
by BlakeMW
I really think it should just be a hacky solution to either make pumps forcefully remove any fraction of liquid less than one, or quietly destroy fractions of liquid less than 1 (or some other threshold where pumps stop being effective at moving the remaining fraction, probably even 0.1 would be fine)

Re: round up fluids reading train inventory

Posted: Tue Dec 05, 2017 10:10 am
by mrvn
BlakeMW wrote:I really think it should just be a hacky solution to either make pumps forcefully remove any fraction of liquid less than one, or quietly destroy fractions of liquid less than 1 (or some other threshold where pumps stop being effective at moving the remaining fraction, probably even 0.1 would be fine)
They already move the last fraction out of a tank. The problem is just that if you wire them up to the tank with liquid > 0 then they stop before doing so.

Re: round up fluids reading train inventory

Posted: Tue Dec 05, 2017 10:13 am
by BlakeMW
Don't they fail to move the last fraction if there are joined tanks?

edit: nevermind. Looks like it does remove the last fraction.

Re: round up fluids reading train inventory

Posted: Mon Dec 11, 2017 9:39 am
by Crysis1
I'm currently working on powering distant outposts using oil fractions by sending out whichever of the 3 fractions I currently have the most of. The (presumably empty) train is filled with a fraction and heads out to all the outposts that have less than 10,000 petrol+heavy+2*light. When it comes back to the oil depot it needs to be drained of leftover oil so it can head to the loading station mentioned earlier and be loaded with potentially a different fraction, so it needs to be completely emptied. I can't know which unloading pump to turn on if the total amount in the train is less than 1. Of course, it would be possible to add memory cells to keep track of what trains were last loaded with what but at that point I'm solving problems which arise not from the mechanics of the gameplay but from the programming of the game, which I don't think players should have to do.

I've read through this thread and realize changing from floor to ceiling would create problems too. But what about making it so that a pump won't leave <1 fluid in a tank by only pumping tankAmount-1 if that would occur. That's less extra cpu usage than a single pipe would use, it would be unnoticeable. I don't think many designs depend on precise pump speed unless somebody is using pumps for clocks.

Re: round up fluids reading train inventory

Posted: Mon Dec 11, 2017 12:25 pm
by mrvn
Crysis1 wrote:I'm currently working on powering distant outposts using oil fractions by sending out whichever of the 3 fractions I currently have the most of. The (presumably empty) train is filled with a fraction and heads out to all the outposts that have less than 10,000 petrol+heavy+2*light. When it comes back to the oil depot it needs to be drained of leftover oil so it can head to the loading station mentioned earlier and be loaded with potentially a different fraction, so it needs to be completely emptied. I can't know which unloading pump to turn on if the total amount in the train is less than 1. Of course, it would be possible to add memory cells to keep track of what trains were last loaded with what but at that point I'm solving problems which arise not from the mechanics of the gameplay but from the programming of the game, which I don't think players should have to do.

I've read through this thread and realize changing from floor to ceiling would create problems too. But what about making it so that a pump won't leave <1 fluid in a tank by only pumping tankAmount-1 if that would occur. That's less extra cpu usage than a single pipe would use, it would be unnoticeable. I don't think many designs depend on precise pump speed unless somebody is using pumps for clocks.
Note that a pump does not pump from a tank. The tank naturally flows into the pump input fluid box. The pump then "pumps" that fluid to the output fluid box where it again flows naturally out of the pump. To do what you describe would mean changing the generic fluid box.

Re: round up fluids reading train inventory

Posted: Mon Dec 11, 2017 12:47 pm
by Crysis1
mrvn wrote:Note that a pump does not pump from a tank. The tank naturally flows into the pump input fluid box. The pump then "pumps" that fluid to the output fluid box where it again flows naturally out of the pump. To do what you describe would mean changing the generic fluid box.
I see that would be no good. On second thought the problem is not with the fluid mechanics but with the circuit network. Perhaps we can add a checkmark to round up instead of down on objects which round floating point numbers. Looks like the only such objects are the storage tank, the pumpjack, the accumulator and the train stop. An option in the options menu could also be added to enable this checkbox so it doesn't clutter up menus.

Re: round up fluids reading train inventory

Posted: Mon Dec 11, 2017 1:22 pm
by mrvn
Crysis1 wrote:
mrvn wrote:Note that a pump does not pump from a tank. The tank naturally flows into the pump input fluid box. The pump then "pumps" that fluid to the output fluid box where it again flows naturally out of the pump. To do what you describe would mean changing the generic fluid box.
I see that would be no good. On second thought the problem is not with the fluid mechanics but with the circuit network. Perhaps we can add a checkmark to round up instead of down on objects which round floating point numbers. Looks like the only such objects are the storage tank, the pumpjack, the accumulator and the train stop. An option in the options menu could also be added to enable this checkbox so it doesn't clutter up menus.
The signal network should simply round up if the value is less than 1. So 0 is only ever reported when a tank really is empty. And since this would only affect checks for 0 there would be minimal impact. Basically only fixes setups that are currently broken.

Re: round up fluids reading train inventory

Posted: Mon Dec 11, 2017 3:53 pm
by bobucles
Off by 0.00000000012143569827 errors truly are the worst.

Re: round up fluids reading train inventory

Posted: Tue Jan 02, 2018 5:57 am
by Zavian
What looks like a related bug report viewtopic.php?t=56031.

Re: round up fluids reading train inventory

Posted: Tue Jan 02, 2018 7:44 am
by Koub
@Zavian : I took the liberty to edit your post to fix the link (you linked to "answering" the other bug report, I think this was unintended).

Re: round up fluids reading train inventory

Posted: Mon Jan 15, 2018 4:19 pm
by steinio
This mod tries to fix the issue.
https://mods.factorio.com/mods/Shia/shi ... in-pumping

Has anybody tested it?

Re: round up fluids reading train inventory

Posted: Tue Nov 13, 2018 1:22 pm
by rdrunner
I posted a solution to the issue here:

https://www.reddit.com/r/factorio/comme ... requestor/

!blueprint https://pastebin.com/3dpi3Mpg

It is using a small timer and a latch in order to keep the pump active and actually empty the wagon:

Re: round up fluids reading train inventory

Posted: Thu Jan 10, 2019 8:27 pm
by ssilk
+11
This "bug" now tooks me about 5 hours to fix the completly contamined liquid network in my megabase.

BTW: I hope with the new fluid network it will not be possible to feed any liquid into a station, that is not thought to handle it. E.g. handle sulfur acid for a refinery station.

And vice versa: I hope with the new fluid network it will be possible to make stations, that can handle any kind of fluid. That needs sensors to check, what kind of fluid (or none) is in a part of a network flowing.

Re: round up fluids reading train inventory

Posted: Fri Jan 11, 2019 1:25 pm
by Darinth
The recent FFF that specifically showcased the new fluid system seemed very specific that it would not allow fluid mixing in the same pipe network. Unfortunately, I don't think your request for a single network able to hold different kinds of fluids and route them will happen. :(

Re: round up fluids reading train inventory

Posted: Mon Jan 14, 2019 12:54 pm
by mrvn
It only needs 2 things:

1) A pump, pipe or tank that has a fluid filter so it only accepts one fluid type.
2) the pipe network will become empty when something somewhere accepts the fluid (see 1).

Then you can unload the train and "sort" any liquid into a separate pipe network.

Re: [0.17.43] round down floats <1.0 leads to undesired behaviors

Posted: Sun Jun 02, 2019 8:51 am
by Cobaltur
Twinsen wrote:
Mon Jun 05, 2017 3:55 pm
Oh no, not this again.
I remember the rounding method was changed about 2 times due to problems like this.
Won't rounding up(in all cases including storage tanks, since it has to be consistent) cause other problems in other setups?

I'll add this to my TODO and hopefully we can fix it.
We might implement a mechanic where large high pressure fluids would destroy static small amounts of leftover fluid. This would also solve the "delete and replace all pipes because I accidentally put the wrong fluid in it for 1 second" problem.
We are also considering remove all the pipe fluid physics and replacing it with a much simpler model, similar to how electric networks work.
2 years ago it seems not high or no longer on the todo list.

last developer statement was 2 years ago was in "ideas and suggestions".
And in the referred topic many people give good examples why the current implementation is still not the expected.

Twinsen wrote:
Fri Jul 21, 2017 9:48 am
It's not as simple as rounding up.

If I round up soon there will be a flood of complaints from a different group of people saying that their storage tank logic no longer works, because there is 0.00001 fluid in their storage tank that they can't pump out. Or similar problems to this.
but reading singals from the source and rounding up, will solve this issue ;)


You referring "someone" will complain. This is bad argument style. We are asked to deliver good examples to prove that somehting is a bug and you refer just to "someone might complain".

If you thing the fluid flow is the source of the problem. Ok. But I don't want to talk over the fluid flow, just the signals.

Please also give at least one good example why rounding up singals is a bad idea. PersonaIly I cannot see it. This would help me not to insist on handling this as bug.

Thx

Re: round up fluids reading train inventory

Posted: Fri Jan 03, 2020 11:46 pm
by ptx0
is this getting any kind of attention at all?

Re: round up fluids reading train inventory

Posted: Mon Jan 13, 2020 11:55 am
by mrvn
ptx0 wrote:
Fri Jan 03, 2020 11:46 pm
is this getting any kind of attention at all?
no

Re: round up fluids reading train inventory

Posted: Mon Jan 13, 2020 3:39 pm
by Optera
mrvn wrote:
Mon Jan 13, 2020 11:55 am
ptx0 wrote:
Fri Jan 03, 2020 11:46 pm
is this getting any kind of attention at all?
no
Sadly. Fluid unloading is as much a pain as ever and most frustratingly the fix is a simple change that wouldn't hurt anything else.