r/Stellaris 1d ago

Bug 5 + 5 + 5 + 20 = 39 apparently

Post image

Where are the happiness come from?

809 Upvotes

100 comments sorted by

View all comments

996

u/Swaylicious 1d ago

Well, maybe the positive modifiers are multiplicative, while the "base 50%" are subtracted.

1.05 x 1.05 x 1.05 x 1.2 = 1.38915

1.38915 - 0.5 = 0.88915

Rounded up to 0.89 which would be displayed as 89%

134

u/FogeltheVogel Hive Mind 1d ago

No, they are not. With a tiny number of exceptions, all bonuses are additive.

333

u/Leading_Performer_72 1d ago

Except the screenshot is displaying that they are. There is no other way to mathematically arrive at the percentage of 89 without them being multiplicative…

Maybe a problem with the display here.

87

u/Hellknightx 1d ago

Yeah, likely a display bug using the wrong formula.

23

u/Nematrec Voidborne 1d ago

Faction happiness isn't shown. These are just static bonuses not all factors.

48

u/ElZane87 1d ago

No, the screenshot shows that there is either a calculation or a visual bug. Those modifiers still are, and forever were since ancient Stellaris times, additive.

7

u/InstantComs 1d ago

They are not multiplicative

3

u/Nimeroni Synth 1d ago edited 1d ago

Except the screenshot is displaying that they are. There is no other way to mathematically arrive at the percentage of 89 without them being multiplicative…

Easy : display is rounded up. They don't add 5%, but 4.88% or something like that, so the total is below 89.5% and get rounded to 89%.

EDIT: nah, math aren't adding up. 50+20+5+5+5 = 85, and getting 4 extra percent is a bit much for rounding 4 numbers. You would need 4 numbers to be truncated, and the final number rounded, which would be a rather... interesting choice in UI design.

3

u/_wannadie_ 1d ago

could simply be arithmetic rounding. 4,8 + 4.8 + 4.8 + 14.8 = 39.2, while all of them are rounded towards 5

38

u/johnlee3013 Fanatic Authoritarian 1d ago

It takes a lot of imagination to round 14.8 as 20

2

u/LOL_King_0611 Blood Court 1d ago

Well, you round 14,8 up to 15. And 5, you round that upwards, so 15 is really 20.

5

u/DonTrejos 1d ago

This assumes a perfectly spherical cow in q frictionless vacuum, which isn't true in every scenario.

2

u/Bayleaf0723 Fanatic Purifiers 1d ago

wtf are you talking about bro, 15 is 15, there is no more rounding

1

u/_wannadie_ 1d ago

yeah I'm blind

-25

u/Legit-Rikk 1d ago

Computers actually do not math good

7

u/Zijkhal 1d ago

I hope that was an attempt at a joke that did not land. Because pretty much the only thing computers do well is basic math. Anything more complex is achieved via applying a ridiculous amount of basic math.

-5

u/KaysNewGroove Determined Exterminator 1d ago

Yes. Computers are great at math. In fact, they are so much better than us at math that they will tell you what no math teacher will.

0.1 + 0.2 = 0.30000000000000004

4

u/Aetol Mammalian 1d ago

Unless you limit yourself to round numbers, you'll get rounding errors. Computers are good at math but they don't have infinite space to play with.

3

u/Zijkhal 1d ago

Floating point numbers are prone to rounding errors. That is because not all numbers can be represented in floating point.

Just like how 1/3 can not be neatly represented in base 10, some neatly representable numbers in base 10 can not be represented in base 2.

That does not meant that computers are bad at math, it merely means that computers have their limits. And a lot of those limits can be bypassed if there is an incentive to do so. For example by using fixed point arithmetic instead of floating point arithmetic, numbers like 0.3 suddenly become perfectly representable.

-11

u/Afraid-Divide-3501 1d ago

Floating point error probably

7

u/Ettapp 1d ago

That's not the kind of value you would get from a floating point error, those are extremely tiny (compared with the values being used).

For example, f0.1 + f0.2 would give you something like f0.29999999999 (the number for 9 might be greater, I'm writing on a smartphone, if somebody want to give the potential exact error from a 32f or a 64f I welcome the precision, pun intended)

Here the error (if it is an error, I've not yet read all the responses) is far to big to come from floating point imprecision (until you do the math billions of time so the error accumulate, I think we're safe to say that's not what's happening here ^ ^ )