Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mod score multiplier rounding to 1.00x with specific mod combinations #26140

Merged
merged 13 commits into from
Jan 4, 2024

Conversation

CaffeeLake
Copy link
Contributor

@CaffeeLake CaffeeLake commented Dec 26, 2023

Fix mod score multiplier rounding to 1.00x with specific mod combinations.

Before

osu_2023-12-27_00-06-25
osu_2023-12-27_00-06-30

After

osu_2023-12-27_00-05-09
osu_2023-12-27_00-05-30

@bdach
Copy link
Collaborator

bdach commented Dec 26, 2023

Classic mod multiplier: 0.96x
Double time 1.2x mod multiplier: 1.04x
Actual total multiplier before rounding: 0.9984x

I'm not sure this solution is correct to be honest. The combination of mods does decrease the score multiplier, even if by just a bit.

I'd take displaying 0.99x over this, and changing the logic to always round the textual displayed value away from 1.0x (so 1.0x is only displayed to the user if the multiplier is literally exactly 1.0x). @ppy/team-client opinions please.

This is also an issue on the mod screen by the way and this PR doesn't fix that part.

Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs work as per above (at least to fix the mod select screen too).

@peppy
Copy link
Member

peppy commented Dec 26, 2023

I'd take displaying 0.99x over this

Yeah I'd imagine it always flooring to the lower rounded decimal.

@bdach
Copy link
Collaborator

bdach commented Dec 26, 2023

So in short, I'd say:

  • mod multipliers below 1.00x should be floored to the nearest decimal value to 2 significant digits
  • mod multipliers above 1.00x should be.. ceilinged? to the nearest decimal value to 2 significant digits
  • this should be extracted to a helper method, every place that displays the mod multiplier should use that helper method

Seems simpler than just handling the values around 1.00x in a special manner?

@CaffeeLake
Copy link
Contributor Author

CaffeeLake commented Dec 26, 2023

This is a little off topic, In the Mod Select overlay, lower multiplier are green and higher multiplier are red.
However, in the footer Mods, lower multiplier is red and higher multiplier is green.
Is this the intended specification?

@CaffeeLake CaffeeLake changed the title Fix: Mods multiplier colour if 1.00x Fix: Mods multiplier if 1.00x Dec 26, 2023
@CaffeeLake CaffeeLake marked this pull request as draft December 26, 2023 15:00
@CaffeeLake CaffeeLake marked this pull request as ready for review December 26, 2023 15:10
@CaffeeLake CaffeeLake requested a review from bdach December 26, 2023 15:10
@CaffeeLake CaffeeLake changed the title Fix: Mods multiplier if 1.00x Fix: Mods multiplier if 1.00x use 0.99x or 1.01x Dec 26, 2023
@bdach
Copy link
Collaborator

bdach commented Dec 26, 2023

This is a little off topic, In the Mod Select overlay, lower multiplier are green and higher multiplier are red. However, in the footer Mods, lower multiplier is red and higher multiplier is green. Is this the intended specification?

The footer will be fixed to match when the entirety of song select is redesigned. Please ignore for the time being.

@CaffeeLake CaffeeLake force-pushed the multiplier1x branch 2 times, most recently from 55d66dc to e2906a4 Compare December 27, 2023 13:12
@CaffeeLake CaffeeLake changed the title Fix: Mods multiplier if 1.00x use 0.99x or 1.01x Mods multiplier is expressed as 1.00x, use 0.99x or 1.01x. Dec 27, 2023
@CaffeeLake
Copy link
Contributor Author

Changed to display 0.99x or 1.01x when the value is close to 1.00x and is not an error (such as 0.9984x).

Signed-off-by: CaffeeLake <PascalCoffeeLake@gmail.com>
@pull-request-size pull-request-size bot added size/M and removed size/S labels Dec 31, 2023
@frenzibyte
Copy link
Member

I've refactored this PR to add a helper method as proposed above and used it, instead of sprinkling the same code everywhere. I've also made the helper method use mathematical formulas as proposed above as well.

frenzibyte
frenzibyte previously approved these changes Dec 31, 2023
@frenzibyte
Copy link
Member

Will wait for @bdach for a second review on this.

@frenzibyte frenzibyte changed the title Mods multiplier is expressed as 1.00x, use 0.99x or 1.01x. Fix mod score multiplier rounding to 1.00x with specific mod combinations Dec 31, 2023
frenzibyte
frenzibyte previously approved these changes Dec 31, 2023
Signed-off-by: CaffeeLake <PascalCoffeeLake@gmail.com>
@CaffeeLake
Copy link
Contributor Author

CaffeeLake commented Dec 31, 2023

With the current method, for example, if only HT (Speed: 0.70-0.79) is used, the correct multiplier is 0.30x, but it is displayed as 0.29x.
I think this requires logic to handle floating point errors.
Fixed.

Signed-off-by: CaffeeLake <PascalCoffeeLake@gmail.com>
@peppy
Copy link
Member

peppy commented Jan 3, 2024

With the current method, for example, if only HT (Speed: 0.70-0.79) is used, the correct multiplier is 0.30x, but it is displayed as 0.29x. I think this requires logic to handle floating point errors. Fixed.

Could you please add new tests to cover the failure scenario you fixed?

@CaffeeLake
Copy link
Contributor Author

Could you please add new tests to cover the failure scenario you fixed?

Added tests to cover floating point errors .

@peppy
Copy link
Member

peppy commented Jan 4, 2024

@CaffeeLake for future reference, please don't merge master in multiple times. We'll do that when we're ready to handle your PR.

@peppy peppy self-requested a review January 4, 2024 08:57
@peppy peppy merged commit 35b9940 into ppy:master Jan 4, 2024
@CaffeeLake CaffeeLake deleted the multiplier1x branch January 4, 2024 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants