@rian8337/osu-rebalance-difficulty-calculator 4.0.0-beta.97 → 4.0.0-beta.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +381 -323
- package/package.json +3 -3
- package/typings/index.d.ts +51 -15
package/dist/index.js
CHANGED
|
@@ -90,7 +90,7 @@ class DifficultyCalculator {
|
|
|
90
90
|
}
|
|
91
91
|
attributes[i] = {
|
|
92
92
|
time: obj.endTime,
|
|
93
|
-
attributes: this.createDifficultyAttributes(beatmap,
|
|
93
|
+
attributes: this.createDifficultyAttributes(beatmap, progressiveBeatmap, skills, difficultyObjects.slice(0, currentIndex)),
|
|
94
94
|
sliderCount: progressiveBeatmap.hitObjects.sliders,
|
|
95
95
|
sliderTickCount: progressiveBeatmap.hitObjects.sliderTicks,
|
|
96
96
|
sliderRepeatCount: progressiveBeatmap.hitObjects.sliderRepeatPoints
|
|
@@ -640,19 +640,12 @@ class DroidSnapAimEvaluator {
|
|
|
640
640
|
return 0;
|
|
641
641
|
}
|
|
642
642
|
const last = current.previous(0);
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
const diameter = current.normalizedDiameter;
|
|
646
|
-
// Calculate the velocity to the current hitobject, which starts with a base distance / time assuming the last object is a hitcircle.
|
|
643
|
+
// Calculate the velocity to the current hitobject, which starts with a base distance / time
|
|
644
|
+
// assuming the last object is a hitcircle.
|
|
647
645
|
const currentDistance = withSliders && !current.is2BSlider
|
|
648
646
|
? current.lazyJumpDistance
|
|
649
647
|
: current.jumpDistance;
|
|
650
|
-
|
|
651
|
-
// But if the last object is a slider, then we extend the travel velocity through the slider into the current object.
|
|
652
|
-
if (last.object instanceof osuBase.Slider && !last.is2BSlider && withSliders) {
|
|
653
|
-
const sliderDistance = last.lazyTravelDistance + current.lazyJumpDistance;
|
|
654
|
-
currentVelocity = Math.max(currentVelocity, sliderDistance / current.strainTime);
|
|
655
|
-
}
|
|
648
|
+
const currentVelocity = this.calculateCurrentVelocity(current, last, currentDistance, withSliders);
|
|
656
649
|
const prevDistance = withSliders && !last.is2BSlider
|
|
657
650
|
? last.lazyJumpDistance
|
|
658
651
|
: last.jumpDistance;
|
|
@@ -660,99 +653,136 @@ class DroidSnapAimEvaluator {
|
|
|
660
653
|
// Start strain with regular velocity.
|
|
661
654
|
let strain = currentVelocity;
|
|
662
655
|
strain *= this.calculateVectorAngleRepetition(current, last);
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
// If rhythms are the same.
|
|
670
|
-
if (Math.max(current.strainTime, last.strainTime) <
|
|
671
|
-
1.25 * Math.min(current.strainTime, last.strainTime)) {
|
|
672
|
-
acuteAngleBonus = this.calculateAcuteAngleAcuteness(current.angle);
|
|
673
|
-
// Penalize angle repetition. It is important to do it _before_ multiplying by anything because we compare raw acuteness here.
|
|
674
|
-
acuteAngleBonus *=
|
|
675
|
-
0.08 +
|
|
676
|
-
0.92 *
|
|
677
|
-
(1 -
|
|
678
|
-
Math.min(acuteAngleBonus, Math.pow(this.calculateAcuteAngleAcuteness(lastAngle), 3)));
|
|
679
|
-
// Apply acute angle bonus for BPM above 300 1/2.
|
|
680
|
-
acuteAngleBonus *=
|
|
681
|
-
velocityInfluence *
|
|
682
|
-
osuBase.MathUtils.smootherstep(osuBase.MathUtils.millisecondsToBPM(current.strainTime, 2), 300, 450) *
|
|
683
|
-
osuBase.MathUtils.smootherstep(current.lazyJumpDistance, 0, diameter * 2);
|
|
684
|
-
}
|
|
685
|
-
let wideAngleBonus = this.calculateWideAngleAcuteness(current.angle);
|
|
686
|
-
// Penalize angle repetition. It is important to do it _before_ multiplying by velocity because we compare raw wideness here.
|
|
687
|
-
wideAngleBonus *=
|
|
688
|
-
0.25 +
|
|
689
|
-
0.75 *
|
|
690
|
-
(1 -
|
|
691
|
-
Math.min(wideAngleBonus, Math.pow(this.calculateWideAngleAcuteness(lastAngle), 3)));
|
|
692
|
-
// Rescale velocity for wide angle bonus.
|
|
693
|
-
const wideAngleTimeScale = 1.45;
|
|
694
|
-
let wideAngleCurrentVelocity = currentDistance /
|
|
695
|
-
Math.pow(current.strainTime, wideAngleTimeScale);
|
|
696
|
-
const wideAnglePrevVelocity = prevDistance / Math.pow(last.strainTime, wideAngleTimeScale);
|
|
697
|
-
if (last.object instanceof osuBase.Slider && withSliders) {
|
|
698
|
-
const sliderDistance = last.lazyTravelDistance + current.lazyJumpDistance;
|
|
699
|
-
wideAngleCurrentVelocity = Math.max(wideAngleCurrentVelocity, sliderDistance /
|
|
700
|
-
Math.pow(current.strainTime, wideAngleTimeScale));
|
|
701
|
-
}
|
|
702
|
-
wideAngleBonus *= Math.min(wideAngleCurrentVelocity, wideAnglePrevVelocity);
|
|
703
|
-
if (last2 !== null) {
|
|
704
|
-
// If objects just go back and forth through a middle point - don't give as much wide bonus.
|
|
705
|
-
// Use previous(2) and previous(0) because angles calculation is done prevprev-prev-curr, so any
|
|
706
|
-
// object's angle's center point is always the previous object.
|
|
707
|
-
const distance = last2.object.stackedPosition.getDistance(last.object.stackedPosition);
|
|
708
|
-
if (distance < 1) {
|
|
709
|
-
wideAngleBonus *= 1 - 0.55 * (1 - distance);
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
// Add in acute angle bonus or wide angle bonus, whichever is larger.
|
|
713
|
-
strain += Math.max(acuteAngleBonus * this.acuteAngleMultiplier, wideAngleBonus * this.wideAngleMultiplier);
|
|
714
|
-
// Apply wiggle bonus for jumps that are [radius, 3*diameter] in distance, with < 110 angle
|
|
715
|
-
// https://www.desmos.com/calculator/dp0v0nvowc
|
|
716
|
-
strain +=
|
|
717
|
-
velocityInfluence *
|
|
718
|
-
osuBase.MathUtils.smootherstep(currentDistance, radius, diameter) *
|
|
719
|
-
Math.pow(osuBase.MathUtils.reverseLerp(currentDistance, diameter * 3, diameter), 1.8) *
|
|
720
|
-
osuBase.MathUtils.smootherstep(currentAngle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60)) *
|
|
721
|
-
osuBase.MathUtils.smootherstep(prevDistance, radius, diameter) *
|
|
722
|
-
Math.pow(osuBase.MathUtils.reverseLerp(prevDistance, diameter * 3, diameter), 1.8) *
|
|
723
|
-
osuBase.MathUtils.smootherstep(lastAngle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60)) *
|
|
724
|
-
this.wiggleMultiplier;
|
|
725
|
-
}
|
|
726
|
-
if (Math.max(prevVelocity, currentVelocity)) {
|
|
727
|
-
if (withSliders) {
|
|
728
|
-
// We want to use the average velocity over the whole object when awarding differences, not the individual jump and slider path velocities.
|
|
729
|
-
currentVelocity = currentDistance / current.strainTime;
|
|
730
|
-
}
|
|
731
|
-
// Scale with ratio of difference compared to half the max distance.
|
|
732
|
-
const distanceRatio = osuBase.MathUtils.smoothstep(Math.abs(prevVelocity - currentVelocity) /
|
|
733
|
-
Math.max(prevVelocity, currentVelocity), 0, 1);
|
|
734
|
-
// Reward for % distance up to 125 / strainTime for overlaps where velocity is still changing.
|
|
735
|
-
const overlapVelocityBuff = Math.min((diameter * 1.25) /
|
|
736
|
-
Math.min(current.strainTime, last.strainTime), Math.abs(prevVelocity - currentVelocity));
|
|
737
|
-
let velocityChangeBonus = overlapVelocityBuff * distanceRatio;
|
|
738
|
-
// Penalize for rhythm changes.
|
|
739
|
-
velocityChangeBonus *= Math.pow(Math.min(current.strainTime, last.strainTime) /
|
|
740
|
-
Math.max(current.strainTime, last.strainTime), 2);
|
|
741
|
-
strain += velocityChangeBonus * this.velocityChangeMultiplier;
|
|
742
|
-
}
|
|
656
|
+
const acuteAngleBonus = this.calculateAcuteAngleBonus(current, last, currentVelocity, prevVelocity);
|
|
657
|
+
const wideAngleBonus = this.calculateWideAngleBonus(current, last, currentDistance, prevDistance, withSliders);
|
|
658
|
+
// Add in acute angle bonus or wide angle bonus, whichever is larger.
|
|
659
|
+
strain += Math.max(acuteAngleBonus, wideAngleBonus);
|
|
660
|
+
strain += this.calculateWiggleBonus(current, last, currentVelocity, prevVelocity, currentDistance, prevDistance);
|
|
661
|
+
strain += this.calculateVelocityChangeBonus(withSliders, prevVelocity, currentVelocity, currentDistance, current, last);
|
|
743
662
|
if (current.object instanceof osuBase.Slider && withSliders) {
|
|
744
|
-
|
|
745
|
-
let sliderBonus = current.travelDistance / current.travelTime;
|
|
746
|
-
sliderBonus =
|
|
747
|
-
sliderBonus < 1 ? sliderBonus : Math.pow(sliderBonus, 0.75);
|
|
748
|
-
strain +=
|
|
749
|
-
Math.pow(1 + sliderBonus * this.sliderMultiplier, 1.25) - 1;
|
|
663
|
+
strain += this.calculateSliderBonus(current);
|
|
750
664
|
}
|
|
751
665
|
// Apply high circle size bonus
|
|
752
666
|
strain *= current.smallCircleBonus;
|
|
753
667
|
strain *= this.highBpmBonus(current.strainTime);
|
|
754
668
|
return strain;
|
|
755
669
|
}
|
|
670
|
+
static calculateAcuteAngleBonus(current, last, currentVelocity, prevVelocity) {
|
|
671
|
+
if (current.angle === null || last.angle === null) {
|
|
672
|
+
return 0;
|
|
673
|
+
}
|
|
674
|
+
// Only reward acute angles when rhythms are the same.
|
|
675
|
+
if (Math.max(current.strainTime, last.strainTime) >=
|
|
676
|
+
1.25 * Math.min(current.strainTime, last.strainTime)) {
|
|
677
|
+
return 0;
|
|
678
|
+
}
|
|
679
|
+
let acuteAngleBonus = this.calculateAcuteAngleAcuteness(current.angle);
|
|
680
|
+
// Penalize angle repetition. It is important to do it _before_ multiplying by anything because we
|
|
681
|
+
// compare raw acuteness here.
|
|
682
|
+
acuteAngleBonus *=
|
|
683
|
+
0.08 +
|
|
684
|
+
0.92 *
|
|
685
|
+
(1 -
|
|
686
|
+
Math.min(acuteAngleBonus, Math.pow(this.calculateAcuteAngleAcuteness(last.angle), 3)));
|
|
687
|
+
const velocity = Math.min(currentVelocity, prevVelocity);
|
|
688
|
+
// Apply acute angle bonus for BPM above 300 1/2.
|
|
689
|
+
acuteAngleBonus *=
|
|
690
|
+
velocity *
|
|
691
|
+
osuBase.MathUtils.smootherstep(osuBase.MathUtils.millisecondsToBPM(current.strainTime, 2), 300, 450) *
|
|
692
|
+
osuBase.MathUtils.smootherstep(current.lazyJumpDistance, 0, current.normalizedDiameter * 2);
|
|
693
|
+
return acuteAngleBonus * this.acuteAngleMultiplier;
|
|
694
|
+
}
|
|
695
|
+
static calculateWideAngleBonus(current, last, currentDistance, prevDistance, withSliders) {
|
|
696
|
+
if (current.angle === null || last.angle === null) {
|
|
697
|
+
return 0;
|
|
698
|
+
}
|
|
699
|
+
let wideAngleBonus = this.calculateWideAngleAcuteness(current.angle);
|
|
700
|
+
// Penalize angle repetition. It is important to do it _before_ multiplying by velocity because we
|
|
701
|
+
// compare raw wideness here.
|
|
702
|
+
wideAngleBonus *=
|
|
703
|
+
0.25 +
|
|
704
|
+
0.75 *
|
|
705
|
+
(1 -
|
|
706
|
+
Math.min(wideAngleBonus, Math.pow(this.calculateWideAngleAcuteness(last.angle), 3)));
|
|
707
|
+
// Rescale velocity for wide angle bonus.
|
|
708
|
+
const wideAngleTimeScale = 1.45;
|
|
709
|
+
let wideAngleCurrentVelocity = currentDistance / Math.pow(current.strainTime, wideAngleTimeScale);
|
|
710
|
+
const wideAnglePrevVelocity = prevDistance / Math.pow(last.strainTime, wideAngleTimeScale);
|
|
711
|
+
if (last.object instanceof osuBase.Slider && withSliders) {
|
|
712
|
+
const sliderDistance = last.lazyTravelDistance + current.lazyJumpDistance;
|
|
713
|
+
wideAngleCurrentVelocity = Math.max(wideAngleCurrentVelocity, sliderDistance /
|
|
714
|
+
Math.pow(current.strainTime, wideAngleTimeScale));
|
|
715
|
+
}
|
|
716
|
+
wideAngleBonus *= Math.min(wideAngleCurrentVelocity, wideAnglePrevVelocity);
|
|
717
|
+
const last2 = current.previous(2);
|
|
718
|
+
if (last2 !== null) {
|
|
719
|
+
// If objects just go back and forth through a middle point - don't give as much wide bonus.
|
|
720
|
+
// Use previous(2) and previous(0) because angles calculation is done prevprev-prev-curr, so any
|
|
721
|
+
// object's angle's center point is always the previous object.
|
|
722
|
+
const distance = last2.object.stackedPosition.getDistance(last.object.stackedPosition);
|
|
723
|
+
if (distance < 1) {
|
|
724
|
+
wideAngleBonus *= 1 - 0.55 * (1 - distance);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
return wideAngleBonus * this.wideAngleMultiplier;
|
|
728
|
+
}
|
|
729
|
+
static calculateVelocityChangeBonus(withSliders, prevVelocity, currentVelocity, currentDistance, current, last) {
|
|
730
|
+
if (Math.max(prevVelocity, currentVelocity) === 0) {
|
|
731
|
+
return 0;
|
|
732
|
+
}
|
|
733
|
+
if (withSliders) {
|
|
734
|
+
// We want to use the average velocity over the whole object when awarding differences, not the
|
|
735
|
+
// individual jump and slider path velocities.
|
|
736
|
+
currentVelocity = currentDistance / current.strainTime;
|
|
737
|
+
}
|
|
738
|
+
// Scale with ratio of difference compared to half the max distance.
|
|
739
|
+
const distanceRatio = osuBase.MathUtils.smoothstep(Math.abs(prevVelocity - currentVelocity) /
|
|
740
|
+
Math.max(prevVelocity, currentVelocity), 0, 1);
|
|
741
|
+
// Reward for % distance up to 125 / strainTime for overlaps where velocity is still changing.
|
|
742
|
+
const overlapVelocityBuff = Math.min((current.normalizedDiameter * 1.25) /
|
|
743
|
+
Math.min(current.strainTime, last.strainTime), Math.abs(prevVelocity - currentVelocity));
|
|
744
|
+
let velocityChangeBonus = overlapVelocityBuff * distanceRatio;
|
|
745
|
+
// Penalize for rhythm changes.
|
|
746
|
+
velocityChangeBonus *= Math.pow(Math.min(current.strainTime, last.strainTime) /
|
|
747
|
+
Math.max(current.strainTime, last.strainTime), 2);
|
|
748
|
+
return velocityChangeBonus * this.velocityChangeMultiplier;
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* Difficulty bonus for "wiggle" patterns - jumps that are [radius, 3*diameter] in distance, with < 110 angle.
|
|
752
|
+
* https://www.desmos.com/calculator/dp0v0nvowc
|
|
753
|
+
*/
|
|
754
|
+
static calculateWiggleBonus(current, last, currentVelocity, prevVelocity, currentDistance, prevDistance) {
|
|
755
|
+
if (current.angle === null || last.angle === null) {
|
|
756
|
+
return 0;
|
|
757
|
+
}
|
|
758
|
+
const radius = current.normalizedRadius;
|
|
759
|
+
const diameter = current.normalizedDiameter;
|
|
760
|
+
const wiggleBonus = Math.min(currentVelocity, prevVelocity) *
|
|
761
|
+
osuBase.MathUtils.smootherstep(currentDistance, radius, diameter) *
|
|
762
|
+
Math.pow(osuBase.MathUtils.reverseLerp(currentDistance, diameter * 3, diameter), 1.8) *
|
|
763
|
+
osuBase.MathUtils.smootherstep(current.angle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60)) *
|
|
764
|
+
osuBase.MathUtils.smootherstep(prevDistance, radius, diameter) *
|
|
765
|
+
Math.pow(osuBase.MathUtils.reverseLerp(prevDistance, diameter * 3, diameter), 1.8) *
|
|
766
|
+
osuBase.MathUtils.smootherstep(last.angle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60));
|
|
767
|
+
return wiggleBonus * this.wiggleMultiplier;
|
|
768
|
+
}
|
|
769
|
+
static calculateSliderBonus(current) {
|
|
770
|
+
// Reward sliders based on velocity.
|
|
771
|
+
let sliderBonus = current.travelDistance / current.travelTime;
|
|
772
|
+
sliderBonus =
|
|
773
|
+
sliderBonus < 1 ? sliderBonus : Math.pow(sliderBonus, 0.75);
|
|
774
|
+
return Math.pow(1 + sliderBonus * this.sliderMultiplier, 1.25) - 1;
|
|
775
|
+
}
|
|
776
|
+
static calculateCurrentVelocity(current, last, currentDistance, withSliders) {
|
|
777
|
+
let currentVelocity = currentDistance / current.strainTime;
|
|
778
|
+
// But if the last object is a slider, then we extend the travel velocity through the slider into
|
|
779
|
+
// the current object.
|
|
780
|
+
if (last.object instanceof osuBase.Slider && !last.is2BSlider && withSliders) {
|
|
781
|
+
const sliderDistance = last.lazyTravelDistance + current.lazyJumpDistance;
|
|
782
|
+
currentVelocity = Math.max(currentVelocity, sliderDistance / current.strainTime);
|
|
783
|
+
}
|
|
784
|
+
return currentVelocity;
|
|
785
|
+
}
|
|
756
786
|
static calculateWideAngleAcuteness(angle) {
|
|
757
787
|
return osuBase.MathUtils.smoothstep(angle, osuBase.MathUtils.degreesToRadians(40), osuBase.MathUtils.degreesToRadians(140));
|
|
758
788
|
}
|
|
@@ -847,7 +877,7 @@ class DroidFlowAimEvaluator {
|
|
|
847
877
|
// Rhythm changes are harder to flow.
|
|
848
878
|
flowDifficulty *=
|
|
849
879
|
1 +
|
|
850
|
-
Math.min(0.
|
|
880
|
+
Math.min(0.1, Math.pow((Math.max(current.strainTime, last.strainTime) -
|
|
851
881
|
Math.min(current.strainTime, last.strainTime)) /
|
|
852
882
|
50, 4));
|
|
853
883
|
if (current.angle !== null && last.angle !== null) {
|
|
@@ -1551,7 +1581,7 @@ class DroidReadingEvaluator {
|
|
|
1551
1581
|
const distanceInfluenceThreshold = current.normalizedDiameter * 1.25;
|
|
1552
1582
|
const next = current.next(0);
|
|
1553
1583
|
// Only allow velocity to buff
|
|
1554
|
-
const velocity = Math.max(1, current.
|
|
1584
|
+
const velocity = Math.max(1, current.jumpDistance / current.strainTime);
|
|
1555
1585
|
const currentVisibleObjectDensity = this.retrieveCurrentVisibleObjectDensity(current);
|
|
1556
1586
|
const pastObjectDifficultyInfluence = this.getPastObjectDifficultyInfluence(current, distanceInfluenceThreshold);
|
|
1557
1587
|
const constantAngleNerfFactor = this.getConstantAngleNerfFactor(current);
|
|
@@ -1825,13 +1855,24 @@ DroidReadingEvaluator.maximumAngleRelevancyTime = 200;
|
|
|
1825
1855
|
* Represents the skill required to read every object in the beatmap.
|
|
1826
1856
|
*/
|
|
1827
1857
|
class DroidReading extends HarmonicSkill {
|
|
1828
|
-
constructor(
|
|
1829
|
-
super(
|
|
1830
|
-
this.clockRate = clockRate;
|
|
1831
|
-
this.hitObjects = hitObjects;
|
|
1858
|
+
constructor() {
|
|
1859
|
+
super(...arguments);
|
|
1832
1860
|
this.currentDifficulty = 0;
|
|
1861
|
+
this.firstObjectStartTime = null;
|
|
1833
1862
|
this.skillMultiplier = 2.5;
|
|
1834
1863
|
this.difficultyDecayBase = 0.8;
|
|
1864
|
+
/**
|
|
1865
|
+
* The duration for which the difficulty of objects is reduced, assuming the player has
|
|
1866
|
+
* memorized the beatmap.
|
|
1867
|
+
*/
|
|
1868
|
+
this.reducedDifficultyDuration = 40 * 1000;
|
|
1869
|
+
/**
|
|
1870
|
+
* The baseline multiplier applied to the difficulty of the first object.
|
|
1871
|
+
*
|
|
1872
|
+
* Assume that even with full memorization, skill is still required to read and play the
|
|
1873
|
+
* first objects.
|
|
1874
|
+
*/
|
|
1875
|
+
this.reducedDifficultyBaseline = 0.2;
|
|
1835
1876
|
}
|
|
1836
1877
|
countTopWeightedObjectDifficulties(difficultyValue) {
|
|
1837
1878
|
if (difficultyValue === 0) {
|
|
@@ -1849,26 +1890,31 @@ class DroidReading extends HarmonicSkill {
|
|
|
1849
1890
|
osuBase.MathUtils.offsetLogistic(next / consistentTopNote, 1.15, 5, 1.1), 0);
|
|
1850
1891
|
}
|
|
1851
1892
|
objectDifficultyOf(current) {
|
|
1893
|
+
var _a;
|
|
1852
1894
|
const decay = this.difficultyDecay(current.deltaTime);
|
|
1895
|
+
// This currently operates under the assumption that `objectDifficultyOf` is called once
|
|
1896
|
+
// per object, and in order. Under that assumption, we can trust that `current.startTime`
|
|
1897
|
+
// refers to the start time of the first object in the case that `firstObjectStartTime`
|
|
1898
|
+
// is yet to be set.
|
|
1899
|
+
(_a = this.firstObjectStartTime) !== null && _a !== void 0 ? _a : (this.firstObjectStartTime = current.startTime);
|
|
1900
|
+
let currentObjectStrain = this.calculateAdjustedDifficulty(current) *
|
|
1901
|
+
(1 - decay) *
|
|
1902
|
+
this.skillMultiplier;
|
|
1903
|
+
if (current.startTime <=
|
|
1904
|
+
this.firstObjectStartTime + this.reducedDifficultyDuration) {
|
|
1905
|
+
const scale = Math.log10(osuBase.Interpolation.lerp(1, 10, osuBase.MathUtils.clamp((current.startTime - this.firstObjectStartTime) /
|
|
1906
|
+
this.reducedDifficultyDuration, 0, 1)));
|
|
1907
|
+
currentObjectStrain *= osuBase.Interpolation.lerp(this.reducedDifficultyBaseline, 1, scale);
|
|
1908
|
+
}
|
|
1853
1909
|
this.currentDifficulty *= decay;
|
|
1854
|
-
this.currentDifficulty +=
|
|
1855
|
-
this.calculateAdjustedDifficulty(current) *
|
|
1856
|
-
(1 - decay) *
|
|
1857
|
-
this.skillMultiplier;
|
|
1910
|
+
this.currentDifficulty += currentObjectStrain;
|
|
1858
1911
|
return this.currentDifficulty;
|
|
1859
1912
|
}
|
|
1860
|
-
applyDifficultyTransformation(difficulties) {
|
|
1861
|
-
// Assume the first few seconds are completely memorized.
|
|
1862
|
-
const reducedNoteCount = this.calculateReducedNoteCount();
|
|
1863
|
-
for (let i = 0; i < Math.min(difficulties.length, reducedNoteCount); ++i) {
|
|
1864
|
-
difficulties[i] *= Math.log10(osuBase.Interpolation.lerp(1, 10, osuBase.MathUtils.clamp(i / reducedNoteCount, 0, 1)));
|
|
1865
|
-
}
|
|
1866
|
-
}
|
|
1867
1913
|
saveToHitObject(current, difficulty) {
|
|
1868
1914
|
current.readingDifficulty = difficulty;
|
|
1869
1915
|
}
|
|
1870
1916
|
calculateAdjustedDifficulty(current) {
|
|
1871
|
-
let difficulty = DroidReadingEvaluator.evaluateDifficultyOf(current, this.mods);
|
|
1917
|
+
let difficulty = Math.pow(DroidReadingEvaluator.evaluateDifficultyOf(current, this.mods), 0.89);
|
|
1872
1918
|
if (this.mods.has(osuBase.ModRelax)) {
|
|
1873
1919
|
difficulty *= 0.4;
|
|
1874
1920
|
}
|
|
@@ -1877,25 +1923,6 @@ class DroidReading extends HarmonicSkill {
|
|
|
1877
1923
|
}
|
|
1878
1924
|
return difficulty;
|
|
1879
1925
|
}
|
|
1880
|
-
calculateReducedNoteCount() {
|
|
1881
|
-
if (this.hitObjects.length < 2) {
|
|
1882
|
-
return 0;
|
|
1883
|
-
}
|
|
1884
|
-
const reducedDifficultyDuration = 60 * 1000;
|
|
1885
|
-
// We take the 2nd note to match `createDifficultyHitObjects`
|
|
1886
|
-
const firstDifficultyObject = this.hitObjects[1];
|
|
1887
|
-
const reducedDuration = firstDifficultyObject.startTime / this.clockRate +
|
|
1888
|
-
reducedDifficultyDuration;
|
|
1889
|
-
let reducedNoteCount = 0;
|
|
1890
|
-
for (let i = 1; i < this.hitObjects.length; ++i) {
|
|
1891
|
-
const object = this.hitObjects[i];
|
|
1892
|
-
if (object.startTime / this.clockRate > reducedDuration) {
|
|
1893
|
-
break;
|
|
1894
|
-
}
|
|
1895
|
-
++reducedNoteCount;
|
|
1896
|
-
}
|
|
1897
|
-
return reducedNoteCount;
|
|
1898
|
-
}
|
|
1899
1926
|
difficultyDecay(ms) {
|
|
1900
1927
|
return Math.pow(this.difficultyDecayBase, ms / 1000);
|
|
1901
1928
|
}
|
|
@@ -1923,11 +1950,16 @@ class DroidTapEvaluator {
|
|
|
1923
1950
|
current.isOverlapping(false)) {
|
|
1924
1951
|
return 0;
|
|
1925
1952
|
}
|
|
1926
|
-
let { strainTime } = current;
|
|
1927
|
-
// Nerf doubletappable doubles.
|
|
1928
1953
|
const doubletapness = considerCheesability
|
|
1929
1954
|
? 1 - current.getDoubletapness(current.next(0))
|
|
1930
1955
|
: 1;
|
|
1956
|
+
let difficulty = osuBase.MathUtils.millisecondsToBPM(current.strainTime);
|
|
1957
|
+
difficulty *= this.calculateSpeedBonus(current);
|
|
1958
|
+
// Apply penalty if there's doubletappable doubles
|
|
1959
|
+
return difficulty * doubletapness;
|
|
1960
|
+
}
|
|
1961
|
+
static calculateSpeedBonus(current) {
|
|
1962
|
+
let { strainTime } = current;
|
|
1931
1963
|
// Cap deltatime to the OD 300 hitwindow.
|
|
1932
1964
|
// 0.63 is derived from making sure 200 BPM 1/4 OD8 streams aren't nerfed harshly, whilst 0.92 limits the effect of the cap.
|
|
1933
1965
|
strainTime /= osuBase.MathUtils.clamp(strainTime / current.hitWindowFor(osuBase.HitResult.Great) / 0.63, 0.92, 1);
|
|
@@ -1941,14 +1973,7 @@ class DroidTapEvaluator {
|
|
|
1941
1973
|
strainTime) /
|
|
1942
1974
|
40), 2);
|
|
1943
1975
|
}
|
|
1944
|
-
|
|
1945
|
-
let difficulty = ((1 + speedBonus) * 1000) / strainTime;
|
|
1946
|
-
difficulty *= this.highBpmBonus(current.strainTime);
|
|
1947
|
-
// Apply penalty if there's doubletappable doubles
|
|
1948
|
-
return difficulty * doubletapness;
|
|
1949
|
-
}
|
|
1950
|
-
static highBpmBonus(ms) {
|
|
1951
|
-
return 1 / (1 - Math.pow(0.3, ms / 1000));
|
|
1976
|
+
return (1 + speedBonus) / strainTime;
|
|
1952
1977
|
}
|
|
1953
1978
|
}
|
|
1954
1979
|
// ~200 1/4 BPM streams
|
|
@@ -1961,7 +1986,7 @@ class DroidTap extends HarmonicSkill {
|
|
|
1961
1986
|
constructor(mods, considerCheesability) {
|
|
1962
1987
|
super(mods);
|
|
1963
1988
|
this.harmonicScale = 20;
|
|
1964
|
-
this.skillMultiplier =
|
|
1989
|
+
this.skillMultiplier = 66.2;
|
|
1965
1990
|
this.strainDecayBase = 0.3;
|
|
1966
1991
|
this.currentTapDifficulty = 0;
|
|
1967
1992
|
this.currentRhythmMultiplier = 0;
|
|
@@ -2204,7 +2229,9 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2204
2229
|
* Calculates the tap performance value of the beatmap.
|
|
2205
2230
|
*/
|
|
2206
2231
|
calculateTapValue() {
|
|
2207
|
-
|
|
2232
|
+
const tapDifficulty = this.difficultyAttributes.tapDifficulty *
|
|
2233
|
+
this.calculateTapHighDeviationNerf();
|
|
2234
|
+
let tapValue = DroidTap.difficultyToPerformance(tapDifficulty);
|
|
2208
2235
|
if (this._effectiveMissCount > 0) {
|
|
2209
2236
|
const tapEstimatedSliderBreaks = this.calculateEstimatedSliderBreaks(this.difficultyAttributes.tapTopWeightedSliderFactor);
|
|
2210
2237
|
const relevantMissCount = Math.min(this._effectiveMissCount + tapEstimatedSliderBreaks, this.totalImperfectHits + this.sliderTicksMissed);
|
|
@@ -2216,12 +2243,11 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2216
2243
|
tapValue *= Math.min(1, this.calculateDeviationBasedLengthScaling(Math.min(this.difficultyAttributes.speedNoteCount, this.totalHits / 1.45)));
|
|
2217
2244
|
// An effective hit window is created based on the tap SR. The higher the tap difficulty, the shorter the hit window.
|
|
2218
2245
|
// For example, a tap SR of 4 leads to an effective hit window of 35ms.
|
|
2219
|
-
const effectiveHitWindow = 35 * Math.pow(4 /
|
|
2246
|
+
const effectiveHitWindow = 35 * Math.pow(4 / tapDifficulty, 1.8);
|
|
2220
2247
|
// Find the proportion of 300s on speed notes assuming the hit window was the effective hit window.
|
|
2221
2248
|
const effectiveAccuracy = osuBase.ErrorFunction.erf(effectiveHitWindow / this._tapDeviation);
|
|
2222
2249
|
// Scale the tap value with normalized accuracy.
|
|
2223
2250
|
tapValue *= Math.pow(effectiveAccuracy, 2);
|
|
2224
|
-
tapValue *= this.calculateTapHighDeviationNerf();
|
|
2225
2251
|
// Scale the tap value with three-fingered penalty.
|
|
2226
2252
|
tapValue /= this._tapPenalty;
|
|
2227
2253
|
return tapValue;
|
|
@@ -2294,7 +2320,8 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2294
2320
|
return 1;
|
|
2295
2321
|
}
|
|
2296
2322
|
// https://www.desmos.com/calculator/naggvbcz0a
|
|
2297
|
-
return 0.93 /
|
|
2323
|
+
return (0.93 /
|
|
2324
|
+
(missCount / (4 * Math.log(Math.max(1, difficultStrainCount))) + 1));
|
|
2298
2325
|
}
|
|
2299
2326
|
/**
|
|
2300
2327
|
* The object-based proportional miss penalty.
|
|
@@ -2452,21 +2479,22 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2452
2479
|
if (this.tapDeviation == Number.POSITIVE_INFINITY) {
|
|
2453
2480
|
return 0;
|
|
2454
2481
|
}
|
|
2455
|
-
const
|
|
2456
|
-
// Decide a point where the
|
|
2457
|
-
// improperly. Any
|
|
2482
|
+
const { tapDifficulty } = this.difficultyAttributes;
|
|
2483
|
+
// Decide a point where the difficulty value achieved compared to the tap deviation is assumed to be tapped
|
|
2484
|
+
// improperly. Any difficulty above this point is considered "excess" tap difficulty. This is used to cause
|
|
2458
2485
|
// PP above the cutoff to scale logarithmically towards the original tap value thus nerfing the value.
|
|
2459
|
-
const excessTapDifficultyCutoff =
|
|
2460
|
-
if (
|
|
2486
|
+
const excessTapDifficultyCutoff = 2.9 + 1.45 * Math.pow(25 / this.tapDeviation, 5);
|
|
2487
|
+
if (tapDifficulty <= excessTapDifficultyCutoff) {
|
|
2461
2488
|
return 1;
|
|
2462
2489
|
}
|
|
2463
|
-
const scale =
|
|
2464
|
-
const
|
|
2465
|
-
(Math.log((
|
|
2490
|
+
const scale = 0.45;
|
|
2491
|
+
const adjustedTapDifficulty = scale *
|
|
2492
|
+
(Math.log((tapDifficulty - excessTapDifficultyCutoff) / scale + 1) +
|
|
2466
2493
|
excessTapDifficultyCutoff / scale);
|
|
2467
2494
|
// 250 UR and less are considered tapped correctly to ensure that normal scores will be punished as little as possible.
|
|
2468
2495
|
const t = 1 - osuBase.Interpolation.reverseLerp(this.tapDeviation, 25, 30);
|
|
2469
|
-
return osuBase.Interpolation.lerp(
|
|
2496
|
+
return (osuBase.Interpolation.lerp(adjustedTapDifficulty, tapDifficulty, t) /
|
|
2497
|
+
tapDifficulty);
|
|
2470
2498
|
}
|
|
2471
2499
|
getHitWindow() {
|
|
2472
2500
|
const { overallDifficulty } = this.difficultyAttributes;
|
|
@@ -2737,7 +2765,10 @@ class DifficultyHitObject {
|
|
|
2737
2765
|
this.deltaTime = this.startTime - lastObject.startTime / clockRate;
|
|
2738
2766
|
// Capped to 25ms to prevent difficulty calculation breaking from simultaneous objects.
|
|
2739
2767
|
this.strainTime = Math.max(this.deltaTime, DifficultyHitObject.minDeltaTime);
|
|
2740
|
-
|
|
2768
|
+
const previousDifficultyObject = this.previous(0);
|
|
2769
|
+
this.lastObjectEndDeltaTime = previousDifficultyObject
|
|
2770
|
+
? Math.max(this.startTime - previousDifficultyObject.endTime, DifficultyHitObject.minDeltaTime)
|
|
2771
|
+
: this.strainTime;
|
|
2741
2772
|
}
|
|
2742
2773
|
else {
|
|
2743
2774
|
this.deltaTime = 0;
|
|
@@ -3059,7 +3090,7 @@ class DroidDifficultyHitObject extends DifficultyHitObject {
|
|
|
3059
3090
|
return this.normalizedRadius * 2;
|
|
3060
3091
|
}
|
|
3061
3092
|
get smallCircleBonus() {
|
|
3062
|
-
return 1 + Math.pow(Math.max(0,
|
|
3093
|
+
return 1 + Math.pow(Math.max(0, 62.5 - this.object.radius) / 30, 1.5);
|
|
3063
3094
|
}
|
|
3064
3095
|
opacityAt(time, mods) {
|
|
3065
3096
|
// Traceable hides the primary piece of a hit circle (that is, its body), so consider it as fully invisible.
|
|
@@ -3525,6 +3556,8 @@ class DroidScoreUtils {
|
|
|
3525
3556
|
*
|
|
3526
3557
|
* @param beatmap The `Beatmap` to calculate the maximum spinner bonus for.
|
|
3527
3558
|
* @param playableBeatmap The `PlayableBeatmap` to calculate the maximum spinner bonus for.
|
|
3559
|
+
* Only base `PlayableBeatmap` members are used, so a progressive (as-of-a-point-in-time)
|
|
3560
|
+
* beatmap can be passed here too - see `DifficultyCalculator.calculateTimed`.
|
|
3528
3561
|
* @returns The maximum spinner bonus.
|
|
3529
3562
|
*/
|
|
3530
3563
|
static calculateMaximumSpinnerBonus(beatmap, playableBeatmap) {
|
|
@@ -3629,7 +3662,7 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
3629
3662
|
skills.push(new DroidTap(mods, true));
|
|
3630
3663
|
skills.push(new DroidTap(mods, false));
|
|
3631
3664
|
}
|
|
3632
|
-
skills.push(new DroidReading(mods
|
|
3665
|
+
skills.push(new DroidReading(mods));
|
|
3633
3666
|
if (mods.has(osuBase.ModFlashlight)) {
|
|
3634
3667
|
skills.push(new DroidFlashlight(mods, beatmap.hitObjects.objects.length));
|
|
3635
3668
|
}
|
|
@@ -3942,120 +3975,146 @@ class OsuSnapAimEvaluator {
|
|
|
3942
3975
|
last.object instanceof osuBase.Spinner) {
|
|
3943
3976
|
return 0;
|
|
3944
3977
|
}
|
|
3945
|
-
const last2 = current.previous(2);
|
|
3946
|
-
const radius = current.normalizedRadius;
|
|
3947
|
-
const diameter = current.normalizedDiameter;
|
|
3948
|
-
// Calculate the velocity to the current hitobject, which starts with a base distance / time assuming the last object is a hitcircle.
|
|
3949
3978
|
const currentDistance = withSliders
|
|
3950
3979
|
? current.lazyJumpDistance
|
|
3951
3980
|
: current.jumpDistance;
|
|
3952
|
-
|
|
3953
|
-
// But if the last object is a slider, then we extend the travel velocity through the slider into the current object.
|
|
3954
|
-
if (last.object instanceof osuBase.Slider && withSliders) {
|
|
3955
|
-
const sliderDistance = last.lazyTravelDistance + current.lazyJumpDistance;
|
|
3956
|
-
currentVelocity = Math.max(currentVelocity, sliderDistance / current.strainTime);
|
|
3957
|
-
}
|
|
3981
|
+
const currentVelocity = this.calculateCurrentVelocity(current, last, currentDistance, withSliders);
|
|
3958
3982
|
const prevDistance = withSliders
|
|
3959
3983
|
? last.lazyJumpDistance
|
|
3960
3984
|
: last.jumpDistance;
|
|
3961
3985
|
const prevVelocity = prevDistance / last.strainTime;
|
|
3962
3986
|
// Start strain with regular velocity.
|
|
3963
3987
|
let strain = currentVelocity;
|
|
3988
|
+
// Penalize angle repetition.
|
|
3964
3989
|
strain *= this.calculateVectorAngleRepetition(current, last);
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
if (
|
|
3972
|
-
// If rhythms are the same.
|
|
3973
|
-
Math.max(current.strainTime, last.strainTime) <
|
|
3974
|
-
1.25 * Math.min(current.strainTime, last.strainTime)) {
|
|
3975
|
-
acuteAngleBonus =
|
|
3976
|
-
this.calculateAcuteAngleAcuteness(currentAngle);
|
|
3977
|
-
// Penalize angle repetition. It is important to do it _before_ multiplying by anything because we compare raw acuteness here.
|
|
3978
|
-
acuteAngleBonus *=
|
|
3979
|
-
0.08 +
|
|
3980
|
-
0.92 *
|
|
3981
|
-
(1 -
|
|
3982
|
-
Math.min(acuteAngleBonus, Math.pow(this.calculateAcuteAngleAcuteness(lastAngle), 3)));
|
|
3983
|
-
// Apply acute angle bonus for BPM above 300 1/2.
|
|
3984
|
-
acuteAngleBonus *=
|
|
3985
|
-
velocityInfluence *
|
|
3986
|
-
osuBase.MathUtils.smootherstep(osuBase.MathUtils.millisecondsToBPM(current.strainTime, 2), 300, 400) *
|
|
3987
|
-
osuBase.MathUtils.smootherstep(currentDistance, 0, diameter * 2);
|
|
3988
|
-
}
|
|
3989
|
-
let wideAngleBonus = this.calculateWideAngleAcuteness(currentAngle);
|
|
3990
|
-
// Penalize angle repetition. It is important to do it _before_ multiplying by velocity because we compare raw wideness here.
|
|
3991
|
-
wideAngleBonus *=
|
|
3992
|
-
0.25 +
|
|
3993
|
-
0.75 *
|
|
3994
|
-
(1 -
|
|
3995
|
-
Math.min(wideAngleBonus, Math.pow(this.calculateWideAngleAcuteness(lastAngle), 3)));
|
|
3996
|
-
// Rescale velocity for wide angle bonus.
|
|
3997
|
-
const wideAngleTimeScale = 1.45;
|
|
3998
|
-
let wideAngleCurrentVelocity = currentDistance /
|
|
3999
|
-
Math.pow(current.strainTime, wideAngleTimeScale);
|
|
4000
|
-
const wideAnglePrevVelocity = prevDistance / Math.pow(last.strainTime, wideAngleTimeScale);
|
|
4001
|
-
if (last.object instanceof osuBase.Slider && withSliders) {
|
|
4002
|
-
const sliderDistance = last.lazyTravelDistance + current.lazyJumpDistance;
|
|
4003
|
-
wideAngleCurrentVelocity = Math.max(wideAngleCurrentVelocity, sliderDistance /
|
|
4004
|
-
Math.pow(current.strainTime, wideAngleTimeScale));
|
|
4005
|
-
}
|
|
4006
|
-
wideAngleBonus *= Math.min(wideAngleCurrentVelocity, wideAnglePrevVelocity);
|
|
4007
|
-
if (last2 !== null) {
|
|
4008
|
-
// If objects just go back and forth through a middle point - don't give as much wide bonus.
|
|
4009
|
-
// Use previous(2) and previous(0) because angles calculation is done prevprev-prev-curr, so any
|
|
4010
|
-
// object's angle's center point is always the previous object.
|
|
4011
|
-
const distance = last2.object.stackedPosition.getDistance(last.object.stackedPosition);
|
|
4012
|
-
if (distance < 1) {
|
|
4013
|
-
wideAngleBonus *= 1 - 0.55 * (1 - distance);
|
|
4014
|
-
}
|
|
4015
|
-
}
|
|
4016
|
-
// Add in acute angle bonus or wide angle bonus, whichever is larger.
|
|
4017
|
-
strain += Math.max(acuteAngleBonus * this.acuteAngleMultiplier, wideAngleBonus * this.wideAngleMultiplier);
|
|
4018
|
-
// Apply wiggle bonus for jumps that are [radius, 3*diameter] in distance, with < 110 angle
|
|
4019
|
-
// https://www.desmos.com/calculator/dp0v0nvowc
|
|
4020
|
-
strain +=
|
|
4021
|
-
velocityInfluence *
|
|
4022
|
-
osuBase.MathUtils.smootherstep(currentDistance, radius, diameter) *
|
|
4023
|
-
Math.pow(osuBase.MathUtils.reverseLerp(currentDistance, diameter * 3, diameter), 1.8) *
|
|
4024
|
-
osuBase.MathUtils.smootherstep(currentAngle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60)) *
|
|
4025
|
-
osuBase.MathUtils.smootherstep(prevDistance, radius, diameter) *
|
|
4026
|
-
Math.pow(osuBase.MathUtils.reverseLerp(prevDistance, diameter * 3, diameter), 1.8) *
|
|
4027
|
-
osuBase.MathUtils.smootherstep(lastAngle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60)) *
|
|
4028
|
-
this.wiggleMultiplier;
|
|
4029
|
-
}
|
|
4030
|
-
if (Math.max(prevVelocity, currentVelocity)) {
|
|
4031
|
-
if (withSliders) {
|
|
4032
|
-
// We want to use the average velocity over the whole object when awarding differences, not the individual jump and slider path velocities.
|
|
4033
|
-
currentVelocity = currentDistance / current.strainTime;
|
|
4034
|
-
}
|
|
4035
|
-
// Scale with ratio of difference compared to half the max distance.
|
|
4036
|
-
const distanceRatio = osuBase.MathUtils.smoothstep(Math.abs(prevVelocity - currentVelocity) /
|
|
4037
|
-
Math.max(prevVelocity, currentVelocity), 0, 1);
|
|
4038
|
-
// Reward for % distance up to 125 / strainTime for overlaps where velocity is still changing.
|
|
4039
|
-
const overlapVelocityBuff = Math.min((diameter * 1.25) /
|
|
4040
|
-
Math.min(current.strainTime, last.strainTime), Math.abs(prevVelocity - currentVelocity));
|
|
4041
|
-
let velocityChangeBonus = overlapVelocityBuff * distanceRatio;
|
|
4042
|
-
// Penalize for rhythm changes.
|
|
4043
|
-
velocityChangeBonus *= Math.pow(Math.min(current.strainTime, last.strainTime) /
|
|
4044
|
-
Math.max(current.strainTime, last.strainTime), 2);
|
|
4045
|
-
strain += velocityChangeBonus * this.velocityChangeMultiplier;
|
|
4046
|
-
}
|
|
3990
|
+
const acuteAngleBonus = this.calculateAcuteAngleBonus(current, last, currentDistance, currentVelocity, prevVelocity);
|
|
3991
|
+
const wideAngleBonus = this.calculateWideAngleBonus(current, last, currentDistance, prevDistance, withSliders);
|
|
3992
|
+
// Add in acute angle bonus or wide angle bonus, whichever is larger.
|
|
3993
|
+
strain += Math.max(acuteAngleBonus, wideAngleBonus);
|
|
3994
|
+
strain += this.calculateWiggleBonus(current, last, currentVelocity, prevVelocity, currentDistance, prevDistance);
|
|
3995
|
+
strain += this.calculateVelocityChangeBonus(withSliders, prevVelocity, currentVelocity, currentDistance, current, last);
|
|
4047
3996
|
if (current.object instanceof osuBase.Slider && withSliders) {
|
|
4048
|
-
|
|
4049
|
-
const sliderBonus = current.travelDistance / current.travelTime;
|
|
4050
|
-
strain +=
|
|
4051
|
-
(sliderBonus < 1 ? sliderBonus : Math.pow(sliderBonus, 0.75)) *
|
|
4052
|
-
this.sliderMultiplier;
|
|
3997
|
+
strain += this.calculateSliderBonus(current);
|
|
4053
3998
|
}
|
|
4054
|
-
// Apply high circle size bonus
|
|
3999
|
+
// Apply high circle size bonus.
|
|
4055
4000
|
strain *= current.smallCircleBonus;
|
|
4056
4001
|
strain *= this.highBpmBonus(current.strainTime);
|
|
4057
4002
|
return strain;
|
|
4058
4003
|
}
|
|
4004
|
+
static calculateAcuteAngleBonus(current, last, currentDistance, currentVelocity, prevVelocity) {
|
|
4005
|
+
if (current.angle === null || last.angle === null) {
|
|
4006
|
+
return 0;
|
|
4007
|
+
}
|
|
4008
|
+
// Only reward acute angles when rhythms are the same.
|
|
4009
|
+
if (Math.max(current.strainTime, last.strainTime) >=
|
|
4010
|
+
1.25 * Math.min(current.strainTime, last.strainTime)) {
|
|
4011
|
+
return 0;
|
|
4012
|
+
}
|
|
4013
|
+
let acuteAngleBonus = this.calculateAcuteAngleAcuteness(current.angle);
|
|
4014
|
+
// Penalize angle repetition. It is important to do it _before_ multiplying by anything because we
|
|
4015
|
+
// compare raw acuteness here.
|
|
4016
|
+
acuteAngleBonus *=
|
|
4017
|
+
0.08 +
|
|
4018
|
+
0.92 *
|
|
4019
|
+
(1 -
|
|
4020
|
+
Math.min(acuteAngleBonus, Math.pow(this.calculateAcuteAngleAcuteness(last.angle), 3)));
|
|
4021
|
+
const velocity = Math.min(currentVelocity, prevVelocity);
|
|
4022
|
+
// Apply acute angle bonus for BPM above 300 1/2 and distance more than one diameter.
|
|
4023
|
+
acuteAngleBonus *=
|
|
4024
|
+
velocity *
|
|
4025
|
+
osuBase.MathUtils.smootherstep(osuBase.MathUtils.millisecondsToBPM(current.strainTime, 2), 300, 400) *
|
|
4026
|
+
osuBase.MathUtils.smootherstep(currentDistance, 0, current.normalizedDiameter * 2);
|
|
4027
|
+
return acuteAngleBonus * this.acuteAngleMultiplier;
|
|
4028
|
+
}
|
|
4029
|
+
static calculateWideAngleBonus(current, last, currentDistance, prevDistance, withSliders) {
|
|
4030
|
+
if (current.angle === null || last.angle === null) {
|
|
4031
|
+
return 0;
|
|
4032
|
+
}
|
|
4033
|
+
let wideAngleBonus = this.calculateWideAngleAcuteness(current.angle);
|
|
4034
|
+
// Penalize angle repetition. It is important to do it _before_ multiplying by velocity because we
|
|
4035
|
+
// compare raw wideness here.
|
|
4036
|
+
wideAngleBonus *=
|
|
4037
|
+
0.25 +
|
|
4038
|
+
0.75 *
|
|
4039
|
+
(1 -
|
|
4040
|
+
Math.min(wideAngleBonus, Math.pow(this.calculateWideAngleAcuteness(last.angle), 3)));
|
|
4041
|
+
// Rescale velocity for the wide angle bonus.
|
|
4042
|
+
const wideAngleTimeScale = 1.45;
|
|
4043
|
+
let currentRescaledVelocity = currentDistance / Math.pow(current.strainTime, wideAngleTimeScale);
|
|
4044
|
+
const prevRescaledVelocity = prevDistance / Math.pow(last.strainTime, wideAngleTimeScale);
|
|
4045
|
+
if (last.object instanceof osuBase.Slider && withSliders) {
|
|
4046
|
+
const sliderDistance = last.lazyTravelDistance + current.lazyJumpDistance;
|
|
4047
|
+
currentRescaledVelocity = Math.max(currentRescaledVelocity, sliderDistance /
|
|
4048
|
+
Math.pow(current.strainTime, wideAngleTimeScale));
|
|
4049
|
+
}
|
|
4050
|
+
wideAngleBonus *= Math.min(currentRescaledVelocity, prevRescaledVelocity);
|
|
4051
|
+
const last2 = current.previous(2);
|
|
4052
|
+
if (last2 !== null) {
|
|
4053
|
+
// If objects just go back and forth through a middle point - don't give as much wide bonus.
|
|
4054
|
+
// Use previous(2) and previous(0) because angles calculation is done prevprev-prev-curr, so any
|
|
4055
|
+
// object's angle's center point is always the previous object.
|
|
4056
|
+
const distance = last2.object.stackedPosition.getDistance(last.object.stackedPosition);
|
|
4057
|
+
if (distance < 1) {
|
|
4058
|
+
wideAngleBonus *= 1 - 0.55 * (1 - distance);
|
|
4059
|
+
}
|
|
4060
|
+
}
|
|
4061
|
+
return wideAngleBonus * this.wideAngleMultiplier;
|
|
4062
|
+
}
|
|
4063
|
+
static calculateVelocityChangeBonus(withSliders, prevVelocity, currentVelocity, currentDistance, current, last) {
|
|
4064
|
+
if (Math.max(prevVelocity, currentVelocity) === 0) {
|
|
4065
|
+
return 0;
|
|
4066
|
+
}
|
|
4067
|
+
if (withSliders) {
|
|
4068
|
+
// We want to use just the object jump without slider velocity when awarding differences.
|
|
4069
|
+
currentVelocity = currentDistance / current.strainTime;
|
|
4070
|
+
}
|
|
4071
|
+
// Scale with ratio of difference compared to half the max distance.
|
|
4072
|
+
const distanceRatio = osuBase.MathUtils.smoothstep(Math.abs(prevVelocity - currentVelocity) /
|
|
4073
|
+
Math.max(prevVelocity, currentVelocity), 0, 1);
|
|
4074
|
+
// Reward for % distance up to 125 / strainTime for overlaps where velocity is still changing.
|
|
4075
|
+
const overlapVelocityBuff = Math.min((current.normalizedDiameter * 1.25) /
|
|
4076
|
+
Math.min(current.strainTime, last.strainTime), Math.abs(prevVelocity - currentVelocity));
|
|
4077
|
+
let velocityChangeBonus = overlapVelocityBuff * distanceRatio;
|
|
4078
|
+
// Penalize for rhythm changes.
|
|
4079
|
+
velocityChangeBonus *= Math.pow(Math.min(current.strainTime, last.strainTime) /
|
|
4080
|
+
Math.max(current.strainTime, last.strainTime), 2);
|
|
4081
|
+
return velocityChangeBonus * this.velocityChangeMultiplier;
|
|
4082
|
+
}
|
|
4083
|
+
/**
|
|
4084
|
+
* Difficulty bonus for "wiggle" patterns - jumps that are [radius, 3*diameter] in distance, with < 110 angle.
|
|
4085
|
+
* https://www.desmos.com/calculator/dp0v0nvowc
|
|
4086
|
+
*/
|
|
4087
|
+
static calculateWiggleBonus(current, last, currentVelocity, prevVelocity, currentDistance, prevDistance) {
|
|
4088
|
+
if (current.angle === null || last.angle === null) {
|
|
4089
|
+
return 0;
|
|
4090
|
+
}
|
|
4091
|
+
const radius = current.normalizedRadius;
|
|
4092
|
+
const diameter = current.normalizedDiameter;
|
|
4093
|
+
const wiggleBonus = Math.min(currentVelocity, prevVelocity) *
|
|
4094
|
+
osuBase.MathUtils.smootherstep(currentDistance, radius, diameter) *
|
|
4095
|
+
Math.pow(osuBase.MathUtils.reverseLerp(currentDistance, diameter * 3, diameter), 1.8) *
|
|
4096
|
+
osuBase.MathUtils.smootherstep(current.angle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60)) *
|
|
4097
|
+
osuBase.MathUtils.smootherstep(prevDistance, radius, diameter) *
|
|
4098
|
+
Math.pow(osuBase.MathUtils.reverseLerp(prevDistance, diameter * 3, diameter), 1.8) *
|
|
4099
|
+
osuBase.MathUtils.smootherstep(last.angle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60));
|
|
4100
|
+
return wiggleBonus * this.wiggleMultiplier;
|
|
4101
|
+
}
|
|
4102
|
+
static calculateSliderBonus(current) {
|
|
4103
|
+
// Reward sliders based on velocity.
|
|
4104
|
+
const sliderBonus = current.travelDistance / current.travelTime;
|
|
4105
|
+
const rescaledSliderBonus = sliderBonus < 1 ? sliderBonus : Math.pow(sliderBonus, 0.75);
|
|
4106
|
+
return rescaledSliderBonus * this.sliderMultiplier;
|
|
4107
|
+
}
|
|
4108
|
+
static calculateCurrentVelocity(current, last, currentDistance, withSliders) {
|
|
4109
|
+
let currentVelocity = currentDistance / current.strainTime;
|
|
4110
|
+
// If the last object is a slider, then we extend the travel velocity through the slider into the
|
|
4111
|
+
// current object.
|
|
4112
|
+
if (last.object instanceof osuBase.Slider && withSliders) {
|
|
4113
|
+
const sliderDistance = last.lazyTravelDistance + current.lazyJumpDistance;
|
|
4114
|
+
currentVelocity = Math.max(currentVelocity, sliderDistance / current.strainTime);
|
|
4115
|
+
}
|
|
4116
|
+
return currentVelocity;
|
|
4117
|
+
}
|
|
4059
4118
|
static calculateWideAngleAcuteness(angle) {
|
|
4060
4119
|
return osuBase.MathUtils.smoothstep(angle, osuBase.MathUtils.degreesToRadians(40), osuBase.MathUtils.degreesToRadians(140));
|
|
4061
4120
|
}
|
|
@@ -4150,7 +4209,7 @@ class OsuFlowAimEvaluator {
|
|
|
4150
4209
|
// Rhythm changes are harder to flow.
|
|
4151
4210
|
flowDifficulty *=
|
|
4152
4211
|
1 +
|
|
4153
|
-
Math.min(0.
|
|
4212
|
+
Math.min(0.1, Math.pow((Math.max(current.strainTime, last.strainTime) -
|
|
4154
4213
|
Math.min(current.strainTime, last.strainTime)) /
|
|
4155
4214
|
50, 4));
|
|
4156
4215
|
if (current.angle !== null && last.angle !== null) {
|
|
@@ -4225,7 +4284,7 @@ class OsuReadingEvaluator {
|
|
|
4225
4284
|
const distanceInfluenceThreshold = current.normalizedDiameter * 1.5;
|
|
4226
4285
|
const next = current.next(0);
|
|
4227
4286
|
// Only allow velocity to buff
|
|
4228
|
-
const velocity = Math.max(1, current.
|
|
4287
|
+
const velocity = Math.max(1, current.jumpDistance / current.strainTime);
|
|
4229
4288
|
const currentVisibleObjectDensity = this.retrieveCurrentVisibleObjectDensity(current);
|
|
4230
4289
|
const pastObjectDifficultyInfluence = this.getPastObjectDifficultyInfluence(current, distanceInfluenceThreshold);
|
|
4231
4290
|
const constantAngleNerfFactor = this.getConstantAngleNerfFactor(current);
|
|
@@ -4638,9 +4697,14 @@ class OsuSpeedEvaluator {
|
|
|
4638
4697
|
if (current.object instanceof osuBase.Spinner) {
|
|
4639
4698
|
return 0;
|
|
4640
4699
|
}
|
|
4641
|
-
let strainTime = current.strainTime;
|
|
4642
|
-
// Nerf doubletappable doubles.
|
|
4643
4700
|
const doubletapness = 1 - current.getDoubletapness(current.next(0));
|
|
4701
|
+
let difficulty = osuBase.MathUtils.millisecondsToBPM(current.strainTime);
|
|
4702
|
+
difficulty *= this.calculateSpeedBonus(current);
|
|
4703
|
+
// Apply penalty if there's doubletappable doubles
|
|
4704
|
+
return difficulty * doubletapness;
|
|
4705
|
+
}
|
|
4706
|
+
static calculateSpeedBonus(current) {
|
|
4707
|
+
let { strainTime } = current;
|
|
4644
4708
|
// Cap deltatime to the OD 300 hitwindow.
|
|
4645
4709
|
// 0.93 is derived from making sure 260 BPM 1/4 OD8 streams aren't nerfed harshly, whilst 0.92 limits the effect of the cap.
|
|
4646
4710
|
strainTime /= osuBase.MathUtils.clamp(strainTime / current.hitWindowFor(osuBase.HitResult.Great) / 0.93, 0.92, 1);
|
|
@@ -4654,14 +4718,7 @@ class OsuSpeedEvaluator {
|
|
|
4654
4718
|
strainTime) /
|
|
4655
4719
|
40, 2);
|
|
4656
4720
|
}
|
|
4657
|
-
|
|
4658
|
-
let difficulty = ((1 + speedBonus) * 1000) / strainTime;
|
|
4659
|
-
difficulty *= this.highBpmBonus(current.strainTime);
|
|
4660
|
-
// Apply penalty if there's doubletappable doubles
|
|
4661
|
-
return difficulty * doubletapness;
|
|
4662
|
-
}
|
|
4663
|
-
static highBpmBonus(ms) {
|
|
4664
|
-
return 1 / (1 - Math.pow(0.3, ms / 1000));
|
|
4721
|
+
return (1 + speedBonus) / strainTime;
|
|
4665
4722
|
}
|
|
4666
4723
|
}
|
|
4667
4724
|
// ~200 1/4 BPM streams
|
|
@@ -4870,13 +4927,24 @@ class OsuAim extends VariableLengthStrainSkill {
|
|
|
4870
4927
|
* Represents the skill required to read every object in the beatmap.
|
|
4871
4928
|
*/
|
|
4872
4929
|
class OsuReading extends HarmonicSkill {
|
|
4873
|
-
constructor(
|
|
4874
|
-
super(
|
|
4875
|
-
this.clockRate = clockRate;
|
|
4876
|
-
this.hitObjects = hitObjects;
|
|
4930
|
+
constructor() {
|
|
4931
|
+
super(...arguments);
|
|
4877
4932
|
this.currentDifficulty = 0;
|
|
4933
|
+
this.firstObjectStartTime = null;
|
|
4878
4934
|
this.skillMultiplier = 2.5;
|
|
4879
4935
|
this.difficultyDecayBase = 0.8;
|
|
4936
|
+
/**
|
|
4937
|
+
* The duration for which the difficulty of objects is reduced, assuming the player has
|
|
4938
|
+
* memorized the beatmap.
|
|
4939
|
+
*/
|
|
4940
|
+
this.reducedDifficultyDuration = 40 * 1000;
|
|
4941
|
+
/**
|
|
4942
|
+
* The baseline multiplier applied to the difficulty of the first object.
|
|
4943
|
+
*
|
|
4944
|
+
* Assume that even with full memorization, skill is still required to read and play the
|
|
4945
|
+
* first objects.
|
|
4946
|
+
*/
|
|
4947
|
+
this.reducedDifficultyBaseline = 0.2;
|
|
4880
4948
|
}
|
|
4881
4949
|
countTopWeightedObjectDifficulties(difficultyValue) {
|
|
4882
4950
|
if (difficultyValue === 0) {
|
|
@@ -4894,21 +4962,26 @@ class OsuReading extends HarmonicSkill {
|
|
|
4894
4962
|
osuBase.MathUtils.offsetLogistic(next / consistentTopNote, 1.15, 5, 1.1), 0);
|
|
4895
4963
|
}
|
|
4896
4964
|
objectDifficultyOf(current) {
|
|
4965
|
+
var _a;
|
|
4897
4966
|
const decay = this.difficultyDecay(current.deltaTime);
|
|
4967
|
+
// This currently operates under the assumption that `objectDifficultyOf` is called once
|
|
4968
|
+
// per object, and in order. Under that assumption, we can trust that `current.startTime`
|
|
4969
|
+
// refers to the start time of the first object in the case that `firstObjectStartTime`
|
|
4970
|
+
// is yet to be set.
|
|
4971
|
+
(_a = this.firstObjectStartTime) !== null && _a !== void 0 ? _a : (this.firstObjectStartTime = current.startTime);
|
|
4972
|
+
let currentObjectStrain = this.calculateAdjustedDifficulty(current) *
|
|
4973
|
+
(1 - decay) *
|
|
4974
|
+
this.skillMultiplier;
|
|
4975
|
+
if (current.startTime <=
|
|
4976
|
+
this.firstObjectStartTime + this.reducedDifficultyDuration) {
|
|
4977
|
+
const scale = Math.log10(osuBase.Interpolation.lerp(1, 10, osuBase.MathUtils.clamp((current.startTime - this.firstObjectStartTime) /
|
|
4978
|
+
this.reducedDifficultyDuration, 0, 1)));
|
|
4979
|
+
currentObjectStrain *= osuBase.Interpolation.lerp(this.reducedDifficultyBaseline, 1, scale);
|
|
4980
|
+
}
|
|
4898
4981
|
this.currentDifficulty *= decay;
|
|
4899
|
-
this.currentDifficulty +=
|
|
4900
|
-
this.calculateAdjustedDifficulty(current) *
|
|
4901
|
-
(1 - decay) *
|
|
4902
|
-
this.skillMultiplier;
|
|
4982
|
+
this.currentDifficulty += currentObjectStrain;
|
|
4903
4983
|
return this.currentDifficulty;
|
|
4904
4984
|
}
|
|
4905
|
-
applyDifficultyTransformation(difficulties) {
|
|
4906
|
-
// Assume the first few seconds are completely memorized.
|
|
4907
|
-
const reducedNoteCount = this.calculateReducedNoteCount();
|
|
4908
|
-
for (let i = 0; i < Math.min(difficulties.length, reducedNoteCount); ++i) {
|
|
4909
|
-
difficulties[i] *= Math.log10(osuBase.Interpolation.lerp(1, 10, osuBase.MathUtils.clamp(i / reducedNoteCount, 0, 1)));
|
|
4910
|
-
}
|
|
4911
|
-
}
|
|
4912
4985
|
saveToHitObject(current, difficulty) {
|
|
4913
4986
|
current.readingDifficulty = difficulty;
|
|
4914
4987
|
}
|
|
@@ -4932,25 +5005,6 @@ class OsuReading extends HarmonicSkill {
|
|
|
4932
5005
|
Math.pow(Math.max(0, current.overallDifficulty), 2.2) / 1125;
|
|
4933
5006
|
return difficulty;
|
|
4934
5007
|
}
|
|
4935
|
-
calculateReducedNoteCount() {
|
|
4936
|
-
if (this.hitObjects.length < 2) {
|
|
4937
|
-
return 0;
|
|
4938
|
-
}
|
|
4939
|
-
const reducedDifficultyDuration = 60 * 1000;
|
|
4940
|
-
// We take the 2nd note to match `createDifficultyHitObjects`
|
|
4941
|
-
const firstDifficultyObject = this.hitObjects[1];
|
|
4942
|
-
const reducedDuration = firstDifficultyObject.startTime / this.clockRate +
|
|
4943
|
-
reducedDifficultyDuration;
|
|
4944
|
-
let reducedNoteCount = 0;
|
|
4945
|
-
for (let i = 1; i < this.hitObjects.length; ++i) {
|
|
4946
|
-
const object = this.hitObjects[i];
|
|
4947
|
-
if (object.startTime / this.clockRate > reducedDuration) {
|
|
4948
|
-
break;
|
|
4949
|
-
}
|
|
4950
|
-
++reducedNoteCount;
|
|
4951
|
-
}
|
|
4952
|
-
return reducedNoteCount;
|
|
4953
|
-
}
|
|
4954
5008
|
difficultyDecay(ms) {
|
|
4955
5009
|
return Math.pow(this.difficultyDecayBase, ms / 1000);
|
|
4956
5010
|
}
|
|
@@ -4965,7 +5019,7 @@ class OsuSpeed extends HarmonicSkill {
|
|
|
4965
5019
|
this.harmonicScale = 20;
|
|
4966
5020
|
this.currentDifficulty = 0;
|
|
4967
5021
|
this.currentRhythm = 0;
|
|
4968
|
-
this.skillMultiplier =
|
|
5022
|
+
this.skillMultiplier = 66.2;
|
|
4969
5023
|
this.strainDecayBase = 0.3;
|
|
4970
5024
|
this.sliderDifficulties = [];
|
|
4971
5025
|
this.maxDifficulty = 0;
|
|
@@ -5183,7 +5237,9 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
5183
5237
|
this.speedDeviation === Number.POSITIVE_INFINITY) {
|
|
5184
5238
|
return 0;
|
|
5185
5239
|
}
|
|
5186
|
-
|
|
5240
|
+
const speedDifficulty = this.difficultyAttributes.speedDifficulty *
|
|
5241
|
+
this.calculateSpeedHighDeviationNerf();
|
|
5242
|
+
let speedValue = OsuSpeed.difficultyToPerformance(speedDifficulty);
|
|
5187
5243
|
if (this._effectiveMissCount > 0) {
|
|
5188
5244
|
const speedEstimatedSliderBreaks = this.calculateEstimatedSliderBreaks(this.difficultyAttributes.speedTopWeightedSliderFactor);
|
|
5189
5245
|
const relevantMissCount = Math.min(this._effectiveMissCount + speedEstimatedSliderBreaks, this.totalImperfectHits + this.sliderTicksMissed);
|
|
@@ -5193,10 +5249,9 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
5193
5249
|
// Increasing the speed value by object count for Blinds is not ideal, so the minimum buff is given.
|
|
5194
5250
|
speedValue *= 1.12;
|
|
5195
5251
|
}
|
|
5196
|
-
speedValue *= this.calculateSpeedHighDeviationNerf();
|
|
5197
5252
|
// An effective hit window is created based on the speed SR. The higher the speed difficulty, the shorter the hit window.
|
|
5198
5253
|
// For example, a speed SR of 4 leads to an effective hit window of 20ms, which is OD 10.
|
|
5199
|
-
const effectiveHitWindow = 20 * Math.pow(4 /
|
|
5254
|
+
const effectiveHitWindow = 20 * Math.pow(4 / speedDifficulty, 0.35);
|
|
5200
5255
|
// Find the proportion of 300s on speed notes assuming the hit window was the effective hit window.
|
|
5201
5256
|
const effectiveAccuracy = osuBase.ErrorFunction.erf(effectiveHitWindow / this.speedDeviation);
|
|
5202
5257
|
// Scale speed value by normalized accuracy.
|
|
@@ -5219,9 +5274,9 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
5219
5274
|
const realAccuracy = new osuBase.Accuracy(Object.assign(Object.assign({}, this.computedAccuracy), { n300: this.computedAccuracy.n300 - (this.totalHits - ncircles) }));
|
|
5220
5275
|
// Lots of arbitrary values from testing.
|
|
5221
5276
|
// Considering to use derivation from perfect accuracy in a probabilistic manner - assume normal distribution
|
|
5277
|
+
// It is possible to reach a negative accuracy with this formula. `Accuracy.value` caps it at zero - zero points.
|
|
5222
5278
|
let accuracyValue = Math.pow(1.52163, this.overallDifficulty) *
|
|
5223
|
-
|
|
5224
|
-
Math.pow(realAccuracy.n300 < 0 ? 0 : realAccuracy.value, 24) *
|
|
5279
|
+
Math.pow(realAccuracy.value, 24) *
|
|
5225
5280
|
2.83;
|
|
5226
5281
|
// Bonus for many hitcircles - it's harder to keep good accuracy up for longer.
|
|
5227
5282
|
accuracyValue *= Math.pow(ncircles / 1000, ncircles < 1000 ? 0.3 : 0.1);
|
|
@@ -5283,7 +5338,8 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
5283
5338
|
return 1;
|
|
5284
5339
|
}
|
|
5285
5340
|
// https://www.desmos.com/calculator/naggvbcz0a
|
|
5286
|
-
return 0.93 /
|
|
5341
|
+
return (0.93 /
|
|
5342
|
+
(missCount / (4 * Math.log(Math.max(1, difficultStrainCount))) + 1));
|
|
5287
5343
|
}
|
|
5288
5344
|
/**
|
|
5289
5345
|
* Estimates a player's deviation on speed notes using {@link calculateDeviation}, assuming worst-case.
|
|
@@ -5368,21 +5424,23 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
5368
5424
|
if (this.speedDeviation == Number.POSITIVE_INFINITY) {
|
|
5369
5425
|
return 0;
|
|
5370
5426
|
}
|
|
5371
|
-
const
|
|
5372
|
-
//
|
|
5373
|
-
//
|
|
5374
|
-
//
|
|
5375
|
-
|
|
5376
|
-
|
|
5427
|
+
const { speedDifficulty } = this.difficultyAttributes;
|
|
5428
|
+
// Decides a point where the difficulty played compared to the speed deviation is assumed to be tapped improperly.
|
|
5429
|
+
// Any difficulty above this point is considered "excess" speed difficulty.
|
|
5430
|
+
// This is used to cause difficulty above the cutoff to scale logarithmically towards the original speed value thus
|
|
5431
|
+
// nerfing the value.
|
|
5432
|
+
const excessSpeedDifficultyCutoff = 2.9 + 1.45 * Math.pow(22 / this.speedDeviation, 5);
|
|
5433
|
+
if (speedDifficulty <= excessSpeedDifficultyCutoff) {
|
|
5377
5434
|
return 1;
|
|
5378
5435
|
}
|
|
5379
|
-
const scale =
|
|
5380
|
-
const
|
|
5381
|
-
(Math.log((
|
|
5436
|
+
const scale = 0.45;
|
|
5437
|
+
const adjustedSpeedDifficulty = scale *
|
|
5438
|
+
(Math.log((speedDifficulty - excessSpeedDifficultyCutoff) / scale + 1) +
|
|
5382
5439
|
excessSpeedDifficultyCutoff / scale);
|
|
5383
5440
|
// 220 UR and less are considered tapped correctly to ensure that normal scores will be punished as little as possible
|
|
5384
5441
|
const t = 1 - osuBase.Interpolation.reverseLerp(this.speedDeviation, 22, 27);
|
|
5385
|
-
return (osuBase.Interpolation.lerp(
|
|
5442
|
+
return (osuBase.Interpolation.lerp(adjustedSpeedDifficulty, speedDifficulty, t) /
|
|
5443
|
+
speedDifficulty);
|
|
5386
5444
|
}
|
|
5387
5445
|
calculateEstimatedSliderBreaks(topWeightedSliderFactor) {
|
|
5388
5446
|
const nonMissMistakes = this.computedAccuracy.n100 + this.computedAccuracy.n50;
|
|
@@ -5769,7 +5827,7 @@ class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
|
5769
5827
|
if (!mods.has(osuBase.ModRelax)) {
|
|
5770
5828
|
skills.push(new OsuSpeed(mods));
|
|
5771
5829
|
}
|
|
5772
|
-
skills.push(new OsuReading(mods
|
|
5830
|
+
skills.push(new OsuReading(mods));
|
|
5773
5831
|
if (mods.has(osuBase.ModFlashlight)) {
|
|
5774
5832
|
skills.push(new OsuFlashlight(mods, beatmap.hitObjects.objects.length));
|
|
5775
5833
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rian8337/osu-rebalance-difficulty-calculator",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.99",
|
|
4
4
|
"description": "A module for calculating osu!standard beatmap difficulty and performance value with respect to the latest osu!lazer difficulty and performance algorithm.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"osu",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"url": "https://github.com/Rian8337/osu-droid-module/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@rian8337/osu-base": "4.0.0-beta.
|
|
36
|
+
"@rian8337/osu-base": "4.0.0-beta.98"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "8db713bd3e23b065f26d65f4d312e3d55c384a1c"
|
|
42
42
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -555,7 +555,7 @@ declare abstract class DifficultyCalculator<TBeatmap extends PlayableBeatmap, TH
|
|
|
555
555
|
* @param objects The `DifficultyHitObject`s which were processed.
|
|
556
556
|
* @returns The `DifficultyAttributes` object.
|
|
557
557
|
*/
|
|
558
|
-
protected abstract createDifficultyAttributes(beatmap: Beatmap, playableBeatmap:
|
|
558
|
+
protected abstract createDifficultyAttributes(beatmap: Beatmap, playableBeatmap: PlayableBeatmap, skills: Skill[], objects: THitObject[]): TAttributes;
|
|
559
559
|
/**
|
|
560
560
|
* Constructs a `PlayableBeatmap` from a `Beatmap` with specific `Mod`s.
|
|
561
561
|
*
|
|
@@ -851,7 +851,7 @@ declare class ExtendedDroidDifficultyAttributes extends DroidDifficultyAttribute
|
|
|
851
851
|
declare class DroidDifficultyCalculator extends DifficultyCalculator<DroidPlayableBeatmap, DroidDifficultyHitObject, ExtendedDroidDifficultyAttributes> {
|
|
852
852
|
constructor();
|
|
853
853
|
retainDifficultyAdjustmentMods(mods: Mod[]): Mod[];
|
|
854
|
-
protected createDifficultyAttributes(beatmap: Beatmap, playableBeatmap:
|
|
854
|
+
protected createDifficultyAttributes(beatmap: Beatmap, playableBeatmap: PlayableBeatmap, skills: Skill[], objects: DroidDifficultyHitObject[]): ExtendedDroidDifficultyAttributes;
|
|
855
855
|
protected createPlayableBeatmap(beatmap: Beatmap, mods?: ModMap): DroidPlayableBeatmap;
|
|
856
856
|
protected createDifficultyHitObjects(beatmap: DroidPlayableBeatmap): DroidDifficultyHitObject[];
|
|
857
857
|
protected createSkills(beatmap: DroidPlayableBeatmap): Skill[];
|
|
@@ -1176,6 +1176,16 @@ declare abstract class DroidSnapAimEvaluator {
|
|
|
1176
1176
|
* @param withSliders Whether to take slider difficulty into account.
|
|
1177
1177
|
*/
|
|
1178
1178
|
static evaluateDifficultyOf(current: DroidDifficultyHitObject, withSliders: boolean): number;
|
|
1179
|
+
private static calculateAcuteAngleBonus;
|
|
1180
|
+
private static calculateWideAngleBonus;
|
|
1181
|
+
private static calculateVelocityChangeBonus;
|
|
1182
|
+
/**
|
|
1183
|
+
* Difficulty bonus for "wiggle" patterns - jumps that are [radius, 3*diameter] in distance, with < 110 angle.
|
|
1184
|
+
* https://www.desmos.com/calculator/dp0v0nvowc
|
|
1185
|
+
*/
|
|
1186
|
+
private static calculateWiggleBonus;
|
|
1187
|
+
private static calculateSliderBonus;
|
|
1188
|
+
private static calculateCurrentVelocity;
|
|
1179
1189
|
private static calculateWideAngleAcuteness;
|
|
1180
1190
|
static calculateAcuteAngleAcuteness(angle: number): number;
|
|
1181
1191
|
private static highBpmBonus;
|
|
@@ -1199,7 +1209,7 @@ declare abstract class DroidTapEvaluator {
|
|
|
1199
1209
|
* @param considerCheesability Whether to consider cheesability.
|
|
1200
1210
|
*/
|
|
1201
1211
|
static evaluateDifficultyOf(current: DroidDifficultyHitObject, considerCheesability: boolean): number;
|
|
1202
|
-
private static
|
|
1212
|
+
private static calculateSpeedBonus;
|
|
1203
1213
|
}
|
|
1204
1214
|
|
|
1205
1215
|
/**
|
|
@@ -1370,6 +1380,16 @@ declare abstract class OsuSnapAimEvaluator {
|
|
|
1370
1380
|
* @param withSliders Whether to take slider difficulty into account.
|
|
1371
1381
|
*/
|
|
1372
1382
|
static evaluateDifficultyOf(current: OsuDifficultyHitObject, withSliders: boolean): number;
|
|
1383
|
+
private static calculateAcuteAngleBonus;
|
|
1384
|
+
private static calculateWideAngleBonus;
|
|
1385
|
+
private static calculateVelocityChangeBonus;
|
|
1386
|
+
/**
|
|
1387
|
+
* Difficulty bonus for "wiggle" patterns - jumps that are [radius, 3*diameter] in distance, with < 110 angle.
|
|
1388
|
+
* https://www.desmos.com/calculator/dp0v0nvowc
|
|
1389
|
+
*/
|
|
1390
|
+
private static calculateWiggleBonus;
|
|
1391
|
+
private static calculateSliderBonus;
|
|
1392
|
+
private static calculateCurrentVelocity;
|
|
1373
1393
|
private static calculateWideAngleAcuteness;
|
|
1374
1394
|
static calculateAcuteAngleAcuteness(angle: number): number;
|
|
1375
1395
|
private static highBpmBonus;
|
|
@@ -1390,7 +1410,7 @@ declare abstract class OsuSpeedEvaluator {
|
|
|
1390
1410
|
* @param current The current object.
|
|
1391
1411
|
*/
|
|
1392
1412
|
static evaluateDifficultyOf(current: OsuDifficultyHitObject): number;
|
|
1393
|
-
private static
|
|
1413
|
+
private static calculateSpeedBonus;
|
|
1394
1414
|
}
|
|
1395
1415
|
|
|
1396
1416
|
/**
|
|
@@ -1444,7 +1464,7 @@ declare class OsuDifficultyAttributes extends DifficultyAttributes implements IO
|
|
|
1444
1464
|
declare class OsuDifficultyCalculator extends DifficultyCalculator<OsuPlayableBeatmap, OsuDifficultyHitObject, OsuDifficultyAttributes> {
|
|
1445
1465
|
constructor();
|
|
1446
1466
|
retainDifficultyAdjustmentMods(mods: Mod[]): Mod[];
|
|
1447
|
-
protected createDifficultyAttributes(beatmap: Beatmap, playableBeatmap:
|
|
1467
|
+
protected createDifficultyAttributes(beatmap: Beatmap, playableBeatmap: PlayableBeatmap, skills: Skill[]): OsuDifficultyAttributes;
|
|
1448
1468
|
protected createPlayableBeatmap(beatmap: Beatmap, mods?: ModMap): OsuPlayableBeatmap;
|
|
1449
1469
|
protected createDifficultyHitObjects(beatmap: OsuPlayableBeatmap): OsuDifficultyHitObject[];
|
|
1450
1470
|
protected createSkills(beatmap: OsuPlayableBeatmap): Skill[];
|
|
@@ -1888,18 +1908,26 @@ declare abstract class HarmonicSkill extends Skill implements IHasPeakDifficulty
|
|
|
1888
1908
|
* Represents the skill required to read every object in the beatmap.
|
|
1889
1909
|
*/
|
|
1890
1910
|
declare class DroidReading extends HarmonicSkill {
|
|
1891
|
-
private readonly clockRate;
|
|
1892
|
-
private readonly hitObjects;
|
|
1893
1911
|
private currentDifficulty;
|
|
1912
|
+
private firstObjectStartTime;
|
|
1894
1913
|
private readonly skillMultiplier;
|
|
1895
1914
|
private readonly difficultyDecayBase;
|
|
1896
|
-
|
|
1915
|
+
/**
|
|
1916
|
+
* The duration for which the difficulty of objects is reduced, assuming the player has
|
|
1917
|
+
* memorized the beatmap.
|
|
1918
|
+
*/
|
|
1919
|
+
private readonly reducedDifficultyDuration;
|
|
1920
|
+
/**
|
|
1921
|
+
* The baseline multiplier applied to the difficulty of the first object.
|
|
1922
|
+
*
|
|
1923
|
+
* Assume that even with full memorization, skill is still required to read and play the
|
|
1924
|
+
* first objects.
|
|
1925
|
+
*/
|
|
1926
|
+
private readonly reducedDifficultyBaseline;
|
|
1897
1927
|
countTopWeightedObjectDifficulties(difficultyValue: number): number;
|
|
1898
1928
|
protected objectDifficultyOf(current: DroidDifficultyHitObject): number;
|
|
1899
|
-
protected applyDifficultyTransformation(difficulties: number[]): void;
|
|
1900
1929
|
protected saveToHitObject(current: DifficultyHitObject, difficulty: number): void;
|
|
1901
1930
|
private calculateAdjustedDifficulty;
|
|
1902
|
-
private calculateReducedNoteCount;
|
|
1903
1931
|
private difficultyDecay;
|
|
1904
1932
|
}
|
|
1905
1933
|
|
|
@@ -2043,18 +2071,26 @@ declare class OsuFlashlight extends OsuSkill {
|
|
|
2043
2071
|
* Represents the skill required to read every object in the beatmap.
|
|
2044
2072
|
*/
|
|
2045
2073
|
declare class OsuReading extends HarmonicSkill {
|
|
2046
|
-
private readonly clockRate;
|
|
2047
|
-
private readonly hitObjects;
|
|
2048
2074
|
private currentDifficulty;
|
|
2075
|
+
private firstObjectStartTime;
|
|
2049
2076
|
private readonly skillMultiplier;
|
|
2050
2077
|
private readonly difficultyDecayBase;
|
|
2051
|
-
|
|
2078
|
+
/**
|
|
2079
|
+
* The duration for which the difficulty of objects is reduced, assuming the player has
|
|
2080
|
+
* memorized the beatmap.
|
|
2081
|
+
*/
|
|
2082
|
+
private readonly reducedDifficultyDuration;
|
|
2083
|
+
/**
|
|
2084
|
+
* The baseline multiplier applied to the difficulty of the first object.
|
|
2085
|
+
*
|
|
2086
|
+
* Assume that even with full memorization, skill is still required to read and play the
|
|
2087
|
+
* first objects.
|
|
2088
|
+
*/
|
|
2089
|
+
private readonly reducedDifficultyBaseline;
|
|
2052
2090
|
countTopWeightedObjectDifficulties(difficultyValue: number): number;
|
|
2053
2091
|
protected objectDifficultyOf(current: OsuDifficultyHitObject): number;
|
|
2054
|
-
protected applyDifficultyTransformation(difficulties: number[]): void;
|
|
2055
2092
|
protected saveToHitObject(current: DifficultyHitObject, difficulty: number): void;
|
|
2056
2093
|
private calculateAdjustedDifficulty;
|
|
2057
|
-
private calculateReducedNoteCount;
|
|
2058
2094
|
private difficultyDecay;
|
|
2059
2095
|
}
|
|
2060
2096
|
|