Occasionally not detecting full fluid wagon

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
mauhler31
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Nov 27, 2022 3:59 am
Contact:

Occasionally not detecting full fluid wagon

Post by mauhler31 »

Factorio version: 1.1.70-1

I have tried to setup a fluid provider station for 1 fluid wagon worth of heavy oil. However, the train is stuck at the station even though the fluid wagon is full. When I click into the train, it shows that the train condition for fluid contents >= 25k is not satisfied even though when I look at the fluid wagon, it shows 25k. This seem to have happened after the request timed out. I'm not sure if that could have caused this.

Are there any workarounds I can try? Thanks.
Screenshot (1).png
Screenshot (1).png (98.58 KiB) Viewed 2091 times
Screenshot (2).png
Screenshot (2).png (3.03 MiB) Viewed 2091 times

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [1.18.0] Occasionally not detecting full fluid wagon

Post by Optera »

1) This should be in general gameplay help.
LTN uses base game schedule-train interactions.

2) Going by the schedule the train is not filled to 25k.
Remember the GUI and circuit network round up.
Last edited by Optera on Tue Nov 29, 2022 6:36 am, edited 1 time in total.

mauhler31
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Nov 27, 2022 3:59 am
Contact:

Re: [1.18.0] Occasionally not detecting full fluid wagon

Post by mauhler31 »

Sorry I'm not sure I understand your suggestion. The train schedule says I haven't met the 25k condition but when I check the fluid wagon contents I do have 25k.

Nidan
Filter Inserter
Filter Inserter
Posts: 257
Joined: Sat Nov 21, 2015 1:40 am
Contact:

Re: Occasionally not detecting full fluid wagon

Post by Nidan »

Try changing the condition to "> 24999".
Optera wrote:
Mon Nov 28, 2022 9:47 am
Remember the and circuit network round up.
Missing a word there?

Circuit network rounds down, unless it's a fluid in (0, 1], which is rounded up (to 1). Most, if not all, other displays round normally.

So, even if the wagon is at 24999.999 and everything displays "25k", the circuit network will see 24999 which is less than 25000 so the condition is not fulfilled.
With fluids I recommend only using the full/empty cargo conditions or, if they can't be used, account for potential floating point imprecision in the conditions.

mauhler31
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Nov 27, 2022 3:59 am
Contact:

Re: Occasionally not detecting full fluid wagon

Post by mauhler31 »

When I hit this scenario, I waited about 10 minutes for it to try to resolve itself but it never did. Even if at one point in time the fluid wagon was 24999 instead of 25000, shouldn't the pump have been able to pump the remaining fluid into the wagon? Is it possible there is a rounding error in the fluid wagon contents calculation?

In terms of workarounds, the train conditions are set by LTN. Optera, is it possible to have LTN round down the train condition when handling fluids, or is there a way to tell LTN to request an amount smaller than a full wagon? (ie 24k)

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Occasionally not detecting full fluid wagon

Post by Optera »

Nidan wrote:
Tue Nov 29, 2022 6:50 am
Circuit network rounds down, unless it's a fluid in (0, 1], which is rounded up (to 1). Most, if not all, other displays round normally.

So, even if the wagon is at 24999.999 and everything displays "25k", the circuit network will see 24999 which is less than 25000 so the condition is not fulfilled.
With fluids I recommend only using the full/empty cargo conditions or, if they can't be used, account for potential floating point imprecision in the conditions.
Last I checked Factorio uses mathematical rounding everywhere. (>= 0,5 is rounded UP)

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Occasionally not detecting full fluid wagon

Post by Optera »

mauhler31 wrote:
Wed Nov 30, 2022 4:49 am
When I hit this scenario, I waited about 10 minutes for it to try to resolve itself but it never did. Even if at one point in time the fluid wagon was 24999 instead of 25000, shouldn't the pump have been able to pump the remaining fluid into the wagon? Is it possible there is a rounding error in the fluid wagon contents calculation?

In terms of workarounds, the train conditions are set by LTN. Optera, is it possible to have LTN round down the train condition when handling fluids, or is there a way to tell LTN to request an amount smaller than a full wagon? (ie 24k)
Don't ask for workarounds you disabled.
LTN adds a default stop timeout of 120s, after which trains are forced to leave stations.

Anyway since this is now a base game interaction I consider it resolved for LTN.

sparr
Smart Inserter
Smart Inserter
Posts: 1414
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Occasionally not detecting full fluid wagon

Post by sparr »

If there's any fluid at all in the storage tank, which the alt mode icon suggests there is, then the pump should be able to put the last unit(s) of fluid into the fluid wagon. If you have a save showing this situation, I recommend posting it as a bug report.

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Occasionally not detecting full fluid wagon

Post by FuryoftheStars »

Optera wrote:
Wed Nov 30, 2022 5:52 am
Nidan wrote:
Tue Nov 29, 2022 6:50 am
Circuit network rounds down, unless it's a fluid in (0, 1], which is rounded up (to 1). Most, if not all, other displays round normally.

So, even if the wagon is at 24999.999 and everything displays "25k", the circuit network will see 24999 which is less than 25000 so the condition is not fulfilled.
With fluids I recommend only using the full/empty cargo conditions or, if they can't be used, account for potential floating point imprecision in the conditions.
Last I checked Factorio uses mathematical rounding everywhere. (>= 0,5 is rounded UP)
Unless something changed recently, last I remember, the circuit network truncates/drops the decimal portion. I've had situations before where the value in the circuit network was 1 lower than what the gui showed.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics

Loewchen
Global Moderator
Global Moderator
Posts: 8964
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Occasionally not detecting full fluid wagon

Post by Loewchen »

The condition is not set to >= 25000 based on the progress bar in the first screenshot, look like 25900.

mauhler31
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Nov 27, 2022 3:59 am
Contact:

Re: Occasionally not detecting full fluid wagon

Post by mauhler31 »

It seems like I got confused since the condition displayed was truncated. I believe the problem was that I hadn't set a LTN max train length so it was trying to request more than a single wagon load. I haven't encountered this since I added it.

Really appreciate all the help!

Post Reply

Return to “Gameplay Help”