Skip to content

Add command for recalculating mod multipliers#269

Merged
peppy merged 5 commits into
ppy:masterfrom
bdach:recalculate-mod-multipliers
May 27, 2026
Merged

Add command for recalculating mod multipliers#269
peppy merged 5 commits into
ppy:masterfrom
bdach:recalculate-mod-multipliers

Conversation

@bdach

@bdach bdach commented May 21, 2024

Copy link
Copy Markdown
Collaborator

@bdach

bdach commented Aug 19, 2024

Copy link
Copy Markdown
Collaborator Author

I'll look into the test failures, but a thought that has just occurred to me is that this PR might be going too far.

By which I mean we may want to skip recalculating mod multipliers on leaderboards with significance - I'm thinking multiplayer, playlists, and daily challenge. Which is to say, any multiplayer score would be excluded from having its multiplier recalculated (but also would need to become unranked in the process, which also has pp implications).

Thoughts?

@tsunyoku

tsunyoku commented Jun 12, 2025

Copy link
Copy Markdown
Member

@peppy could I ask that this change is looked at some point soon? With the recent creation of https://discord.com/channels/546120878908506119/1373971097434980463 and conversation happening there, I'm at a point where I'm not sure how exactly we're supposed to go ahead publicly if there's no framework to actually facilitate any changes that may arise from polling. Changing at least the classic multiplier is quite high priority in my opinion.

@peppy peppy self-requested a review May 27, 2026 03:55

@bdach bdach left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Just noting current known deficiencies / blockers after 2 years of not seeing this diff.

Will want to re-run with the new multiplier API at least locally and re-check that this is performing within expected parameters.

Comment on lines +81 to +89
score.beatmap = beatmapsById[score.beatmap_id];
var scoreInfo = score.ToScoreInfo();

if (scoreInfo.TotalScoreWithoutMods == 0 && scoreInfo.TotalScore != 0)
{
throw new InvalidOperationException($"Score with ID {score.id} has {scoreInfo.TotalScore} total score but {scoreInfo.TotalScoreWithoutMods} total score without mods. "
+ $"This is likely to indicate that {nameof(scoreInfo.TotalScoreWithoutMods)} was not correctly backpopulated on all scores "
+ "(or there is a process pushing new scores that was not updated to populate the field).");
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This will likely need further adjusting:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To recap, we're currently populating the majority of scores, but there could be some which don't get the population due to deleted/missing beatmaps or other edge case issues.

I think skipping here with log output is fine for such scores.

Comment on lines +91 to +94
double multiplier = 1;

foreach (var mod in scoreInfo.Mods)
multiplier *= mod.ScoreMultiplier;

@bdach bdach May 27, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Depends on client changes (the new multipliers actually being present in client source), and will require upgrading in line with the new API

@peppy peppy merged commit 2fd9bf9 into ppy:master May 27, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add command for applying mod multiplier changes

4 participants