Skip to content

Refactor SnapAimEvaluator bonuses for better readability#37119

Open
kwotaq wants to merge 1 commit intoppy:pp-devfrom
kwotaq:snap-refactorage
Open

Refactor SnapAimEvaluator bonuses for better readability#37119
kwotaq wants to merge 1 commit intoppy:pp-devfrom
kwotaq:snap-refactorage

Conversation

@kwotaq
Copy link
Copy Markdown

@kwotaq kwotaq commented Mar 26, 2026

This PR moves the addition of the bonuses closer to their declaration and also renames some variables and functions to more closely resemble the way they're used. The names can be discussed for I'm not sold on them either.

Comment on lines 145 to 153
if (osuCurrObj.BaseObject is Slider)
{
// Reward sliders based on velocity.
sliderBonus = osuCurrObj.TravelDistance / osuCurrObj.TravelTime;
}

// Penalize angle repetition.
aimStrain *= vectorAngleRepetition(osuCurrObj, osuLastObj);

aimStrain += wiggleBonus * wiggle_multiplier;
aimStrain += velocityChangeBonus * velocity_change_multiplier;

// Add in acute angle bonus or wide angle bonus, whichever is larger.
aimStrain += Math.Max(acuteAngleBonus * acute_angle_multiplier, wideAngleBonus * wide_angle_multiplier);

// Add in additional slider velocity bonus.
if (withSliderTravelDistance)
aimStrain += (sliderBonus < 1 ? sliderBonus : Math.Pow(sliderBonus, 0.75)) * slider_multiplier;
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.

These two can be combined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants