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: floating-point profile rating calculation #1227

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nyairobi
Copy link
Contributor

@nyairobi nyairobi commented Dec 26, 2024

Added a new parameter to CalcN. If active (I activated it for Ongeki and Chunithm, although all games with non-integer ratings are possibly affected), profile rating will be calculated using fixed-point arithmetic. This is basically zkrising/rg-stats#10 but for profile rating.

This fixes edge cases like my current rating as well as these wacky rating graphs (since rating is now truncated as it should be):

image

If you restore ongeki.ts:59, i.e. naiveRating: ProfileAvgBestN("rating", 45), the new tests will fail with ratings 16.269999999999996 1.4222222222222223. Likewise, chunithm.ts:19.

An alternative fix would be to re-define rating and store it multiplied by 100 in the DB but that would require fixing old scores.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant