Minor: excessive recipe time precision?

Post Reply
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Minor: excessive recipe time precision?

Post by Deadlock989 »

This is a niggle and not really an interface request, so sue me, can't find a better place to put it.

Everywhere else - where admittedly space is more constrained - precision is rounded to something like four significant figures, or four printed characters including SI unit suffixes, or one decimal place, or something. (This occasionally results in averaged recipe products being displayed as 0.2 when it's really 0.25 but that's another story.)

When the base belt speed got buffed to 15 item/s in 0.17, some mods which pay a lot of attention to optimising belt compression ratios end up with a lot of crafting times that have a recurring decimal. So you can end up with whole pages of recipes like the thing below.

Is there are a need for that much precision? It's ... confusing. But I have no control over it.

Would it break anything if recipe crafting times were rounded to something easier on the eye? Arguably, 2.67 seconds would be just as informative, and less off-putting.

Cheers
many-many-decimals.png
many-many-decimals.png (88.18 KiB) Viewed 2433 times
Image

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Minor: excessive recipe time precision?

Post by Choumiko »

Deadlock989 wrote:
Mon Jun 03, 2019 6:02 pm
Arguably, 2.67 seconds would be just as informative, and less off-putting.
When seeing 2.67 i'm more inclined to think it is 2.67 and not 2 2/3

2.667 is probably the point where i go: ah yeah, 2 2/3

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Minor: excessive recipe time precision?

Post by Deadlock989 »

Choumiko wrote:
Mon Jun 03, 2019 6:12 pm
When seeing 2.67 i'm more inclined to think it is 2.67 and not 2 2/3

2.667 is probably the point where i go: ah yeah, 2 2/3
There is probably a whole field of psychonumerics or whatever which studies how people from different cultural backgrounds and education levels respond to this kind of shizzle but yeah, let's not go there.

I agree that 2.667 is less depressing than 2.66667. I'd prefer 2.67 but literally anything other than 2.66667 would do me
Image

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Minor: excessive recipe time precision?

Post by Bilka »

If I use "the same format as most stuff" and round instead of floor, you get this:
Image
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Qon
Smart Inserter
Smart Inserter
Posts: 2119
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Minor: excessive recipe time precision?

Post by Qon »

Deadlock989 wrote:
Mon Jun 03, 2019 6:30 pm
I'd prefer 2.67 but literally anything other than 2.66667 would do me
Yeah please make it 2.666667! 8-)

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Minor: excessive recipe time precision?

Post by Deadlock989 »

Bilka wrote:
Tue Jun 04, 2019 2:30 pm
If I use "the same format as most stuff" and round instead of floor, you get this:
Image
I can't round or floor because these crafting times are deliberately calculated to produce output which is perfectly compressed on the respective belt when produced by machines with a nice round crafting speed. I can move the recurring decimals from place to place but the least annoying way is to have them in the recipes.

0.16's belt speeds didn't produce these kinds of recurring decimals because belt speeds didn't involve factors of 15.
Image

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Minor: excessive recipe time precision?

Post by Bilka »

I'm not telling you to round or floor. I'm just showing you what "use the same number format as the rest" means for the display of your recipe time.
Image
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Minor: excessive recipe time precision?

Post by Deadlock989 »

Bilka wrote:
Tue Jun 04, 2019 2:36 pm
I'm not telling you to round or floor. I'm just showing you what "use the same number format as the rest" means for the display of your recipe time.
Image
OK, I misunderstood.

That's an improvement from my perspective. I'm sure someone else hates it.
Image

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

Re: Minor: excessive recipe time precision?

Post by DaveMcW »

As I mentioned in this thread, "the same number format as the rest" should really use 2 decimal places for numbers less than 10.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Minor: excessive recipe time precision?

Post by Deadlock989 »

DaveMcW wrote:
Tue Jun 04, 2019 2:40 pm
As I mentioned in this thread, "the same number format as the rest" should really use 2 decimal places for numbers less than 10.
Agreed. It would fix both issues at once (recipes times with excessively accurate recurring decimals, and overly-rounded fractional products).
Image

Cadde
Fast Inserter
Fast Inserter
Posts: 149
Joined: Tue Oct 02, 2018 5:44 pm
Contact:

Re: Minor: excessive recipe time precision?

Post by Cadde »

If i may, my 2 cents are that it should read "2.6..." for anything recurring. That is, it detects if there are more than 3 or 4 decimal places and rounds it to the first recurring decimal and puts dots after.

Examples:

Recurring decimals
Actual value: 1.3333333333333333333333333333333333
Display: 1.3...

Non recurring decimals
Actual value: 0.015625
Display: ~0.0156

Recurring decimals after some point
Actual value: 0.013333333333333333333333333333333333
Display: 0.013...

Extreme case (Notice that the 4th decimal isn't recurring and so there is no recursion indicator.
Actual value: 0.0013333333333333333333333333333333333
Display: ~0.001

Odd case (Because it's not recurring to the end)
Actual value: 2.66666666666666666666666666666123
Display: ~2.6666

That would be better IMHO.

EDIT: I said "rounds" but i meant "floor".

And sure, internally you'd have to find out where the precision for 1/3 ends too.
Say the actual value is 0.333333333333333333333333333334
Then you would check for recursion up until the tenth decimal or something so you don't get "~0.3333" instead of "0.3333..."

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Minor: excessive recipe time precision?

Post by Deadlock989 »

Cadde wrote:
Tue Jun 04, 2019 2:58 pm
If i may, my 2 cents are that it should read "2.6..." for anything recurring. ...
That's a Western maths convention which I don't think is inherently meaningful to everyone. Way too complex.

Rounding numbers consistently in different tooltips, without too much or not enough accuracy, is what we're after. The dot dot dot notation wouldn't fit into some places, e.g. recipe products.
Image

Qon
Smart Inserter
Smart Inserter
Posts: 2119
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Minor: excessive recipe time precision?

Post by Qon »

Cadde wrote:
Tue Jun 04, 2019 2:58 pm
Odd case (Because it's not recurring to the end)
Actual value: 2.66666666666666666666666666666123
Display: ~2.6666
Test this lua code in the in-game console:

Code: Select all

/c
x = 1/3 * 10^9
x = x - math.floor(x)
game.print(x)
output:

Code: Select all

0.33333331346512
Was that what you expected?
Or how about 0.1 * 1000 (+0.1 a thousand times)?

Code: Select all

/c 
x = 0 
for i = 1, 1000 do 
    x = x + 0.1 
end 
game.print(x)
Output: 99.9999999999

You don't have the same repeating numbers in binary as in decimal. You can't store 1/3 in a binary float or double, so it is rounded to the nearest representable number. You can't store 0.1 either and it's not even a repeating decimal in base 10, because it is in binary! And then it gets rounded when printed again :twisted:

Edit: You ninja edited your post :)

Cadde
Fast Inserter
Fast Inserter
Posts: 149
Joined: Tue Oct 02, 2018 5:44 pm
Contact:

Re: Minor: excessive recipe time precision?

Post by Cadde »

I know qon, the point is what's important. Not the inner mechanics of IEEE 754

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Minor: excessive recipe time precision?

Post by Bilka »

For the next version, I introduced a new format that shows up to 2 decimals, we needed it somewhere else anyway. So, this is how things look like now:
Image
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: Minor: excessive recipe time precision?

Post by Deadlock989 »

Bilka wrote:
Tue Jun 04, 2019 8:23 pm
For the next version, I introduced a new format that shows up to 2 decimals, we needed it somewhere else anyway. So, this is how things look like now:
Image
That'll do me nicely. I and my failing retinas thank you.
Image

Post Reply

Return to “Implemented mod requests”