Skip to content

Refactor scoring test scene for ruleset extensibility (and move existing instance to osu! ruleset project) #24821

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

Merged
merged 3 commits into from
Sep 18, 2023

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Sep 15, 2023

Continuation of preparation for #23763

To work with the classic scoring algorithm, I want to get all rulesets under test coverage similar to the one we already had in TestSceneScoring. As it turns out after some checking I did on Wednesday, rulesets do wildly diverge in scoring behaviour, so I do believe that this wasn't a fruitless endeavour.

To prepare for the above, this PR refactors a base class for the scoring tests that shall live in osu.Game, and moves the existing instance from osu.Game.Tests to osu.Game.Rulesets.Osu.Tests (since it was really ever testing osu!-the-ruleset scoring anyways).

In the end I decided to implement each score calculation independently and not reuse LegacyScoreSimulators. That is mostly because the two have different goals and different levels of detail; the simulators are mostly concerned with perfect scores only, but handle all object types, while the scoring-test-local implementatons are concerned with non-perfect scoring too, but generally only handle the main object types (osu! hitcircle / taiko hit / catch fruit / mania note). That's because I don't think accurate replication there matters; classic scoring isn't going to match score V1 anyhow because of the constraints we placed on it (must be derived from standardised and not reorder scores), so the goal is to get the ballpark roughly correct.

Aside from the refactoring, this also adds some extra bells & whistles, such as being able to set particular scenarios via test steps, as well as adjust the SliderMultiplier constant on-the-fly (previously hardcoded to convenient value).

1694776822

Apologies for the LoC here, but this should make it much easier to review subsequent changes.

Testing resources

osu-scoring-resources.zip contains a bunch of files, namely:

  • .osu files that are beatmaps with particular test cases (all containing 100 objects)
  • .osr files that correspond to replays set on beatmaps with the same name
  • .txt files containing extracts of stable total score after each judgement to cross-check.

Six different test cases are provided:

  • perfect score:
    • ScoreV1Perfect
    • ScoreV2Perfect
  • score with misses:
    • ScoreV1MissesAt25And50
    • ScoreV2MissesAt25And50
  • score with misses and 100s:
    • ScoreV1MissesAnd100s
    • ScoreV2MissesAnd100s

which correspond to the test steps added to the scene. For cross-referencing, set ScoreMultiplier = 3 in the test.

Stable code for reference:

Copy link
Member

@peppy peppy left a comment

Choose a reason for hiding this comment

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

I've checked this on surface level, seems okay. Not putting too much thought into code quality checks because test scene.

@peppy peppy merged commit f3b6aa5 into ppy:master Sep 18, 2023
@bdach bdach deleted the scoring-test-scene-osu branch September 18, 2023 11:50
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.

2 participants