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

Pp Refactoring: Reworking StrainSkill #29290

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

Conversation

Givikap120
Copy link
Contributor

The main goal of this PR is to remove unnecessary code duplication of strain logic, making it much simpler and easier to understand.

  • StrainDecaySkill is removed. The logic of StrainDecaySkill is moved to the StrainSkill
  • Because of this, STD strain skills logic was reworked, removing code duplication from classes Aim and Flashlight
  • Renamed DecayWeight to SumDecay to avoid confusion with StrainDecayBase, what is entirely different constant.

@Givikap120 Givikap120 changed the title Pp Refactoring: Reworking StrainSkill Pp Refactoring: Reworking StrainSkill Aug 5, 2024
Copy link
Member

@tsunyoku tsunyoku left a comment

Choose a reason for hiding this comment

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

few things that stand out to me initially as issues, but overall I think the direction of this is fine?

osu.Game/Rulesets/Difficulty/Skills/StrainSkill.cs Outdated Show resolved Hide resolved
osu.Game/Rulesets/Difficulty/Skills/StrainSkill.cs Outdated Show resolved Hide resolved
@tsunyoku tsunyoku requested a review from a team November 7, 2024 11:46
@tsunyoku
Copy link
Member

tsunyoku commented Nov 7, 2024

@smoogipoo can we get a sheet for all rulesets to ensure there's no value differences please

@smoogipoo
Copy link
Contributor

Will need giga conflict resolution here before that

@stanriders
Copy link
Member

My main question is do we actually need to remove StrainDecaySkill? Why not refactor OsuStrainSkill to inherit StrainDecaySkill? Was regular StrainSkill ever used before? Will it be used in the future possibly?

Comment on lines +37 to +46
protected override double StrainValueOf(DifficultyHitObject current) => SpeedEvaluator.EvaluateDifficultyOf(current);

protected override double StrainValueAt(DifficultyHitObject current)
{
currentStrain *= strainDecay(((OsuDifficultyHitObject)current).StrainTime);
currentStrain += SpeedEvaluator.EvaluateDifficultyOf(current) * skillMultiplier;
CurrentStrain *= StrainDecay(((OsuDifficultyHitObject)current).StrainTime);
CurrentStrain += StrainValueOf(current) * SkillMultiplier;

currentRhythm = RhythmEvaluator.EvaluateDifficultyOf(current);

double totalStrain = currentStrain * currentRhythm;
double totalStrain = CurrentStrain * currentRhythm;
Copy link
Member

Choose a reason for hiding this comment

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

worth noting this entire thing becomes a little more confusing to read with these changes, but it's not really at fault of this PR - rhythm really should be entirely separate or atleast additive to speed so that we don't need to do this stupid solution. not a blocker, just speaking my mind

@Givikap120
Copy link
Contributor Author

Givikap120 commented Nov 7, 2024

My main question is do we actually need to remove StrainDecaySkill? Why not refactor OsuStrainSkill to inherit StrainDecaySkill? Was regular StrainSkill ever used before? Will it be used in the future possibly?

what is the point of strain skill without strain decay?
difficulties being grouped by sections?
regular StrainSkill is not used without strain decay from my knowledge

also, if you need to have 0 decay - you can just override StrainDecayBase to be 1.0 or 0.0 (just as taiko rhythm and mania strain already do)
actually I don't like how mania strain is functioning but this not up to this PR

@smoogipoo
Copy link
Contributor

!diffcalc
RULESET=osu

@smoogipoo
Copy link
Contributor

!diffcalc
RULESET=taiko

@smoogipoo
Copy link
Contributor

!diffcalc
RULESET=catch

Copy link

github-actions bot commented Nov 7, 2024

Copy link

github-actions bot commented Nov 7, 2024

Copy link

github-actions bot commented Nov 8, 2024

@ppy ppy deleted a comment from github-actions bot Nov 11, 2024
@smoogipoo
Copy link
Contributor

!diffcalc
RULESET=mania

Copy link

Difficulty calculation failed: https://github.com/ppy/osu/actions/runs/11772325316

Copy link

@Givikap120
Copy link
Contributor Author

oh, there's conflicts again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

4 participants