We are also having a lot of trouble with this in our base. We have a single train stop where trains where 3 different liquids arrive (controlled by LTN but that's actually not terribly relevant), and we need to enable only the right pumps. Sadly, the pumps shut off before the tank is empty, due to the rounding.
Given that the devs see problems with always rounding up, I am not sure what the best solution here would be. Some ideas:
- Somehow make it so that containers can never contain fractional amounts of liquids.
- Have a setting at the train stop / fluid tank that controls rounding up vs down.
round up fluids reading train inventory
Moderator: ickputzdirwech
-
- Inserter
- Posts: 35
- Joined: Sun Jun 26, 2016 9:37 pm
- Contact:
Re: round up fluids reading train inventory
Or add a way to control fluid flushing by circuit network. This has been requested when fluid flushing was added, and would probably address your issue (with a systematic flush whenever a train leaves the station for example).
[Edit] : viewtopic.php?f=6&t=86216
[Edit] : viewtopic.php?f=6&t=86216
Koub - Please consider English is not my native language.
Re: round up fluids reading train inventory
Why fluids cannot be integer as items?
Re: round up fluids reading train inventory
Actually that you are using LTN helps avoid this problem. Some while ago I wrote a patch for LTN so the yellow constant combinator on the LTN Stop outputs a -1 signal for any fluid to unload. If you connect your pumps to the yellow constant combinator (not the train stop) and set them to '<liquid> != 0' then they will do the right thing for unloading.Ralfinator wrote: Fri Jul 31, 2020 7:51 am We are also having a lot of trouble with this in our base. We have a single train stop where trains where 3 different liquids arrive (controlled by LTN but that's actually not terribly relevant), and we need to enable only the right pumps. Sadly, the pumps shut off before the tank is empty, due to the rounding.
Given that the devs see problems with always rounding up, I am not sure what the best solution here would be. Some ideas:
- Somehow make it so that containers can never contain fractional amounts of liquids.
- Have a setting at the train stop / fluid tank that controls rounding up vs down.
Note: works for loading too if you always request full fluid wagons. Partial loads still need an arithmetic combinator.
Re: round up fluids reading train inventory
Because the math for moving liquids through pipes would become verry rough if it had to limit itself to integers. An output of 50 liquid for example would not even travel 10 pipe length because it takes 55 units to maintain a one unit gradient for that length. Fluids wouldn't get far enough and be stop-and-go like a traffic jam on a highway.
Re: round up fluids reading train inventory
With the current unfinished/broken fluid mechanics.mrvn wrote: Fri Jul 31, 2020 1:38 pmBecause the math for moving liquids through pipes would become verry rough if it had to limit itself to integers. An output of 50 liquid for example would not even travel 10 pipe length because it takes 55 units to maintain a one unit gradient for that length. Fluids wouldn't get far enough and be stop-and-go like a traffic jam on a highway.
Oxygen not Included for example has more robust and easier to understand fluid mechanics that would work perfectly fine with integer numbers.
My Mods: mods.factorio.com
Re: round up fluids reading train inventory
Same with Satisfactory's pipe mechanics.Optera wrote: Sat Aug 01, 2020 9:15 amWith the current unfinished/broken fluid mechanics.mrvn wrote: Fri Jul 31, 2020 1:38 pmBecause the math for moving liquids through pipes would become verry rough if it had to limit itself to integers. An output of 50 liquid for example would not even travel 10 pipe length because it takes 55 units to maintain a one unit gradient for that length. Fluids wouldn't get far enough and be stop-and-go like a traffic jam on a highway.
Oxygen not Included for example has more robust and easier to understand fluid mechanics that would work perfectly fine with integer numbers.
-
- Inserter
- Posts: 35
- Joined: Sun Jun 26, 2016 9:37 pm
- Contact:
Re: round up fluids reading train inventory
I had in the past checked that combinator to see if it would output the requested amount on an LTN requester (similar to how it does the same on an LTN provider, so I thought that would make a lot of sense -- not just for fluids), and it did not -- I saw no output at all from the yellow combinator. I just tried again, still no luck. Are you sure that patch is working? This is with LTN 1.13.10.Actually that you are using LTN helps avoid this problem. Some while ago I wrote a patch for LTN so the yellow constant combinator on the LTN Stop outputs a -1 signal for any fluid to unload. If you connect your pumps to the yellow constant combinator (not the train stop) and set them to '<liquid> != 0' then they will do the right thing for unloading.
Re: round up fluids reading train inventory
https://github.com/Yousei9/Logistic-Tra ... e.lua#L466Ralfinator wrote: Sun Aug 09, 2020 8:36 pmI had in the past checked that combinator to see if it would output the requested amount on an LTN requester (similar to how it does the same on an LTN provider, so I thought that would make a lot of sense -- not just for fluids), and it did not -- I saw no output at all from the yellow combinator. I just tried again, still no luck. Are you sure that patch is working? This is with LTN 1.13.10.Actually that you are using LTN helps avoid this problem. Some while ago I wrote a patch for LTN so the yellow constant combinator on the LTN Stop outputs a -1 signal for any fluid to unload. If you connect your pumps to the yellow constant combinator (not the train stop) and set them to '<liquid> != 0' then they will do the right thing for unloading.
Code: Select all
elseif c.type == "fluid_count" then
if (c.condition.comparator == "=" and c.condition.constant == 0) then
--train expects to be unloaded of each of this fluid
fluidInventory[c.condition.first_signal.name] = -1
elseif c.condition.comparator == "≥" then
--train expects to be loaded to x of this fluid
fluidInventory[c.condition.first_signal.name] = c.condition.constant
end
end
-
- Inserter
- Posts: 35
- Joined: Sun Jun 26, 2016 9:37 pm
- Contact:
Re: round up fluids reading train inventory
mrvn you are right -- I have a rail signal right next to the train stop and it is all covered by the train stop graphics, so I accidentally connected the wire to the signal instead of the combinator. There is a "-1" on the combinator, so we'll start using that now instead of our horrible contraption of 40 arithemtic combinators chained to form a "delay line".
Thanks for the help and sorry for the confusion!
Thanks for the help and sorry for the confusion!