Signal with floating point value

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Signal with floating point value

Post by XKnight »

At this moment every signal is an integer value and this is very reasonable for almost all items, because you can not imagine half iron plate.
Except liquids, which is basically stored in tank as a floating point value and can not be represented in integer value without rounding.
So, my suggestion is to use floating point value for liquids.
All combinator operations (+-/*) also should use floating point value, and rounding should be applied only if liquid value is converted into the regular value.
bobucles
Smart Inserter
Smart Inserter
Posts: 1708
Joined: Wed Jun 10, 2015 10:37 pm
Contact:

Re: Signal with floating point value

Post by bobucles »

Floats aren't appropriate for anything. All useful values under the sun can be comfortably expressed with int.

But wait! How would you express the smaller values with int? Easy. Move the decimal point. So 1.00 becomes 100. Wow. Much difficult. And now you never have to deal with any dumb floating point issues ever again.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3717
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Signal with floating point value

Post by DaveMcW »

Floats are appropriate for fluids. Representing 2,000.00 oil as 200,000 is much too confusing.
bobucles
Smart Inserter
Smart Inserter
Posts: 1708
Joined: Wed Jun 10, 2015 10:37 pm
Contact:

Re: Signal with floating point value

Post by bobucles »

There's nothing confusing about it, because it's completely invisible to the end user. It can even be invisible to modders as well. There's only so many decimal points required before realizing a tenth of a drop of oil doesn't mean anything.

Floats have been and always will be APPROXIMATE values. Estimations are sim engine suicide.
User avatar
ArderBlackard
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Thu May 05, 2016 12:41 pm
Contact:

Re: Signal with floating point value

Post by ArderBlackard »

bobucles wrote:Floats aren't appropriate for anything. All useful values under the sun can be comfortably expressed with int.
Could you please help me with expressing 1/3 with int? And PI please.
Fixed-point arithmetics can be useful only to increase calculation performance, which is not the case here (or if you are writing a complex math processor with custom calculations). Aside from this you are just reinventing the wheel.
Gib dich hin bis du Glück bist
User avatar
thereaverofdarkness
Filter Inserter
Filter Inserter
Posts: 558
Joined: Wed Jun 01, 2016 5:07 am
Contact:

Re: Signal with floating point value

Post by thereaverofdarkness »

Integer rounding error has been bothering me. When I plug a specific amount of research units into the lab, sometimes it works fine, other times it stops at 100% completion and I have to insert one more science pack, which will have 100% remaining after the research completes.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3717
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Signal with floating point value

Post by DaveMcW »

bobucles wrote:There's nothing confusing about it, because it's completely invisible to the end user. It can even be invisible to modders as well. There's only so many decimal points required before realizing a tenth of a drop of oil doesn't mean anything.
Ok, so you agree with the OP. There should be a fluid signal that looks like a float and acts like a float, and no one cares what format it uses internally.
User avatar
thereaverofdarkness
Filter Inserter
Filter Inserter
Posts: 558
Joined: Wed Jun 01, 2016 5:07 am
Contact:

Re: Signal with floating point value

Post by thereaverofdarkness »

bobucles wrote:There's only so many decimal points required before realizing a tenth of a drop of oil doesn't mean anything.
It means nothing when you have a tenth of a drop extra sitting in your tank, but it means a lot when you have 99.999 and you need 100.000. If the game is going to be dropping decimals, it should round remaining quantities up, not down.
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Signal with floating point value

Post by steinio »

thereaverofdarkness wrote:
bobucles wrote:There's only so many decimal points required before realizing a tenth of a drop of oil doesn't mean anything.
It means nothing when you have a tenth of a drop extra sitting in your tank, but it means a lot when you have 99.999 and you need 100.000. If the game is going to be dropping decimals, it should round remaining quantities up, not down.
Tanks are fixed: viewtopic.php?f=11&t=24558#p154947
Image

Transport Belt Repair Man

View unread Posts
bobucles
Smart Inserter
Smart Inserter
Posts: 1708
Joined: Wed Jun 10, 2015 10:37 pm
Contact:

Re: Signal with floating point value

Post by bobucles »

It means nothing when you have a tenth of a drop extra sitting in your tank, but it means a lot when you have 99.999 and you need 100.000. If the game is going to be dropping decimals, it should round remaining quantities up, not down.
That's the beauty of ints. You can't gain or lose any material due to the silly rounding errors that are inescapable with a computer float. It's the same every time across all systems. Losing material by chopping pipe is of course the player's fault.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14319
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Signal with floating point value

Post by Rseding91 »

The entire circuit system is designed around ints. It's not a simple "add a signal with a float value" as the signal is not the thing that stores the value - it just identifies.

As in:

Code: Select all

local signals = {["CopperOreSignal"] = 7}
"CopperOreSignal" has nothing to do with the type being stored and the type being stored is shared between all signals on the entire network - it can't be swapped for just one.

I see little/no value in spending tons of man hours and the time to pay them to add in the ability to do that with how little it will benefit the gameplay.
If you want to get ahold of me I'm almost always on Discord.
User avatar
thereaverofdarkness
Filter Inserter
Filter Inserter
Posts: 558
Joined: Wed Jun 01, 2016 5:07 am
Contact:

Re: Signal with floating point value

Post by thereaverofdarkness »

steinio wrote:
thereaverofdarkness wrote:
bobucles wrote:There's only so many decimal points required before realizing a tenth of a drop of oil doesn't mean anything.
It means nothing when you have a tenth of a drop extra sitting in your tank, but it means a lot when you have 99.999 and you need 100.000. If the game is going to be dropping decimals, it should round remaining quantities up, not down.
Tanks are fixed: viewtopic.php?f=11&t=24558#p154947
It is fixed! I upgraded my version recently and I was just playing with petroleum gas today, and I got what seemed to be exact amounts, instead of slightly shrunk values!
Post Reply

Return to “Ideas and Suggestions”