Full tank not full for logistics

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2632
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Full tank not full for logistics

Post by steinio »

Hello,

i've a setup which shows the fill level of my tanks.
If i set the 'full' lamp to light if level > 2499 the lamp gets never on although the tank shows full.
The connected pump with the same settings also never switch on.
2498 works indeed. Could be a rounding error.

The number is apprev. with 2.5k, better would be 4 digits for clearance.

Greetings steinio
Attachments
Logistics tank.png
Logistics tank.png (2.64 MiB) Viewed 11196 times
Image

Transport Belt Repair Man

View unread Posts

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Full tank not full for logistics

Post by daniel34 »

I think it has to do with the fluid handling of Factorio.
Storage tanks (or pipes for that matter) will fill very slowly if they are almost full.

I have a small lubricant production only for electric engines which uses 0.1 lubricant/sec but I produce 1 lubricant/sec in the chemical plant.
In between is a storage tank. It will stay between 2496 and 2498 amount. As soon as I disconnect the electric engine production it will slowly fill to the max, after ~3-5 seconds it goes > 2499 and ~15 seconds later it will stop at 2499.97.

I don't think this is a bug, as the fluid handling was probably done this way by design.
What stops you from using 2490 or 2475 as value? One could reasonably say the storage tank is as good as full at that value (2475 = 99% full).

You can check the amount of fluid in the storage tank with the following command while the entity is selected with the mouse:

Code: Select all

/c game.local_player.print(game.local_player.selected.fluidbox[1].amount)
quick links: log file | graphical issues | wiki

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

Re: Full tank not full for logistics

Post by Rseding91 »

I was about to say it wasn't a bug but now I don't know.

The fluid is stored as a floating point number. 2499.9024 fluid for instance.

The circuit network and conditions deal with integers.

The question is: should fluid when sent to the network as a number be rounded up or down.

If the first, then there's a bug, if the 2nd then there's no bug to fix.
If you want to get ahold of me I'm almost always on Discord.

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2632
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Full tank not full for logistics

Post by steinio »

daniel34 wrote:I think it has to do with the fluid handling of Factorio.
Storage tanks (or pipes for that matter) will fill very slowly if they are almost full.

I have a small lubricant production only for electric engines which uses 0.1 lubricant/sec but I produce 1 lubricant/sec in the chemical plant.
In between is a storage tank. It will stay between 2496 and 2498 amount. As soon as I disconnect the electric engine production it will slowly fill to the max, after ~3-5 seconds it goes > 2499 and ~15 seconds later it will stop at 2499.97.

I don't think this is a bug, as the fluid handling was probably done this way by design.
What stops you from using 2490 or 2475 as value? One could reasonably say the storage tank is as good as full at that value (2475 = 99% full).

You can check the amount of fluid in the storage tank with the following command while the entity is selected with the mouse:

Code: Select all

/c game.local_player.print(game.local_player.selected.fluidbox[1].amount)
Hello daniel34,

well nothing stops me... :)
I use it as discribed by you as workaround. The question is, is 2500 > 2499 in the eyes of the game.

Greetings steinio
Image

Transport Belt Repair Man

View unread Posts

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3699
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Full tank not full for logistics

Post by DaveMcW »

Rseding91 wrote:The question is: should fluid when sent to the network as a number be rounded up or down.
I vote for natural rounding. floor(n + 0.5).

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5148
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Full tank not full for logistics

Post by Klonan »

Thanks for the report
DaveMcW wrote:
Rseding91 wrote:The question is: should fluid when sent to the network as a number be rounded up or down.
I vote for natural rounding. floor(n + 0.5).
I believe this should be the case, round it to the nearest integer,
Since the only way to read super accurate fluid levels is with script,
And that combinators work with integers etc.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Full tank not full for logistics

Post by kovarex »

Klonan wrote:Thanks for the report
DaveMcW wrote:
Rseding91 wrote:The question is: should fluid when sent to the network as a number be rounded up or down.
I vote for natural rounding. floor(n + 0.5).
I believe this should be the case, round it to the nearest integer,
Since the only way to read super accurate fluid levels is with script,
And that combinators work with integers etc.
Yes, sounds reasonable, changed it for 0.12.32

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2632
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Full tank not full for logistics

Post by steinio »

Gooooood morning vietnam..

Sorry factorio guys but i have the feeling that i'm getting angry.

According to the 2nd latest changelog someone of your team had the need to fiddle with the topic of this thread again:

Code: Select all

Storage tanks connected to the circuit network will output floored fluid values instead of rounding them.
Does this change now with every new major version?
tank.png
tank.png (299.94 KiB) Viewed 10216 times
You can see in the picture, that the tank never reach it's capacity of 2500.
The lamp should lit if water > 2499.

Please repair it again - forever.

Greetings steinio
Image

Transport Belt Repair Man

View unread Posts

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5148
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Full tank not full for logistics

Post by Klonan »

steinio wrote:Gooooood morning vietnam..

Sorry factorio guys but i have the feeling that i'm getting angry.

According to the 2nd latest changelog someone of your team had the need to fiddle with the topic of this thread again:

Code: Select all

Storage tanks connected to the circuit network will output floored fluid values instead of rounding them.
Does this change now with every new major version?
tank.png
You can see in the picture, that the tank never reach it's capacity of 2500.
The lamp should lit if water > 2499.

Please repair it again - forever.

Greetings steinio
This is desired behaviour, set your combinator to 2490.

There is a solution in 0.15,
So you will have to trust us until then, that it is the right move

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2632
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Full tank not full for logistics

Post by steinio »

Oh man so much leap of faith - hopefully it pays off :)
Image

Transport Belt Repair Man

View unread Posts

Smoovious
Long Handed Inserter
Long Handed Inserter
Posts: 99
Joined: Sun Jan 31, 2016 12:14 am
Contact:

Re: Full tank not full for logistics

Post by Smoovious »

Not that my vote matters, but if I had one, I would want to have the 5/4 rounding back. (even with multiplying fluid volumes by 10x).

Testing my 4 tanks together, for volume of 10,000 to see if they're full, and 0, to see if they're empty, just makes more sense to me than testing for 9,996.

Unless the circuit network will be switched to floating point... well, even then, I'd still want to 5/4 round to the last decimal place it would use.

My 0.02 monies worth.

-- Smoov

User avatar
GlassDeviant
Fast Inserter
Fast Inserter
Posts: 170
Joined: Wed Feb 11, 2015 1:51 am
Contact:

Re: Full tank not full for logistics

Post by GlassDeviant »

Not sure why this is showing up on my "unread posts" list, but...

I know this game is an OCD dream; however, there comes a point when rigid definitions of "full" and "empty" get in the way of a functional system. The fractional difference between 4990 units of heated water in a pair of tanks and 5000 units is real, but it's not going to make one bit of difference between survival and destruction when pumping it into an array of steam engines powering a wall of defensive lasers against an alien attack.

When you set your thermostat in your house, there is a limit to the precision of the setting.

Ask anyone with an engineering degree, precision has limits.

So while you can demand that tanks in a simulation game fill absolutely, totally full and notify you via the circuit network what it happens, does it really matter so much that you are able to avoid having to say "X > 2490" or did you just miss a dose of Paxil?

(sorry, a little melodramatic/exaggerated, but really...is it going to kill you to use 99.6% full instead of 100%? no offense intended, just injecting a little philosophy)
- GD

Sorry if my posts are becoming difficult to read, my typing ability is rapidly deteriorating due to a nerve disorder. I try to clean them up before posting but don't always get every last typo.

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2632
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Full tank not full for logistics

Post by steinio »

No... the real problem is, that the fundamental behavior has changed 3 times in the last year.
Image

Transport Belt Repair Man

View unread Posts

User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Full tank not full for logistics

Post by impetus maximus »

steinio wrote: Image
i just adjust my numbers to get around the problem in question. [offtopic] how are you displaying those numbers?

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

Re: Full tank not full for logistics

Post by Rseding91 »

steinio wrote:No... the real problem is, that the fundamental behavior has changed 3 times in the last year.
The game didn't exist a few years ago :P
If you want to get ahold of me I'm almost always on Discord.

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2632
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Full tank not full for logistics

Post by steinio »

impetus maximus wrote:
i just adjust my numbers to get around the problem in question. [offtopic] how are you displaying those numbers?
Sorry - it's SmartDisplay by binbinhfr: https://mods.factorio.com/mods/binbinhfr/SmartDisplay
Image

Transport Belt Repair Man

View unread Posts

User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Full tank not full for logistics

Post by impetus maximus »

steinio wrote: Sorry - it's SmartDisplay by binbinhfr: https://mods.factorio.com/mods/binbinhfr/SmartDisplay
ok thanks. looked vanillaish. :lol:

Post Reply

Return to “Resolved Problems and Bugs”