Signal with floating point value
Moderator: ickputzdirwech
Signal with floating point value
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.
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.
Re: Signal with floating point value
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.
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.
Re: Signal with floating point value
Floats are appropriate for fluids. Representing 2,000.00 oil as 200,000 is much too confusing.
Re: Signal with floating point value
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.
Floats have been and always will be APPROXIMATE values. Estimations are sim engine suicide.
- ArderBlackard
- Long Handed Inserter
- Posts: 74
- Joined: Thu May 05, 2016 12:41 pm
- Contact:
Re: Signal with floating point value
Could you please help me with expressing 1/3 with int? And PI please.bobucles wrote:Floats aren't appropriate for anything. All useful values under the sun can be comfortably expressed with int.
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
- thereaverofdarkness
- Filter Inserter
- Posts: 558
- Joined: Wed Jun 01, 2016 5:07 am
- Contact:
Re: Signal with floating point value
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.
Re: Signal with floating point value
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.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.
- thereaverofdarkness
- Filter Inserter
- Posts: 558
- Joined: Wed Jun 01, 2016 5:07 am
- Contact:
Re: Signal with floating point value
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.bobucles wrote:There's only so many decimal points required before realizing a tenth of a drop of oil doesn't mean anything.
Re: Signal with floating point value
Tanks are fixed: viewtopic.php?f=11&t=24558#p154947thereaverofdarkness wrote: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.bobucles wrote:There's only so many decimal points required before realizing a tenth of a drop of oil doesn't mean anything.
Re: Signal with floating point value
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.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.
Re: Signal with floating point value
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:
"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.
As in:
Code: Select all
local signals = {["CopperOreSignal"] = 7}
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.
- thereaverofdarkness
- Filter Inserter
- Posts: 558
- Joined: Wed Jun 01, 2016 5:07 am
- Contact:
Re: Signal with floating point value
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!steinio wrote:Tanks are fixed: viewtopic.php?f=11&t=24558#p154947thereaverofdarkness wrote: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.bobucles wrote:There's only so many decimal points required before realizing a tenth of a drop of oil doesn't mean anything.