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

Make the highscore importer provide the MaximumStatistics dictionary #76

Merged
merged 6 commits into from
Sep 1, 2022

Conversation

smoogipoo
Copy link
Contributor

@smoogipoo smoogipoo commented Aug 26, 2022

Prereqs:

The purpose of this PR is to add the MaximumStatistics dictionary to imported scores.

  • First we convert every hit type to the corresponding "accurate" version. For example for an ok result, the accurate version is great in osu/taiko/catch and perfect in mania. This is done via Ruleset.GetHitResults() as mentioned at in my original PR.
  • Then, we compare the combo from those statistics to the combo in the osu_beatmap_difficulty_attributes table (attrib_id = 9), and add a legacy_combo_increase hit result to bring them up to the same level if they don't match. This only shows up for osu/mania - taiko/catch have accurate combo counts from score statistics alone.

I have checked that combo count is accurate for osu, however mania combo is a few combo off because osu!stable is silly and allows players to get more maximum combo than should actually be possible via hold notes. I'm unsure how to deal with this yet - but I gather we can do a separate pass over it later on.

Additionally, this PR migrates total score into LegacyTotalScore.

Sample files:
osu.txt
taiko.txt
catch.txt
mania.txt

Imported from the top-1000 dumps on https://data.ppy.sh

@smoogipoo
Copy link
Contributor Author

I've bundled the LegacyTotalScore migration here since it's kinda related to everything anyway.

@@ -284,14 +284,15 @@ public async Task Run(HighScore[] scores)
BeatmapID = highScore.beatmap_id,
RulesetID = ruleset.RulesetInfo.OnlineID,
Passed = true,
TotalScore = highScore.score,
TotalScore = (int)referenceScore.TotalScore,
Copy link
Member

Choose a reason for hiding this comment

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

scary cast

@peppy
Copy link
Member

peppy commented Aug 30, 2022

I'm very concerned about the performance implications of these changes (+1RTT per score, taking the count up from zero). Will do a test run tonight and see how things go.

No need to make changes just yet, but I'm pretty sure we'll want to fetch every combo for every beatmap before running.

Comment on lines +417 to +422
ScoreProcessor scoreProcessor = ruleset.CreateScoreProcessor();
int baseScore = scoreInfo.Statistics.Where(kvp => kvp.Key.AffectsAccuracy()).Sum(kvp => kvp.Value * Judgement.ToNumericResult(kvp.Key));
int maxBaseScore = scoreInfo.MaximumStatistics.Where(kvp => kvp.Key.AffectsAccuracy()).Sum(kvp => kvp.Value * Judgement.ToNumericResult(kvp.Key));

scoreInfo.TotalScore = (int)scoreProcessor.ComputeScore(ScoringMode.Standardised, scoreInfo);
scoreInfo.Accuracy = maxBaseScore == 0 ? 1 : baseScore / (double)maxBaseScore;
Copy link
Member

Choose a reason for hiding this comment

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

I'm very likely to be missing something here, but does this apply to legacy/stable scores? And if so, wouldn't the accuracy change here because slider ticks/ends are not present in the statistics? This is with the assumption that slider ticks/ends affect accuracy in stable.

Copy link
Contributor Author

@smoogipoo smoogipoo Aug 31, 2022

Choose a reason for hiding this comment

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

does this apply to legacy/stable scores?

This entire thing applies only to legacy/stable scores.

wouldn't the accuracy change

Yes, the accuracy does change. However it's not exactly how you think of it. Slider ticks/ends do not affect accuracy in stable, and the values computed by both osu!stable and osu!web are derived solely from the statistics available in scores.
Notably, slider ticks/ends are not stored to scores.

Some cases do differ, such as mania, where in stable/web GREATs/PERFECTs are treated as the same value, but in lazer they're not. For taiko, stable uses 300/150 whereas lazer uses 300/100.

This information is recoverable, because, as I said, it's done in real time from score statistics.

Copy link
Member

Choose a reason for hiding this comment

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

Right, thanks for the clarification.

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.

3 participants