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

Add option for SongProgress to use strain in difficulty graph #30125

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

Givikap120
Copy link
Contributor

@Givikap120 Givikap120 commented Oct 5, 2024

First step of adding Strain Graph - #30116

Question about structure:
Maybe adding all those logic into SongProgress class is not good, and I should create GraphSongProgress that will be base for argon and triangles song progress classes

A little explanation for reviewers on what parts this PR consists of:

  • Changes to the difficulty calculator (75 line diff).
    This includes addition of per-section calculation. This calculation depends on ensuring correct bounds between first and last section (because in normal diffcalc bounds are cut-off). Also this requires filtering skills to only relevant ones.
  • Implementation of strain resampling (150 line diff).
    This features my own algorithms for upscaling and downscaling, to specifically address the need of preserving correct "peak" value.
  • Changes to SongProgressGraph (100 line diff).
    Type of value changed from int to float (for obvious reason). As well as Objects setter is changed with SetFromObjects method for more intuitive understanding what it does (aka not just setting some field).
  • Changes to the SongProgress (150 line diff).
    Calculation of strains and option to show them on graph.

Comment on lines 185 to 192
/// <summary>
/// Filters relevant skills that would be used to represent difficulty of the section.
/// </summary>
/// <remarks>
/// IMPORTANT NOTE: for now it's using <see cref="StrainSkill"/> to receive section values, consider changing it in the future.
/// Also, this function should also be changed if filtering skills is no longer enough to get desired values.
/// </remarks>
public virtual StrainSkill[] GetRelevantSkills(Skill[] skills) => skills.OfType<StrainSkill>().ToArray();
Copy link
Collaborator

Choose a reason for hiding this comment

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

this can't exist

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How else can I filter the skills to get only those that I need
Specifically this means that I need to filter-out SliderlessAim from STD Difficulty Calculation

Copy link
Collaborator

Choose a reason for hiding this comment

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

why are you filtering skills at all would be my primary question here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why are you filtering skills at all would be my primary question here?

Aim and SliderlessAim are the same skill
leaving them both means that aim difficulty is added 2 times

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can add public virtual bool IsRelevant => true; // Is skill relevant to star rating field to the Skill class
But it's +- the same as current solution, just written in different way

while (time > currentSectionEnd)
{
saveCurrentPeak();
currentSectionPeak = 0; // This is wrong, but there's no way get decay from this class
Copy link
Collaborator

Choose a reason for hiding this comment

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

you can't just say "this is wrong" and then do it anyway

Copy link
Contributor Author

@Givikap120 Givikap120 Oct 5, 2024

Choose a reason for hiding this comment

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

Correct way to do this is applying strain decay to currentSectionPeak
but there's no way to do this under current structure of StrainSkill
this is possible in #29290, as strain decay logic is moved back to the StrainSkill class

But this is rather minor inconvenience, what wouldn't be noticeable for average player

osu.Game/Screens/Play/HUD/SongProgress.cs Outdated Show resolved Hide resolved
@peppy
Copy link
Member

peppy commented Oct 22, 2024

@Givikap120 test failures are likely relevant.

@Givikap120
Copy link
Contributor Author

@Givikap120 test failures are likely relevant.

Ok, I will look into it
from first glance on their names - I thought they were unrelated

@Givikap120
Copy link
Contributor Author

Givikap120 commented Oct 23, 2024

@Givikap120 test failures are likely relevant.

The reasons for test fails is because those test scenes use SongProgress and it's trying to load strain graph (resulting in fail)
I think the easiest way to fix this is make SongProgress use density by default

this should fix tests failing
@Givikap120
Copy link
Contributor Author

Fixed

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