@rian8337/osu-rebalance-difficulty-calculator 4.0.0-beta.49 → 4.0.0-beta.51
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 +366 -211
- package/package.json +3 -3
- package/typings/index.d.ts +71 -70
package/dist/index.js
CHANGED
|
@@ -2,33 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var osuBase = require('@rian8337/osu-base');
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* An evaluator for calculating aim skill.
|
|
7
|
-
*
|
|
8
|
-
* This class should be considered an "evaluating" class and not persisted.
|
|
9
|
-
*/
|
|
10
|
-
class AimEvaluator {
|
|
11
|
-
/**
|
|
12
|
-
* Calculates the bonus of wide angles.
|
|
13
|
-
*/
|
|
14
|
-
static calculateWideAngleBonus(angle) {
|
|
15
|
-
return Math.pow(Math.sin((3 / 4) *
|
|
16
|
-
(Math.min((5 / 6) * Math.PI, Math.max(Math.PI / 6, angle)) -
|
|
17
|
-
Math.PI / 6)), 2);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Calculates the bonus of acute angles.
|
|
21
|
-
*/
|
|
22
|
-
static calculateAcuteAngleBonus(angle) {
|
|
23
|
-
return 1 - this.calculateWideAngleBonus(angle);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
AimEvaluator.wideAngleMultiplier = 1.5;
|
|
27
|
-
AimEvaluator.acuteAngleMultiplier = 1.95;
|
|
28
|
-
AimEvaluator.sliderMultiplier = 1.35;
|
|
29
|
-
AimEvaluator.velocityChangeMultiplier = 0.75;
|
|
30
|
-
AimEvaluator.wiggleMultiplier = 1.02;
|
|
31
|
-
|
|
32
5
|
/**
|
|
33
6
|
* The base of a difficulty calculator.
|
|
34
7
|
*/
|
|
@@ -424,6 +397,36 @@ class DifficultyHitObject {
|
|
|
424
397
|
if (slider.lazyEndPosition) {
|
|
425
398
|
return;
|
|
426
399
|
}
|
|
400
|
+
let trackingEndTime = slider.endTime;
|
|
401
|
+
let { nestedHitObjects: nestedObjects } = slider;
|
|
402
|
+
if (this.mode === osuBase.Modes.osu) {
|
|
403
|
+
trackingEndTime = Math.max(slider.endTime - osuBase.Slider.legacyLastTickOffset, slider.startTime + slider.duration / 2);
|
|
404
|
+
let lastRealTick = null;
|
|
405
|
+
for (let i = nestedObjects.length - 2; i > 0; --i) {
|
|
406
|
+
const current = nestedObjects[i];
|
|
407
|
+
if (current instanceof osuBase.SliderTick) {
|
|
408
|
+
lastRealTick = current;
|
|
409
|
+
break;
|
|
410
|
+
}
|
|
411
|
+
if (current instanceof osuBase.SliderRepeat) {
|
|
412
|
+
// A repeat means the slider does not have a slider tick.
|
|
413
|
+
break;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
if (lastRealTick && lastRealTick.startTime > trackingEndTime) {
|
|
417
|
+
trackingEndTime = lastRealTick.startTime;
|
|
418
|
+
// When the last tick falls after the tracking end time, we need to re-sort the nested objects
|
|
419
|
+
// based on time. This creates a somewhat weird ordering which is counter to how a user would
|
|
420
|
+
// understand the slider, but allows a zero-diff with known diffcalc output.
|
|
421
|
+
//
|
|
422
|
+
// To reiterate, this is definitely not correct from a difficulty calculation perspective
|
|
423
|
+
// and should be revisited at a later date.
|
|
424
|
+
const reordered = nestedObjects.slice();
|
|
425
|
+
reordered.splice(reordered.indexOf(lastRealTick), 1);
|
|
426
|
+
reordered.push(lastRealTick);
|
|
427
|
+
nestedObjects = reordered;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
427
430
|
if (this.mode === osuBase.Modes.droid) {
|
|
428
431
|
// Temporary lazy end position until a real result can be derived.
|
|
429
432
|
slider.lazyEndPosition = slider.getStackedPosition(this.mode);
|
|
@@ -433,9 +436,7 @@ class DifficultyHitObject {
|
|
|
433
436
|
return;
|
|
434
437
|
}
|
|
435
438
|
}
|
|
436
|
-
|
|
437
|
-
slider.lazyTravelTime =
|
|
438
|
-
slider.nestedHitObjects.at(-1).startTime - slider.startTime;
|
|
439
|
+
slider.lazyTravelTime = trackingEndTime - slider.startTime;
|
|
439
440
|
let endTimeMin = slider.lazyTravelTime / slider.spanDuration;
|
|
440
441
|
if (endTimeMin % 2 >= 1) {
|
|
441
442
|
endTimeMin = 1 - (endTimeMin % 1);
|
|
@@ -449,15 +450,15 @@ class DifficultyHitObject {
|
|
|
449
450
|
.add(slider.path.positionAt(endTimeMin));
|
|
450
451
|
let currentCursorPosition = slider.getStackedPosition(this.mode);
|
|
451
452
|
const scalingFactor = DifficultyHitObject.normalizedRadius / slider.radius;
|
|
452
|
-
for (let i = 1; i <
|
|
453
|
-
const currentMovementObject =
|
|
453
|
+
for (let i = 1; i < nestedObjects.length; ++i) {
|
|
454
|
+
const currentMovementObject = nestedObjects[i];
|
|
454
455
|
let currentMovement = currentMovementObject
|
|
455
456
|
.getStackedPosition(this.mode)
|
|
456
457
|
.subtract(currentCursorPosition);
|
|
457
458
|
let currentMovementLength = scalingFactor * currentMovement.length;
|
|
458
459
|
// The amount of movement required so that the cursor position needs to be updated.
|
|
459
460
|
let requiredMovement = this.assumedSliderRadius;
|
|
460
|
-
if (i ===
|
|
461
|
+
if (i === nestedObjects.length - 1) {
|
|
461
462
|
// The end of a slider has special aim rules due to the relaxed time constraint on position.
|
|
462
463
|
// There is both a lazy end position as well as the actual end slider position. We assume the player takes the simpler movement.
|
|
463
464
|
// For sliders that are circular, the lazy end position may actually be farther away than the sliders' true end.
|
|
@@ -482,7 +483,7 @@ class DifficultyHitObject {
|
|
|
482
483
|
currentMovementLength;
|
|
483
484
|
slider.lazyTravelDistance += currentMovementLength;
|
|
484
485
|
}
|
|
485
|
-
if (i ===
|
|
486
|
+
if (i === nestedObjects.length - 1) {
|
|
486
487
|
slider.lazyEndPosition = currentCursorPosition;
|
|
487
488
|
}
|
|
488
489
|
}
|
|
@@ -705,7 +706,7 @@ class DroidDifficultyHitObject extends DifficultyHitObject {
|
|
|
705
706
|
/**
|
|
706
707
|
* An evaluator for calculating osu!droid Aim skill.
|
|
707
708
|
*/
|
|
708
|
-
class DroidAimEvaluator
|
|
709
|
+
class DroidAimEvaluator {
|
|
709
710
|
/**
|
|
710
711
|
* Evaluates the difficulty of aiming the current object, based on:
|
|
711
712
|
*
|
|
@@ -773,8 +774,7 @@ class DroidAimEvaluator extends AimEvaluator {
|
|
|
773
774
|
Math.max(current.strainTime, last.strainTime) <
|
|
774
775
|
1.25 * Math.min(current.strainTime, last.strainTime) &&
|
|
775
776
|
current.angle !== null &&
|
|
776
|
-
last.angle !== null
|
|
777
|
-
lastLast.angle !== null) {
|
|
777
|
+
last.angle !== null) {
|
|
778
778
|
const currentAngle = current.angle;
|
|
779
779
|
const lastAngle = last.angle;
|
|
780
780
|
// Rewarding angles, take the smaller velocity as base.
|
|
@@ -872,6 +872,7 @@ DroidAimEvaluator.wideAngleMultiplier = 1.5;
|
|
|
872
872
|
DroidAimEvaluator.acuteAngleMultiplier = 2.6;
|
|
873
873
|
DroidAimEvaluator.sliderMultiplier = 1.35;
|
|
874
874
|
DroidAimEvaluator.velocityChangeMultiplier = 0.75;
|
|
875
|
+
DroidAimEvaluator.wiggleMultiplier = 1.02;
|
|
875
876
|
DroidAimEvaluator.singleSpacingThreshold = DroidDifficultyHitObject.normalizedDiameter;
|
|
876
877
|
// 200 1/4 BPM delta time
|
|
877
878
|
DroidAimEvaluator.minSpeedBonus = 75;
|
|
@@ -1035,7 +1036,7 @@ class DroidAim extends DroidSkill {
|
|
|
1035
1036
|
if (this.sliderStrains.length === 0) {
|
|
1036
1037
|
return 0;
|
|
1037
1038
|
}
|
|
1038
|
-
const maxSliderStrain =
|
|
1039
|
+
const maxSliderStrain = osuBase.MathUtils.max(this.sliderStrains);
|
|
1039
1040
|
if (maxSliderStrain === 0) {
|
|
1040
1041
|
return 0;
|
|
1041
1042
|
}
|
|
@@ -1073,20 +1074,10 @@ class DroidAim extends DroidSkill {
|
|
|
1073
1074
|
}
|
|
1074
1075
|
}
|
|
1075
1076
|
|
|
1076
|
-
/**
|
|
1077
|
-
* An evaluator for calculating speed or tap skill.
|
|
1078
|
-
*
|
|
1079
|
-
* This class should be considered an "evaluating" class and not persisted.
|
|
1080
|
-
*/
|
|
1081
|
-
class SpeedEvaluator {
|
|
1082
|
-
}
|
|
1083
|
-
// ~200 1/4 BPM streams
|
|
1084
|
-
SpeedEvaluator.minSpeedBonus = 75;
|
|
1085
|
-
|
|
1086
1077
|
/**
|
|
1087
1078
|
* An evaluator for calculating osu!droid tap skill.
|
|
1088
1079
|
*/
|
|
1089
|
-
class DroidTapEvaluator
|
|
1080
|
+
class DroidTapEvaluator {
|
|
1090
1081
|
/**
|
|
1091
1082
|
* Evaluates the difficulty of tapping the current object, based on:
|
|
1092
1083
|
*
|
|
@@ -1121,6 +1112,8 @@ class DroidTapEvaluator extends SpeedEvaluator {
|
|
|
1121
1112
|
return (speedBonus * Math.pow(doubletapness, 1.5) * 1000) / strainTime;
|
|
1122
1113
|
}
|
|
1123
1114
|
}
|
|
1115
|
+
// ~200 1/4 BPM streams
|
|
1116
|
+
DroidTapEvaluator.minSpeedBonus = 75;
|
|
1124
1117
|
|
|
1125
1118
|
/**
|
|
1126
1119
|
* Represents the skill required to press keys or tap with regards to keeping up with the speed at which objects need to be hit.
|
|
@@ -1152,7 +1145,7 @@ class DroidTap extends DroidSkill {
|
|
|
1152
1145
|
if (this._objectStrains.length === 0) {
|
|
1153
1146
|
return 0;
|
|
1154
1147
|
}
|
|
1155
|
-
const maxStrain =
|
|
1148
|
+
const maxStrain = osuBase.MathUtils.max(this._objectStrains);
|
|
1156
1149
|
if (maxStrain === 0) {
|
|
1157
1150
|
return 0;
|
|
1158
1151
|
}
|
|
@@ -1165,7 +1158,7 @@ class DroidTap extends DroidSkill {
|
|
|
1165
1158
|
if (this._objectStrains.length === 0) {
|
|
1166
1159
|
return 0;
|
|
1167
1160
|
}
|
|
1168
|
-
const maxStrain =
|
|
1161
|
+
const maxStrain = osuBase.MathUtils.max(this._objectStrains);
|
|
1169
1162
|
if (maxStrain === 0) {
|
|
1170
1163
|
return 0;
|
|
1171
1164
|
}
|
|
@@ -1211,23 +1204,10 @@ class DroidTap extends DroidSkill {
|
|
|
1211
1204
|
}
|
|
1212
1205
|
}
|
|
1213
1206
|
|
|
1214
|
-
/**
|
|
1215
|
-
* An evaluator for calculating flashlight skill.
|
|
1216
|
-
*
|
|
1217
|
-
* This class should be considered an "evaluating" class and not persisted.
|
|
1218
|
-
*/
|
|
1219
|
-
class FlashlightEvaluator {
|
|
1220
|
-
}
|
|
1221
|
-
FlashlightEvaluator.maxOpacityBonus = 0.4;
|
|
1222
|
-
FlashlightEvaluator.hiddenBonus = 0.2;
|
|
1223
|
-
FlashlightEvaluator.minVelocity = 0.5;
|
|
1224
|
-
FlashlightEvaluator.sliderMultiplier = 1.3;
|
|
1225
|
-
FlashlightEvaluator.minAngleMultiplier = 0.2;
|
|
1226
|
-
|
|
1227
1207
|
/**
|
|
1228
1208
|
* An evaluator for calculating osu!droid Flashlight skill.
|
|
1229
1209
|
*/
|
|
1230
|
-
class DroidFlashlightEvaluator
|
|
1210
|
+
class DroidFlashlightEvaluator {
|
|
1231
1211
|
/**
|
|
1232
1212
|
* Evaluates the difficulty of memorizing and hitting the current object, based on:
|
|
1233
1213
|
*
|
|
@@ -1310,6 +1290,11 @@ class DroidFlashlightEvaluator extends FlashlightEvaluator {
|
|
|
1310
1290
|
return result;
|
|
1311
1291
|
}
|
|
1312
1292
|
}
|
|
1293
|
+
DroidFlashlightEvaluator.maxOpacityBonus = 0.4;
|
|
1294
|
+
DroidFlashlightEvaluator.hiddenBonus = 0.2;
|
|
1295
|
+
DroidFlashlightEvaluator.minVelocity = 0.5;
|
|
1296
|
+
DroidFlashlightEvaluator.sliderMultiplier = 1.3;
|
|
1297
|
+
DroidFlashlightEvaluator.minAngleMultiplier = 0.2;
|
|
1313
1298
|
|
|
1314
1299
|
/**
|
|
1315
1300
|
* Represents the skill required to memorize and hit every object in a beatmap with the Flashlight mod enabled.
|
|
@@ -1801,6 +1786,10 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1801
1786
|
* Calculates the aim star rating of the beatmap and stores it in this instance.
|
|
1802
1787
|
*/
|
|
1803
1788
|
calculateAim() {
|
|
1789
|
+
if (this.mods.some((m) => m instanceof osuBase.ModAutopilot)) {
|
|
1790
|
+
this.attributes.aimDifficulty = 0;
|
|
1791
|
+
return;
|
|
1792
|
+
}
|
|
1804
1793
|
const aimSkill = new DroidAim(this.mods, true);
|
|
1805
1794
|
const aimSkillWithoutSliders = new DroidAim(this.mods, false);
|
|
1806
1795
|
this.calculateSkills(aimSkill, aimSkillWithoutSliders);
|
|
@@ -1810,6 +1799,10 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1810
1799
|
* Calculates the tap star rating of the beatmap and stores it in this instance.
|
|
1811
1800
|
*/
|
|
1812
1801
|
calculateTap() {
|
|
1802
|
+
if (this.mods.some((m) => m instanceof osuBase.ModRelax)) {
|
|
1803
|
+
this.attributes.tapDifficulty = 0;
|
|
1804
|
+
return;
|
|
1805
|
+
}
|
|
1813
1806
|
const tapSkillCheese = new DroidTap(this.mods, true);
|
|
1814
1807
|
const tapSkillNoCheese = new DroidTap(this.mods, false);
|
|
1815
1808
|
this.calculateSkills(tapSkillCheese, tapSkillNoCheese);
|
|
@@ -1829,6 +1822,10 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1829
1822
|
* Calculates the flashlight star rating of the beatmap and stores it in this instance.
|
|
1830
1823
|
*/
|
|
1831
1824
|
calculateFlashlight() {
|
|
1825
|
+
if (!this.mods.some((m) => m instanceof osuBase.ModFlashlight)) {
|
|
1826
|
+
this.attributes.flashlightDifficulty = 0;
|
|
1827
|
+
return;
|
|
1828
|
+
}
|
|
1832
1829
|
const flashlightSkill = new DroidFlashlight(this.mods, true);
|
|
1833
1830
|
const flashlightSkillWithoutSliders = new DroidFlashlight(this.mods, false);
|
|
1834
1831
|
this.calculateSkills(flashlightSkill, flashlightSkillWithoutSliders);
|
|
@@ -1873,21 +1870,29 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1873
1870
|
calculateAll() {
|
|
1874
1871
|
const skills = this.createSkills();
|
|
1875
1872
|
this.calculateSkills(...skills);
|
|
1876
|
-
const aimSkill = skills
|
|
1877
|
-
const aimSkillWithoutSliders = skills
|
|
1878
|
-
const rhythmSkill = skills
|
|
1879
|
-
const tapSkillCheese = skills
|
|
1880
|
-
const flashlightSkill = skills
|
|
1881
|
-
const flashlightSkillWithoutSliders = skills
|
|
1882
|
-
const visualSkill = skills
|
|
1883
|
-
const visualSkillWithoutSliders = skills
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1873
|
+
const aimSkill = skills.find((s) => s instanceof DroidAim && s.withSliders);
|
|
1874
|
+
const aimSkillWithoutSliders = skills.find((s) => s instanceof DroidAim && !s.withSliders);
|
|
1875
|
+
const rhythmSkill = skills.find((s) => s instanceof DroidRhythm);
|
|
1876
|
+
const tapSkillCheese = skills.find((s) => s instanceof DroidTap && s.considerCheesability);
|
|
1877
|
+
const flashlightSkill = skills.find((s) => s instanceof DroidFlashlight && s.withSliders);
|
|
1878
|
+
const flashlightSkillWithoutSliders = skills.find((s) => s instanceof DroidFlashlight && !s.withSliders);
|
|
1879
|
+
const visualSkill = skills.find((s) => s instanceof DroidVisual && s.withSliders);
|
|
1880
|
+
const visualSkillWithoutSliders = skills.find((s) => s instanceof DroidVisual && !s.withSliders);
|
|
1881
|
+
if (aimSkill && aimSkillWithoutSliders) {
|
|
1882
|
+
this.postCalculateAim(aimSkill, aimSkillWithoutSliders);
|
|
1883
|
+
}
|
|
1884
|
+
if (tapSkillCheese) {
|
|
1885
|
+
const tapSkillVibro = new DroidTap(this.mods, true, tapSkillCheese.relevantDeltaTime());
|
|
1886
|
+
this.calculateSkills(tapSkillVibro);
|
|
1887
|
+
this.postCalculateTap(tapSkillCheese, tapSkillVibro);
|
|
1888
|
+
}
|
|
1888
1889
|
this.postCalculateRhythm(rhythmSkill);
|
|
1889
|
-
|
|
1890
|
-
|
|
1890
|
+
if (flashlightSkill && flashlightSkillWithoutSliders) {
|
|
1891
|
+
this.postCalculateFlashlight(flashlightSkill, flashlightSkillWithoutSliders);
|
|
1892
|
+
}
|
|
1893
|
+
if (visualSkill && visualSkillWithoutSliders) {
|
|
1894
|
+
this.postCalculateVisual(visualSkill, visualSkillWithoutSliders);
|
|
1895
|
+
}
|
|
1891
1896
|
this.calculateTotal();
|
|
1892
1897
|
}
|
|
1893
1898
|
toString() {
|
|
@@ -1916,20 +1921,24 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1916
1921
|
return difficultyObjects;
|
|
1917
1922
|
}
|
|
1918
1923
|
createSkills() {
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
new DroidAim(this.mods,
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
new DroidTap(this.mods,
|
|
1928
|
-
new
|
|
1929
|
-
new
|
|
1930
|
-
new DroidVisual(this.mods,
|
|
1931
|
-
|
|
1932
|
-
|
|
1924
|
+
const skills = [];
|
|
1925
|
+
if (!this.mods.some((m) => m instanceof osuBase.ModAutopilot)) {
|
|
1926
|
+
skills.push(new DroidAim(this.mods, true));
|
|
1927
|
+
skills.push(new DroidAim(this.mods, false));
|
|
1928
|
+
}
|
|
1929
|
+
if (!this.mods.some((m) => m instanceof osuBase.ModRelax)) {
|
|
1930
|
+
// Tap and visual skills depend on rhythm skill, so we put it first
|
|
1931
|
+
skills.push(new DroidRhythm(this.mods));
|
|
1932
|
+
skills.push(new DroidTap(this.mods, true));
|
|
1933
|
+
skills.push(new DroidTap(this.mods, false));
|
|
1934
|
+
skills.push(new DroidVisual(this.mods, true));
|
|
1935
|
+
skills.push(new DroidVisual(this.mods, false));
|
|
1936
|
+
}
|
|
1937
|
+
if (this.mods.some((m) => m instanceof osuBase.ModFlashlight)) {
|
|
1938
|
+
skills.push(new DroidFlashlight(this.mods, true));
|
|
1939
|
+
skills.push(new DroidFlashlight(this.mods, false));
|
|
1940
|
+
}
|
|
1941
|
+
return skills;
|
|
1933
1942
|
}
|
|
1934
1943
|
calculateClockRate(options) {
|
|
1935
1944
|
var _a, _b;
|
|
@@ -2256,15 +2265,15 @@ class PerformanceCalculator {
|
|
|
2256
2265
|
this.computedAccuracy.n100 * n100Multiplier +
|
|
2257
2266
|
this.computedAccuracy.n50 * n50Multiplier, this.totalHits);
|
|
2258
2267
|
}
|
|
2259
|
-
if (this.difficultyAttributes.
|
|
2260
|
-
//
|
|
2261
|
-
const
|
|
2262
|
-
const estimateSliderEndsDropped = osuBase.MathUtils.clamp(Math.min(this.totalImperfectHits, maxCombo - combo), 0, estimateDifficultSliders);
|
|
2268
|
+
if (this.difficultyAttributes.aimDifficultSliderCount > 0) {
|
|
2269
|
+
// Consider all missing combo to be dropped difficult sliders.
|
|
2270
|
+
const estimateImproperlyFollowedDifficultSliders = osuBase.MathUtils.clamp(Math.min(this.totalImperfectHits, maxCombo - combo), 0, this.difficultyAttributes.aimDifficultSliderCount);
|
|
2263
2271
|
this.sliderNerfFactor =
|
|
2264
2272
|
(1 - this.difficultyAttributes.sliderFactor) *
|
|
2265
2273
|
Math.pow(1 -
|
|
2266
|
-
|
|
2267
|
-
|
|
2274
|
+
estimateImproperlyFollowedDifficultSliders /
|
|
2275
|
+
this.difficultyAttributes
|
|
2276
|
+
.aimDifficultSliderCount, 3) +
|
|
2268
2277
|
this.difficultyAttributes.sliderFactor;
|
|
2269
2278
|
}
|
|
2270
2279
|
}
|
|
@@ -2487,7 +2496,7 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2487
2496
|
Math.pow(this.visual, 1.1), 1 / 1.1) * this.finalMultiplier);
|
|
2488
2497
|
}
|
|
2489
2498
|
handleOptions(options) {
|
|
2490
|
-
var _a, _b, _c, _d
|
|
2499
|
+
var _a, _b, _c, _d;
|
|
2491
2500
|
this._tapPenalty = (_a = options === null || options === void 0 ? void 0 : options.tapPenalty) !== null && _a !== void 0 ? _a : 1;
|
|
2492
2501
|
this._aimSliderCheesePenalty = (_b = options === null || options === void 0 ? void 0 : options.aimSliderCheesePenalty) !== null && _b !== void 0 ? _b : 1;
|
|
2493
2502
|
this._flashlightSliderCheesePenalty =
|
|
@@ -2495,18 +2504,6 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2495
2504
|
this._visualSliderCheesePenalty =
|
|
2496
2505
|
(_d = options === null || options === void 0 ? void 0 : options.visualSliderCheesePenalty) !== null && _d !== void 0 ? _d : 1;
|
|
2497
2506
|
super.handleOptions(options);
|
|
2498
|
-
const { maxCombo, aimDifficultSliderCount, sliderFactor } = this.difficultyAttributes;
|
|
2499
|
-
const combo = (_e = options === null || options === void 0 ? void 0 : options.combo) !== null && _e !== void 0 ? _e : maxCombo - this.computedAccuracy.nmiss;
|
|
2500
|
-
if (aimDifficultSliderCount > 0) {
|
|
2501
|
-
// Consider all missing combo to be dropped difficult sliders.
|
|
2502
|
-
const estimateImproperlyFollowedDifficultSliders = osuBase.MathUtils.clamp(Math.min(this.totalImperfectHits, maxCombo - combo), 0, aimDifficultSliderCount);
|
|
2503
|
-
this.sliderNerfFactor =
|
|
2504
|
-
(1 - sliderFactor) *
|
|
2505
|
-
Math.pow(1 -
|
|
2506
|
-
estimateImproperlyFollowedDifficultSliders /
|
|
2507
|
-
aimDifficultSliderCount, 3) +
|
|
2508
|
-
sliderFactor;
|
|
2509
|
-
}
|
|
2510
2507
|
}
|
|
2511
2508
|
/**
|
|
2512
2509
|
* Calculates the aim performance value of the beatmap.
|
|
@@ -2877,10 +2874,40 @@ class OsuSkill extends StrainSkill {
|
|
|
2877
2874
|
}
|
|
2878
2875
|
}
|
|
2879
2876
|
|
|
2877
|
+
/**
|
|
2878
|
+
* Represents an osu!standard hit object with difficulty calculation values.
|
|
2879
|
+
*/
|
|
2880
|
+
class OsuDifficultyHitObject extends DifficultyHitObject {
|
|
2881
|
+
constructor() {
|
|
2882
|
+
super(...arguments);
|
|
2883
|
+
/**
|
|
2884
|
+
* The speed strain generated by the hitobject.
|
|
2885
|
+
*/
|
|
2886
|
+
this.speedStrain = 0;
|
|
2887
|
+
/**
|
|
2888
|
+
* The flashlight strain generated by this hitobject.
|
|
2889
|
+
*/
|
|
2890
|
+
this.flashlightStrain = 0;
|
|
2891
|
+
this.radiusBuffThreshold = 30;
|
|
2892
|
+
this.mode = osuBase.Modes.osu;
|
|
2893
|
+
}
|
|
2894
|
+
get scalingFactor() {
|
|
2895
|
+
const radius = this.object.radius;
|
|
2896
|
+
// We will scale distances by this factor, so we can assume a uniform CircleSize among beatmaps.
|
|
2897
|
+
let scalingFactor = DifficultyHitObject.normalizedRadius / radius;
|
|
2898
|
+
// High circle size (small CS) bonus
|
|
2899
|
+
if (radius < this.radiusBuffThreshold) {
|
|
2900
|
+
scalingFactor *=
|
|
2901
|
+
1 + Math.min(this.radiusBuffThreshold - radius, 5) / 50;
|
|
2902
|
+
}
|
|
2903
|
+
return scalingFactor;
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
|
|
2880
2907
|
/**
|
|
2881
2908
|
* An evaluator for calculating osu!standard Aim skill.
|
|
2882
2909
|
*/
|
|
2883
|
-
class OsuAimEvaluator
|
|
2910
|
+
class OsuAimEvaluator {
|
|
2884
2911
|
/**
|
|
2885
2912
|
* Evaluates the difficulty of aiming the current object, based on:
|
|
2886
2913
|
*
|
|
@@ -2900,6 +2927,8 @@ class OsuAimEvaluator extends AimEvaluator {
|
|
|
2900
2927
|
return 0;
|
|
2901
2928
|
}
|
|
2902
2929
|
const lastLast = current.previous(1);
|
|
2930
|
+
const radius = OsuDifficultyHitObject.normalizedRadius;
|
|
2931
|
+
const diameter = OsuDifficultyHitObject.normalizedDiameter;
|
|
2903
2932
|
// Calculate the velocity to the current hitobject, which starts with a base distance / time assuming the last object is a hitcircle.
|
|
2904
2933
|
let currentVelocity = current.lazyJumpDistance / current.strainTime;
|
|
2905
2934
|
// But if the last object is a slider, then we extend the travel velocity through the slider into the current object.
|
|
@@ -2922,6 +2951,7 @@ class OsuAimEvaluator extends AimEvaluator {
|
|
|
2922
2951
|
let acuteAngleBonus = 0;
|
|
2923
2952
|
let sliderBonus = 0;
|
|
2924
2953
|
let velocityChangeBonus = 0;
|
|
2954
|
+
let wiggleBonus = 0;
|
|
2925
2955
|
// Start strain with regular velocity.
|
|
2926
2956
|
let strain = currentVelocity;
|
|
2927
2957
|
if (
|
|
@@ -2929,42 +2959,41 @@ class OsuAimEvaluator extends AimEvaluator {
|
|
|
2929
2959
|
Math.max(current.strainTime, last.strainTime) <
|
|
2930
2960
|
1.25 * Math.min(current.strainTime, last.strainTime) &&
|
|
2931
2961
|
current.angle !== null &&
|
|
2932
|
-
last.angle !== null
|
|
2933
|
-
|
|
2962
|
+
last.angle !== null) {
|
|
2963
|
+
const currentAngle = current.angle;
|
|
2964
|
+
const lastAngle = last.angle;
|
|
2934
2965
|
// Rewarding angles, take the smaller velocity as base.
|
|
2935
2966
|
const angleBonus = Math.min(currentVelocity, prevVelocity);
|
|
2936
2967
|
wideAngleBonus = this.calculateWideAngleBonus(current.angle);
|
|
2937
2968
|
acuteAngleBonus = this.calculateAcuteAngleBonus(current.angle);
|
|
2938
|
-
//
|
|
2939
|
-
if (current.strainTime > 100) {
|
|
2940
|
-
acuteAngleBonus = 0;
|
|
2941
|
-
}
|
|
2942
|
-
else {
|
|
2943
|
-
acuteAngleBonus *=
|
|
2944
|
-
// Multiply by previous angle, we don't want to buff unless this is a wiggle type pattern.
|
|
2945
|
-
this.calculateAcuteAngleBonus(last.angle) *
|
|
2946
|
-
// The maximum velocity we buff is equal to 125 / strainTime.
|
|
2947
|
-
Math.min(angleBonus, 125 / current.strainTime) *
|
|
2948
|
-
// Scale buff from 300 BPM 1/2 to 400 BPM 1/2.
|
|
2949
|
-
Math.pow(Math.sin((Math.PI / 2) *
|
|
2950
|
-
Math.min(1, (100 - current.strainTime) / 25)), 2) *
|
|
2951
|
-
// Buff distance exceeding 50 (radius) up to 100 (diameter).
|
|
2952
|
-
Math.pow(Math.sin(((Math.PI / 2) *
|
|
2953
|
-
(osuBase.MathUtils.clamp(current.lazyJumpDistance, 50, 100) -
|
|
2954
|
-
50)) /
|
|
2955
|
-
50), 2);
|
|
2956
|
-
}
|
|
2957
|
-
// Penalize wide angles if they're repeated, reducing the penalty as last.angle gets more acute.
|
|
2969
|
+
// Penalize angle repetition.
|
|
2958
2970
|
wideAngleBonus *=
|
|
2959
|
-
|
|
2960
|
-
(
|
|
2961
|
-
Math.min(wideAngleBonus, Math.pow(this.calculateWideAngleBonus(last.angle), 3)));
|
|
2962
|
-
// Penalize acute angles if they're repeated, reducing the penalty as lastLast.angle gets more obtuse.
|
|
2971
|
+
1 -
|
|
2972
|
+
Math.min(wideAngleBonus, Math.pow(this.calculateWideAngleBonus(lastAngle), 3));
|
|
2963
2973
|
acuteAngleBonus *=
|
|
2964
|
-
0.
|
|
2965
|
-
0.
|
|
2974
|
+
0.08 +
|
|
2975
|
+
0.92 *
|
|
2966
2976
|
(1 -
|
|
2967
|
-
Math.min(acuteAngleBonus, Math.pow(this.calculateAcuteAngleBonus(
|
|
2977
|
+
Math.min(acuteAngleBonus, Math.pow(this.calculateAcuteAngleBonus(lastAngle), 3)));
|
|
2978
|
+
// Apply full wide angle bonus for distance more than one diameter
|
|
2979
|
+
wideAngleBonus *=
|
|
2980
|
+
angleBonus *
|
|
2981
|
+
osuBase.MathUtils.smootherstep(current.lazyJumpDistance, 0, diameter);
|
|
2982
|
+
// Apply acute angle bonus for BPM above 300 1/2 and distance more than one diameter
|
|
2983
|
+
acuteAngleBonus *=
|
|
2984
|
+
angleBonus *
|
|
2985
|
+
osuBase.MathUtils.smootherstep(osuBase.MathUtils.millisecondsToBPM(current.strainTime, 2), 300, 400) *
|
|
2986
|
+
osuBase.MathUtils.smootherstep(current.lazyJumpDistance, diameter, diameter * 2);
|
|
2987
|
+
// Apply wiggle bonus for jumps that are [radius, 3*diameter] in distance, with < 110 angle
|
|
2988
|
+
// https://www.desmos.com/calculator/dp0v0nvowc
|
|
2989
|
+
wiggleBonus =
|
|
2990
|
+
angleBonus *
|
|
2991
|
+
osuBase.MathUtils.smootherstep(current.lazyJumpDistance, radius, diameter) *
|
|
2992
|
+
Math.pow(osuBase.MathUtils.reverseLerp(current.lazyJumpDistance, diameter * 3, diameter), 1.8) *
|
|
2993
|
+
osuBase.MathUtils.smootherstep(currentAngle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60)) *
|
|
2994
|
+
osuBase.MathUtils.smootherstep(last.lazyJumpDistance, radius, diameter) *
|
|
2995
|
+
Math.pow(osuBase.MathUtils.reverseLerp(last.lazyJumpDistance, diameter * 3, diameter), 1.8) *
|
|
2996
|
+
osuBase.MathUtils.smootherstep(lastAngle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60));
|
|
2968
2997
|
}
|
|
2969
2998
|
if (Math.max(prevVelocity, currentVelocity)) {
|
|
2970
2999
|
// We want to use the average velocity over the whole object when awarding differences, not the individual jump and slider path velocities.
|
|
@@ -2988,6 +3017,7 @@ class OsuAimEvaluator extends AimEvaluator {
|
|
|
2988
3017
|
// Reward sliders based on velocity.
|
|
2989
3018
|
sliderBonus = last.travelDistance / last.travelTime;
|
|
2990
3019
|
}
|
|
3020
|
+
strain += wiggleBonus * this.wiggleMultiplier;
|
|
2991
3021
|
// Add in acute angle bonus or wide angle bonus + velocity change bonus, whichever is larger.
|
|
2992
3022
|
strain += Math.max(acuteAngleBonus * this.acuteAngleMultiplier, wideAngleBonus * this.wideAngleMultiplier +
|
|
2993
3023
|
velocityChangeBonus * this.velocityChangeMultiplier);
|
|
@@ -2997,7 +3027,18 @@ class OsuAimEvaluator extends AimEvaluator {
|
|
|
2997
3027
|
}
|
|
2998
3028
|
return strain;
|
|
2999
3029
|
}
|
|
3030
|
+
static calculateWideAngleBonus(angle) {
|
|
3031
|
+
return osuBase.MathUtils.smoothstep(angle, osuBase.MathUtils.degreesToRadians(40), osuBase.MathUtils.degreesToRadians(140));
|
|
3032
|
+
}
|
|
3033
|
+
static calculateAcuteAngleBonus(angle) {
|
|
3034
|
+
return osuBase.MathUtils.smoothstep(angle, osuBase.MathUtils.degreesToRadians(140), osuBase.MathUtils.degreesToRadians(40));
|
|
3035
|
+
}
|
|
3000
3036
|
}
|
|
3037
|
+
OsuAimEvaluator.wideAngleMultiplier = 1.5;
|
|
3038
|
+
OsuAimEvaluator.acuteAngleMultiplier = 2.6;
|
|
3039
|
+
OsuAimEvaluator.sliderMultiplier = 1.35;
|
|
3040
|
+
OsuAimEvaluator.velocityChangeMultiplier = 0.75;
|
|
3041
|
+
OsuAimEvaluator.wiggleMultiplier = 1.02;
|
|
3001
3042
|
|
|
3002
3043
|
/**
|
|
3003
3044
|
* Represents the skill required to correctly aim at every object in the map with a uniform CircleSize and normalized distances.
|
|
@@ -3010,15 +3051,33 @@ class OsuAim extends OsuSkill {
|
|
|
3010
3051
|
this.reducedSectionBaseline = 0.75;
|
|
3011
3052
|
this.decayWeight = 0.9;
|
|
3012
3053
|
this.currentAimStrain = 0;
|
|
3013
|
-
this.skillMultiplier = 25.
|
|
3054
|
+
this.skillMultiplier = 25.6;
|
|
3055
|
+
this.sliderStrains = [];
|
|
3014
3056
|
this.withSliders = withSliders;
|
|
3015
3057
|
}
|
|
3058
|
+
/**
|
|
3059
|
+
* Obtains the amount of sliders that are considered difficult in terms of relative strain.
|
|
3060
|
+
*/
|
|
3061
|
+
countDifficultSliders() {
|
|
3062
|
+
if (this.sliderStrains.length === 0) {
|
|
3063
|
+
return 0;
|
|
3064
|
+
}
|
|
3065
|
+
const maxSliderStrain = osuBase.MathUtils.max(this.sliderStrains);
|
|
3066
|
+
if (maxSliderStrain === 0) {
|
|
3067
|
+
return 0;
|
|
3068
|
+
}
|
|
3069
|
+
return this.sliderStrains.reduce((total, strain) => total +
|
|
3070
|
+
1 / (1 + Math.exp(-((strain / maxSliderStrain) * 12 - 6))), 0);
|
|
3071
|
+
}
|
|
3016
3072
|
strainValueAt(current) {
|
|
3017
3073
|
this.currentAimStrain *= this.strainDecay(current.deltaTime);
|
|
3018
3074
|
this.currentAimStrain +=
|
|
3019
3075
|
OsuAimEvaluator.evaluateDifficultyOf(current, this.withSliders) *
|
|
3020
3076
|
this.skillMultiplier;
|
|
3021
3077
|
this._objectStrains.push(this.currentAimStrain);
|
|
3078
|
+
if (current.object instanceof osuBase.Slider) {
|
|
3079
|
+
this.sliderStrains.push(this.currentAimStrain);
|
|
3080
|
+
}
|
|
3022
3081
|
return this.currentAimStrain;
|
|
3023
3082
|
}
|
|
3024
3083
|
calculateInitialStrain(time, current) {
|
|
@@ -3042,7 +3101,7 @@ class OsuAim extends OsuSkill {
|
|
|
3042
3101
|
/**
|
|
3043
3102
|
* An evaluator for calculating osu!standard speed skill.
|
|
3044
3103
|
*/
|
|
3045
|
-
class OsuSpeedEvaluator
|
|
3104
|
+
class OsuSpeedEvaluator {
|
|
3046
3105
|
/**
|
|
3047
3106
|
* Evaluates the difficulty of tapping the current object, based on:
|
|
3048
3107
|
*
|
|
@@ -3093,7 +3152,9 @@ class OsuSpeedEvaluator extends SpeedEvaluator {
|
|
|
3093
3152
|
* About 1.25 circles distance between hitobject centers.
|
|
3094
3153
|
*/
|
|
3095
3154
|
OsuSpeedEvaluator.SINGLE_SPACING_THRESHOLD = 125;
|
|
3096
|
-
|
|
3155
|
+
// ~200 1/4 BPM streams
|
|
3156
|
+
OsuSpeedEvaluator.minSpeedBonus = 75;
|
|
3157
|
+
OsuSpeedEvaluator.DISTANCE_MULTIPLIER = 0.9;
|
|
3097
3158
|
|
|
3098
3159
|
/**
|
|
3099
3160
|
* An evaluator for calculating osu!standard Rhythm skill.
|
|
@@ -3195,7 +3256,7 @@ class OsuRhythmEvaluator {
|
|
|
3195
3256
|
}
|
|
3196
3257
|
// Repeated island (ex: triplet -> triplet).
|
|
3197
3258
|
// Graph: https://www.desmos.com/calculator/pj7an56zwf
|
|
3198
|
-
effectiveRatio *= Math.min(3 / islandCount, Math.pow(1 / islandCount,
|
|
3259
|
+
effectiveRatio *= Math.min(3 / islandCount, Math.pow(1 / islandCount, osuBase.MathUtils.offsetLogistic(island.delta, 58.33, 0.24, 2.75)));
|
|
3199
3260
|
break;
|
|
3200
3261
|
}
|
|
3201
3262
|
if (!islandFound) {
|
|
@@ -3255,7 +3316,7 @@ class OsuSpeed extends OsuSkill {
|
|
|
3255
3316
|
this.decayWeight = 0.9;
|
|
3256
3317
|
this.currentSpeedStrain = 0;
|
|
3257
3318
|
this.currentRhythm = 0;
|
|
3258
|
-
this.skillMultiplier = 1.
|
|
3319
|
+
this.skillMultiplier = 1.46;
|
|
3259
3320
|
}
|
|
3260
3321
|
/**
|
|
3261
3322
|
* @param current The hitobject to calculate.
|
|
@@ -3288,7 +3349,7 @@ class OsuSpeed extends OsuSkill {
|
|
|
3288
3349
|
/**
|
|
3289
3350
|
* An evaluator for calculating osu!standard Flashlight skill.
|
|
3290
3351
|
*/
|
|
3291
|
-
class OsuFlashlightEvaluator
|
|
3352
|
+
class OsuFlashlightEvaluator {
|
|
3292
3353
|
/**
|
|
3293
3354
|
* Evaluates the difficulty of memorizing and hitting the current object, based on:
|
|
3294
3355
|
*
|
|
@@ -3313,11 +3374,11 @@ class OsuFlashlightEvaluator extends FlashlightEvaluator {
|
|
|
3313
3374
|
let angleRepeatCount = 0;
|
|
3314
3375
|
for (let i = 0; i < Math.min(current.index, 10); ++i) {
|
|
3315
3376
|
const currentObject = current.previous(i);
|
|
3377
|
+
cumulativeStrainTime += last.strainTime;
|
|
3316
3378
|
if (!(currentObject.object instanceof osuBase.Spinner)) {
|
|
3317
3379
|
const jumpDistance = current.object
|
|
3318
3380
|
.getStackedPosition(osuBase.Modes.osu)
|
|
3319
3381
|
.subtract(currentObject.object.getStackedEndPosition(osuBase.Modes.osu)).length;
|
|
3320
|
-
cumulativeStrainTime += last.strainTime;
|
|
3321
3382
|
// We want to nerf objects that can be easily seen within the Flashlight circle radius.
|
|
3322
3383
|
if (i === 0) {
|
|
3323
3384
|
smallDistNerf = Math.min(1, jumpDistance / 75);
|
|
@@ -3366,6 +3427,11 @@ class OsuFlashlightEvaluator extends FlashlightEvaluator {
|
|
|
3366
3427
|
return result;
|
|
3367
3428
|
}
|
|
3368
3429
|
}
|
|
3430
|
+
OsuFlashlightEvaluator.maxOpacityBonus = 0.4;
|
|
3431
|
+
OsuFlashlightEvaluator.hiddenBonus = 0.2;
|
|
3432
|
+
OsuFlashlightEvaluator.minVelocity = 0.5;
|
|
3433
|
+
OsuFlashlightEvaluator.sliderMultiplier = 1.3;
|
|
3434
|
+
OsuFlashlightEvaluator.minAngleMultiplier = 0.2;
|
|
3369
3435
|
|
|
3370
3436
|
/**
|
|
3371
3437
|
* Represents the skill required to memorize and hit every object in a beatmap with the Flashlight mod enabled.
|
|
@@ -3400,36 +3466,6 @@ class OsuFlashlight extends OsuSkill {
|
|
|
3400
3466
|
}
|
|
3401
3467
|
}
|
|
3402
3468
|
|
|
3403
|
-
/**
|
|
3404
|
-
* Represents an osu!standard hit object with difficulty calculation values.
|
|
3405
|
-
*/
|
|
3406
|
-
class OsuDifficultyHitObject extends DifficultyHitObject {
|
|
3407
|
-
constructor() {
|
|
3408
|
-
super(...arguments);
|
|
3409
|
-
/**
|
|
3410
|
-
* The speed strain generated by the hitobject.
|
|
3411
|
-
*/
|
|
3412
|
-
this.speedStrain = 0;
|
|
3413
|
-
/**
|
|
3414
|
-
* The flashlight strain generated by this hitobject.
|
|
3415
|
-
*/
|
|
3416
|
-
this.flashlightStrain = 0;
|
|
3417
|
-
this.radiusBuffThreshold = 30;
|
|
3418
|
-
this.mode = osuBase.Modes.osu;
|
|
3419
|
-
}
|
|
3420
|
-
get scalingFactor() {
|
|
3421
|
-
const radius = this.object.radius;
|
|
3422
|
-
// We will scale distances by this factor, so we can assume a uniform CircleSize among beatmaps.
|
|
3423
|
-
let scalingFactor = DifficultyHitObject.normalizedRadius / radius;
|
|
3424
|
-
// High circle size (small CS) bonus
|
|
3425
|
-
if (radius < this.radiusBuffThreshold) {
|
|
3426
|
-
scalingFactor *=
|
|
3427
|
-
1 + Math.min(this.radiusBuffThreshold - radius, 5) / 50;
|
|
3428
|
-
}
|
|
3429
|
-
return scalingFactor;
|
|
3430
|
-
}
|
|
3431
|
-
}
|
|
3432
|
-
|
|
3433
3469
|
/**
|
|
3434
3470
|
* A difficulty calculator for osu!standard gamemode.
|
|
3435
3471
|
*/
|
|
@@ -3451,6 +3487,7 @@ class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
|
3451
3487
|
hitCircleCount: 0,
|
|
3452
3488
|
sliderCount: 0,
|
|
3453
3489
|
spinnerCount: 0,
|
|
3490
|
+
aimDifficultSliderCount: 0,
|
|
3454
3491
|
aimDifficultStrainCount: 0,
|
|
3455
3492
|
speedDifficultStrainCount: 0,
|
|
3456
3493
|
};
|
|
@@ -3482,6 +3519,10 @@ class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
|
3482
3519
|
* Calculates the aim star rating of the beatmap and stores it in this instance.
|
|
3483
3520
|
*/
|
|
3484
3521
|
calculateAim() {
|
|
3522
|
+
if (this.mods.some((m) => m instanceof osuBase.ModAutopilot)) {
|
|
3523
|
+
this.attributes.aimDifficulty = 0;
|
|
3524
|
+
return;
|
|
3525
|
+
}
|
|
3485
3526
|
const aimSkill = new OsuAim(this.mods, true);
|
|
3486
3527
|
const aimSkillWithoutSliders = new OsuAim(this.mods, false);
|
|
3487
3528
|
this.calculateSkills(aimSkill, aimSkillWithoutSliders);
|
|
@@ -3503,6 +3544,10 @@ class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
|
3503
3544
|
* Calculates the flashlight star rating of the beatmap and stores it in this instance.
|
|
3504
3545
|
*/
|
|
3505
3546
|
calculateFlashlight() {
|
|
3547
|
+
if (!this.mods.some((m) => m instanceof osuBase.ModFlashlight)) {
|
|
3548
|
+
this.attributes.flashlightDifficulty = 0;
|
|
3549
|
+
return;
|
|
3550
|
+
}
|
|
3506
3551
|
const flashlightSkill = new OsuFlashlight(this.mods);
|
|
3507
3552
|
this.calculateSkills(flashlightSkill);
|
|
3508
3553
|
this.postCalculateFlashlight(flashlightSkill);
|
|
@@ -3532,21 +3577,20 @@ class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
|
3532
3577
|
}
|
|
3533
3578
|
calculateAll() {
|
|
3534
3579
|
const skills = this.createSkills();
|
|
3535
|
-
const isRelax = this.mods.some((m) => m instanceof osuBase.ModRelax);
|
|
3536
3580
|
this.calculateSkills(...skills);
|
|
3537
|
-
const aimSkill = skills
|
|
3538
|
-
const aimSkillWithoutSliders = skills
|
|
3539
|
-
const speedSkill = skills
|
|
3540
|
-
const flashlightSkill = skills
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
else {
|
|
3581
|
+
const aimSkill = skills.find((s) => s instanceof OsuAim && s.withSliders);
|
|
3582
|
+
const aimSkillWithoutSliders = skills.find((s) => s instanceof OsuAim && !s.withSliders);
|
|
3583
|
+
const speedSkill = skills.find((s) => s instanceof OsuSpeed);
|
|
3584
|
+
const flashlightSkill = skills.find((s) => s instanceof OsuFlashlight);
|
|
3585
|
+
if (aimSkill && aimSkillWithoutSliders) {
|
|
3586
|
+
this.postCalculateAim(aimSkill, aimSkillWithoutSliders);
|
|
3587
|
+
}
|
|
3588
|
+
if (speedSkill) {
|
|
3546
3589
|
this.postCalculateSpeed(speedSkill);
|
|
3547
3590
|
}
|
|
3548
|
-
|
|
3549
|
-
|
|
3591
|
+
if (flashlightSkill) {
|
|
3592
|
+
this.postCalculateFlashlight(flashlightSkill);
|
|
3593
|
+
}
|
|
3550
3594
|
this.calculateTotal();
|
|
3551
3595
|
}
|
|
3552
3596
|
toString() {
|
|
@@ -3571,12 +3615,18 @@ class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
|
3571
3615
|
return difficultyObjects;
|
|
3572
3616
|
}
|
|
3573
3617
|
createSkills() {
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
new OsuAim(this.mods,
|
|
3577
|
-
new
|
|
3578
|
-
|
|
3579
|
-
|
|
3618
|
+
const skills = [];
|
|
3619
|
+
if (!this.mods.some((m) => m instanceof osuBase.ModAutopilot)) {
|
|
3620
|
+
skills.push(new OsuAim(this.mods, true));
|
|
3621
|
+
skills.push(new OsuAim(this.mods, false));
|
|
3622
|
+
}
|
|
3623
|
+
if (!this.mods.some((m) => m instanceof osuBase.ModRelax)) {
|
|
3624
|
+
skills.push(new OsuSpeed(this.mods));
|
|
3625
|
+
}
|
|
3626
|
+
if (this.mods.some((m) => m instanceof osuBase.ModFlashlight)) {
|
|
3627
|
+
skills.push(new OsuFlashlight(this.mods));
|
|
3628
|
+
}
|
|
3629
|
+
return skills;
|
|
3580
3630
|
}
|
|
3581
3631
|
populateDifficultyAttributes(beatmap, clockRate) {
|
|
3582
3632
|
super.populateDifficultyAttributes(beatmap, clockRate);
|
|
@@ -3609,6 +3659,8 @@ class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
|
3609
3659
|
}
|
|
3610
3660
|
this.attributes.aimDifficultStrainCount =
|
|
3611
3661
|
aimSkill.countDifficultStrains();
|
|
3662
|
+
this.attributes.aimDifficultSliderCount =
|
|
3663
|
+
aimSkill.countDifficultSliders();
|
|
3612
3664
|
}
|
|
3613
3665
|
/**
|
|
3614
3666
|
* Called after speed skill calculation.
|
|
@@ -3617,19 +3669,16 @@ class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
|
3617
3669
|
*/
|
|
3618
3670
|
postCalculateSpeed(speedSkill) {
|
|
3619
3671
|
this.strainPeaks.speed = speedSkill.strainPeaks;
|
|
3620
|
-
this.attributes.speedDifficulty = this.
|
|
3672
|
+
this.attributes.speedDifficulty = this.mods.some((m) => m instanceof osuBase.ModRelax)
|
|
3673
|
+
? 0
|
|
3674
|
+
: this.starValue(speedSkill.difficultyValue());
|
|
3621
3675
|
if (this.mods.some((m) => m instanceof osuBase.ModAutopilot)) {
|
|
3622
3676
|
this.attributes.speedDifficulty *= 0.5;
|
|
3623
3677
|
}
|
|
3624
3678
|
this.attributes.speedDifficultStrainCount =
|
|
3625
3679
|
speedSkill.countDifficultStrains();
|
|
3626
|
-
}
|
|
3627
|
-
/**
|
|
3628
|
-
* Calculates speed-related attributes.
|
|
3629
|
-
*/
|
|
3630
|
-
calculateSpeedAttributes() {
|
|
3631
3680
|
const objectStrains = this.objects.map((v) => v.speedStrain);
|
|
3632
|
-
const maxStrain =
|
|
3681
|
+
const maxStrain = osuBase.MathUtils.max(objectStrains);
|
|
3633
3682
|
if (maxStrain) {
|
|
3634
3683
|
this.attributes.speedNoteCount = objectStrains.reduce((total, next) => total + 1 / (1 + Math.exp(-((next / maxStrain) * 12 - 6))), 0);
|
|
3635
3684
|
}
|
|
@@ -3679,8 +3728,10 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
3679
3728
|
this.finalMultiplier = 1.15;
|
|
3680
3729
|
this.mode = osuBase.Modes.osu;
|
|
3681
3730
|
this.comboPenalty = 1;
|
|
3731
|
+
this.speedDeviation = 0;
|
|
3682
3732
|
}
|
|
3683
3733
|
calculateValues() {
|
|
3734
|
+
this.speedDeviation = this.calculateSpeedDeviation();
|
|
3684
3735
|
this.aim = this.calculateAimValue();
|
|
3685
3736
|
this.speed = this.calculateSpeedValue();
|
|
3686
3737
|
this.accuracy = this.calculateAccuracyValue();
|
|
@@ -3753,7 +3804,8 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
3753
3804
|
* Calculates the speed performance value of the beatmap.
|
|
3754
3805
|
*/
|
|
3755
3806
|
calculateSpeedValue() {
|
|
3756
|
-
if (this.mods.some((m) => m instanceof osuBase.ModRelax)
|
|
3807
|
+
if (this.mods.some((m) => m instanceof osuBase.ModRelax) ||
|
|
3808
|
+
this.speedDeviation === Number.POSITIVE_INFINITY) {
|
|
3757
3809
|
return 0;
|
|
3758
3810
|
}
|
|
3759
3811
|
let speedValue = this.baseValue(this.difficultyAttributes.speedDifficulty);
|
|
@@ -3788,16 +3840,15 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
3788
3840
|
}
|
|
3789
3841
|
: // Set accuracy to 0.
|
|
3790
3842
|
{ n300: 0, nobjects: 1 });
|
|
3843
|
+
speedValue *= this.calculateSpeedHighDeviationNerf();
|
|
3791
3844
|
// Scale the speed value with accuracy and OD.
|
|
3792
3845
|
speedValue *=
|
|
3793
3846
|
(0.95 +
|
|
3794
|
-
Math.pow(this.difficultyAttributes.overallDifficulty, 2) /
|
|
3847
|
+
Math.pow(Math.max(0, this.difficultyAttributes.overallDifficulty), 2) /
|
|
3795
3848
|
750) *
|
|
3796
3849
|
Math.pow((this.computedAccuracy.value() +
|
|
3797
3850
|
relevantAccuracy.value(this.difficultyAttributes.speedNoteCount)) /
|
|
3798
3851
|
2, (14.5 - this.difficultyAttributes.overallDifficulty) / 2);
|
|
3799
|
-
// Scale the speed value with # of 50s to punish doubletapping.
|
|
3800
|
-
speedValue *= Math.pow(0.99, Math.max(0, this.computedAccuracy.n50 - this.totalHits / 500));
|
|
3801
3852
|
return speedValue;
|
|
3802
3853
|
}
|
|
3803
3854
|
/**
|
|
@@ -3861,6 +3912,113 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
3861
3912
|
flashlightValue *= 0.98 + odScaling;
|
|
3862
3913
|
return flashlightValue;
|
|
3863
3914
|
}
|
|
3915
|
+
/**
|
|
3916
|
+
* Estimates a player's deviation on speed notes using {@link calculateDeviation}, assuming worst-case.
|
|
3917
|
+
*
|
|
3918
|
+
* Treats all speed notes as hit circles.
|
|
3919
|
+
*/
|
|
3920
|
+
calculateSpeedDeviation() {
|
|
3921
|
+
if (this.totalSuccessfulHits === 0) {
|
|
3922
|
+
return Number.POSITIVE_INFINITY;
|
|
3923
|
+
}
|
|
3924
|
+
// Calculate accuracy assuming the worst case scenario
|
|
3925
|
+
const speedNoteCount = this.difficultyAttributes.speedNoteCount +
|
|
3926
|
+
(this.totalHits - this.difficultyAttributes.speedNoteCount) * 0.1;
|
|
3927
|
+
// Assume worst case: all mistakes were on speed notes
|
|
3928
|
+
const relevantCountMiss = Math.min(this.computedAccuracy.nmiss, speedNoteCount);
|
|
3929
|
+
const relevantCountMeh = Math.min(this.computedAccuracy.n50, speedNoteCount - relevantCountMiss);
|
|
3930
|
+
const relevantCountOk = Math.min(this.computedAccuracy.n100, speedNoteCount - relevantCountMiss - relevantCountMeh);
|
|
3931
|
+
const relevantCountGreat = Math.max(0, speedNoteCount -
|
|
3932
|
+
relevantCountMiss -
|
|
3933
|
+
relevantCountMeh -
|
|
3934
|
+
relevantCountOk);
|
|
3935
|
+
return this.calculateDeviation(relevantCountGreat, relevantCountOk, relevantCountMeh, relevantCountMiss);
|
|
3936
|
+
}
|
|
3937
|
+
/**
|
|
3938
|
+
* Estimates the player's tap deviation based on the OD, given number of greats, oks, mehs and misses,
|
|
3939
|
+
* assuming the player's mean hit error is 0. The estimation is consistent in that two SS scores on the
|
|
3940
|
+
* same map with the same settings will always return the same deviation.
|
|
3941
|
+
*
|
|
3942
|
+
* Misses are ignored because they are usually due to misaiming.
|
|
3943
|
+
*
|
|
3944
|
+
* Greats and oks are assumed to follow a normal distribution, whereas mehs are assumed to follow a uniform distribution.
|
|
3945
|
+
*/
|
|
3946
|
+
calculateDeviation(relevantCountGreat, relevantCountOk, relevantCountMeh, relevantCountMiss) {
|
|
3947
|
+
if (relevantCountGreat + relevantCountOk + relevantCountMeh <= 0) {
|
|
3948
|
+
return Number.POSITIVE_INFINITY;
|
|
3949
|
+
}
|
|
3950
|
+
const objectCount = relevantCountGreat +
|
|
3951
|
+
relevantCountOk +
|
|
3952
|
+
relevantCountMeh +
|
|
3953
|
+
relevantCountMiss;
|
|
3954
|
+
// Obtain the great, ok, and meh windows.
|
|
3955
|
+
const hitWindow = new osuBase.OsuHitWindow(osuBase.OsuHitWindow.greatWindowToOD(
|
|
3956
|
+
// Convert current OD to non clock rate-adjusted OD.
|
|
3957
|
+
new osuBase.OsuHitWindow(this.difficultyAttributes.overallDifficulty)
|
|
3958
|
+
.greatWindow * this.difficultyAttributes.clockRate));
|
|
3959
|
+
const { greatWindow, okWindow, mehWindow } = hitWindow;
|
|
3960
|
+
// The probability that a player hits a circle is unknown, but we can estimate it to be
|
|
3961
|
+
// the number of greats on circles divided by the number of circles, and then add one
|
|
3962
|
+
// to the number of circles as a bias correction.
|
|
3963
|
+
const n = Math.max(1, objectCount - relevantCountMiss - relevantCountMeh);
|
|
3964
|
+
// 99% critical value for the normal distribution (one-tailed).
|
|
3965
|
+
const z = 2.32634787404;
|
|
3966
|
+
// Proportion of greats hit on circles, ignoring misses and 50s.
|
|
3967
|
+
const p = relevantCountGreat / n;
|
|
3968
|
+
// We can be 99% confident that p is at least this value.
|
|
3969
|
+
const pLowerBound = (n * p + (z * z) / 2) / (n + z * z) -
|
|
3970
|
+
(z / (n + z * z)) * Math.sqrt(n * p * (1 - p) + (z * z) / 4);
|
|
3971
|
+
// Compute the deviation assuming greats and oks are normally distributed, and mehs are uniformly distributed.
|
|
3972
|
+
// Begin with greats and oks first. Ignoring mehs, we can be 99% confident that the deviation is not higher than:
|
|
3973
|
+
let deviation = greatWindow / (Math.SQRT2 * osuBase.ErrorFunction.erfInv(pLowerBound));
|
|
3974
|
+
const randomValue = (Math.sqrt(2 / Math.PI) *
|
|
3975
|
+
okWindow *
|
|
3976
|
+
Math.pow(Math.exp(-0.5 * (okWindow / deviation)), 2)) /
|
|
3977
|
+
(deviation *
|
|
3978
|
+
osuBase.ErrorFunction.erf(okWindow / (Math.SQRT2 * deviation)));
|
|
3979
|
+
deviation *= Math.sqrt(1 - randomValue);
|
|
3980
|
+
// Value deviation approach as greatCount approaches 0
|
|
3981
|
+
const limitValue = okWindow / Math.sqrt(3);
|
|
3982
|
+
// If precision is not enough to compute true deviation - use limit value
|
|
3983
|
+
if (pLowerBound == 0.0 || randomValue >= 1 || deviation > limitValue) {
|
|
3984
|
+
deviation = limitValue;
|
|
3985
|
+
}
|
|
3986
|
+
// Then compute the variance for mehs.
|
|
3987
|
+
const mehVariance = (Math.pow(mehWindow, 2) +
|
|
3988
|
+
okWindow * mehWindow +
|
|
3989
|
+
Math.pow(okWindow, 2)) /
|
|
3990
|
+
3;
|
|
3991
|
+
// Find the total deviation.
|
|
3992
|
+
deviation = Math.sqrt(((relevantCountGreat + relevantCountOk) * Math.pow(deviation, 2) +
|
|
3993
|
+
relevantCountMeh * mehVariance) /
|
|
3994
|
+
(relevantCountGreat + relevantCountOk + relevantCountMeh));
|
|
3995
|
+
return deviation;
|
|
3996
|
+
}
|
|
3997
|
+
/**
|
|
3998
|
+
* Calculates multiplier for speed to account for improper tapping based on the deviation and speed difficulty.
|
|
3999
|
+
*
|
|
4000
|
+
* [Graph](https://www.desmos.com/calculator/dmogdhzofn)
|
|
4001
|
+
*/
|
|
4002
|
+
calculateSpeedHighDeviationNerf() {
|
|
4003
|
+
if (this.speedDeviation == Number.POSITIVE_INFINITY) {
|
|
4004
|
+
return 0;
|
|
4005
|
+
}
|
|
4006
|
+
const speedValue = this.baseValue(this.difficultyAttributes.speedDifficulty);
|
|
4007
|
+
// Decide a point where the PP value achieved compared to the speed deviation is assumed to be tapped
|
|
4008
|
+
// improperly. Any PP above this point is considered "excess" speed difficulty. This is used to cause
|
|
4009
|
+
// PP above the cutoff to scale logarithmically towards the original speed value thus nerfing the value.
|
|
4010
|
+
const excessSpeedDifficultyCutoff = 100 + 220 * Math.pow(22 / this.speedDeviation, 6.5);
|
|
4011
|
+
if (speedValue <= excessSpeedDifficultyCutoff) {
|
|
4012
|
+
return 1;
|
|
4013
|
+
}
|
|
4014
|
+
const scale = 50;
|
|
4015
|
+
const adjustedSpeedValue = scale *
|
|
4016
|
+
(Math.log((speedValue - excessSpeedDifficultyCutoff) / scale + 1) +
|
|
4017
|
+
excessSpeedDifficultyCutoff / scale);
|
|
4018
|
+
// 220 UR and less are considered tapped correctly to ensure that normal scores will be punished as little as possible
|
|
4019
|
+
const t = 1 - osuBase.Interpolation.reverseLerp(this.speedDeviation, 22, 27);
|
|
4020
|
+
return (osuBase.Interpolation.lerp(adjustedSpeedValue, speedValue, t) / speedValue);
|
|
4021
|
+
}
|
|
3864
4022
|
toString() {
|
|
3865
4023
|
return (this.total.toFixed(2) +
|
|
3866
4024
|
" pp (" +
|
|
@@ -3875,7 +4033,6 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
3875
4033
|
}
|
|
3876
4034
|
}
|
|
3877
4035
|
|
|
3878
|
-
exports.AimEvaluator = AimEvaluator;
|
|
3879
4036
|
exports.DifficultyCalculator = DifficultyCalculator;
|
|
3880
4037
|
exports.DifficultyHitObject = DifficultyHitObject;
|
|
3881
4038
|
exports.DroidAim = DroidAim;
|
|
@@ -3891,7 +4048,6 @@ exports.DroidTap = DroidTap;
|
|
|
3891
4048
|
exports.DroidTapEvaluator = DroidTapEvaluator;
|
|
3892
4049
|
exports.DroidVisual = DroidVisual;
|
|
3893
4050
|
exports.DroidVisualEvaluator = DroidVisualEvaluator;
|
|
3894
|
-
exports.FlashlightEvaluator = FlashlightEvaluator;
|
|
3895
4051
|
exports.OsuAim = OsuAim;
|
|
3896
4052
|
exports.OsuAimEvaluator = OsuAimEvaluator;
|
|
3897
4053
|
exports.OsuDifficultyCalculator = OsuDifficultyCalculator;
|
|
@@ -3903,5 +4059,4 @@ exports.OsuRhythmEvaluator = OsuRhythmEvaluator;
|
|
|
3903
4059
|
exports.OsuSpeed = OsuSpeed;
|
|
3904
4060
|
exports.OsuSpeedEvaluator = OsuSpeedEvaluator;
|
|
3905
4061
|
exports.PerformanceCalculator = PerformanceCalculator;
|
|
3906
|
-
exports.SpeedEvaluator = SpeedEvaluator;
|
|
3907
4062
|
//# sourceMappingURL=index.js.map
|
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.51",
|
|
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.51"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "6527e0c37f4d439e68fbecffa453fe1ff79a96f6"
|
|
42
42
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -1,26 +1,5 @@
|
|
|
1
1
|
import { Mod, PlaceableHitObject, Modes, Beatmap, Accuracy } from '@rian8337/osu-base';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* An evaluator for calculating aim skill.
|
|
5
|
-
*
|
|
6
|
-
* This class should be considered an "evaluating" class and not persisted.
|
|
7
|
-
*/
|
|
8
|
-
declare abstract class AimEvaluator {
|
|
9
|
-
protected static readonly wideAngleMultiplier: number;
|
|
10
|
-
protected static readonly acuteAngleMultiplier: number;
|
|
11
|
-
protected static readonly sliderMultiplier: number;
|
|
12
|
-
protected static readonly velocityChangeMultiplier: number;
|
|
13
|
-
protected static readonly wiggleMultiplier: number;
|
|
14
|
-
/**
|
|
15
|
-
* Calculates the bonus of wide angles.
|
|
16
|
-
*/
|
|
17
|
-
protected static calculateWideAngleBonus(angle: number): number;
|
|
18
|
-
/**
|
|
19
|
-
* Calculates the bonus of acute angles.
|
|
20
|
-
*/
|
|
21
|
-
protected static calculateAcuteAngleBonus(angle: number): number;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
3
|
/**
|
|
25
4
|
* Holds data that can be used to calculate performance points.
|
|
26
5
|
*/
|
|
@@ -85,6 +64,10 @@ interface DifficultyAttributes {
|
|
|
85
64
|
* The amount of strains that are considered difficult with respect to the aim skill.
|
|
86
65
|
*/
|
|
87
66
|
aimDifficultStrainCount: number;
|
|
67
|
+
/**
|
|
68
|
+
* The number of sliders weighted by difficulty.
|
|
69
|
+
*/
|
|
70
|
+
aimDifficultSliderCount: number;
|
|
88
71
|
}
|
|
89
72
|
|
|
90
73
|
/**
|
|
@@ -652,9 +635,9 @@ declare class DroidAim extends DroidSkill {
|
|
|
652
635
|
protected readonly reducedSectionBaseline = 0.75;
|
|
653
636
|
protected readonly starsPerDouble = 1.05;
|
|
654
637
|
private readonly skillMultiplier;
|
|
655
|
-
private readonly withSliders;
|
|
656
638
|
private currentAimStrain;
|
|
657
639
|
private readonly sliderStrains;
|
|
640
|
+
readonly withSliders: boolean;
|
|
658
641
|
constructor(mods: Mod[], withSliders: boolean);
|
|
659
642
|
/**
|
|
660
643
|
* Obtains the amount of sliders that are considered difficult in terms of relative strain.
|
|
@@ -672,11 +655,12 @@ declare class DroidAim extends DroidSkill {
|
|
|
672
655
|
/**
|
|
673
656
|
* An evaluator for calculating osu!droid Aim skill.
|
|
674
657
|
*/
|
|
675
|
-
declare abstract class DroidAimEvaluator
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
658
|
+
declare abstract class DroidAimEvaluator {
|
|
659
|
+
private static readonly wideAngleMultiplier;
|
|
660
|
+
private static readonly acuteAngleMultiplier;
|
|
661
|
+
private static readonly sliderMultiplier;
|
|
662
|
+
private static readonly velocityChangeMultiplier;
|
|
663
|
+
private static readonly wiggleMultiplier;
|
|
680
664
|
private static readonly singleSpacingThreshold;
|
|
681
665
|
private static readonly minSpeedBonus;
|
|
682
666
|
/**
|
|
@@ -699,18 +683,14 @@ declare abstract class DroidAimEvaluator extends AimEvaluator {
|
|
|
699
683
|
* Calculates the flow aim strain of a hitobject.
|
|
700
684
|
*/
|
|
701
685
|
private static flowAimStrainOf;
|
|
702
|
-
|
|
703
|
-
|
|
686
|
+
private static calculateWideAngleBonus;
|
|
687
|
+
private static calculateAcuteAngleBonus;
|
|
704
688
|
}
|
|
705
689
|
|
|
706
690
|
/**
|
|
707
691
|
* Holds data that can be used to calculate osu!droid performance points.
|
|
708
692
|
*/
|
|
709
693
|
interface DroidDifficultyAttributes extends DifficultyAttributes {
|
|
710
|
-
/**
|
|
711
|
-
* The number of sliders weighted by difficulty.
|
|
712
|
-
*/
|
|
713
|
-
aimDifficultSliderCount: number;
|
|
714
694
|
/**
|
|
715
695
|
* The difficulty corresponding to the tap skill.
|
|
716
696
|
*/
|
|
@@ -933,8 +913,8 @@ declare class DroidFlashlight extends DroidSkill {
|
|
|
933
913
|
protected readonly starsPerDouble = 1.06;
|
|
934
914
|
private readonly skillMultiplier;
|
|
935
915
|
private readonly isHidden;
|
|
936
|
-
private readonly withSliders;
|
|
937
916
|
private currentFlashlightStrain;
|
|
917
|
+
readonly withSliders: boolean;
|
|
938
918
|
constructor(mods: Mod[], withSliders: boolean);
|
|
939
919
|
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
940
920
|
protected calculateInitialStrain(time: number, current: DifficultyHitObject): number;
|
|
@@ -943,23 +923,15 @@ declare class DroidFlashlight extends DroidSkill {
|
|
|
943
923
|
difficultyValue(): number;
|
|
944
924
|
}
|
|
945
925
|
|
|
946
|
-
/**
|
|
947
|
-
* An evaluator for calculating flashlight skill.
|
|
948
|
-
*
|
|
949
|
-
* This class should be considered an "evaluating" class and not persisted.
|
|
950
|
-
*/
|
|
951
|
-
declare abstract class FlashlightEvaluator {
|
|
952
|
-
protected static readonly maxOpacityBonus: number;
|
|
953
|
-
protected static readonly hiddenBonus: number;
|
|
954
|
-
protected static readonly minVelocity: number;
|
|
955
|
-
protected static readonly sliderMultiplier: number;
|
|
956
|
-
protected static readonly minAngleMultiplier: number;
|
|
957
|
-
}
|
|
958
|
-
|
|
959
926
|
/**
|
|
960
927
|
* An evaluator for calculating osu!droid Flashlight skill.
|
|
961
928
|
*/
|
|
962
|
-
declare abstract class DroidFlashlightEvaluator
|
|
929
|
+
declare abstract class DroidFlashlightEvaluator {
|
|
930
|
+
private static readonly maxOpacityBonus;
|
|
931
|
+
private static readonly hiddenBonus;
|
|
932
|
+
private static readonly minVelocity;
|
|
933
|
+
private static readonly sliderMultiplier;
|
|
934
|
+
private static readonly minAngleMultiplier;
|
|
963
935
|
/**
|
|
964
936
|
* Evaluates the difficulty of memorizing and hitting the current object, based on:
|
|
965
937
|
*
|
|
@@ -1320,13 +1292,13 @@ declare class DroidTap extends DroidSkill {
|
|
|
1320
1292
|
private currentTapStrain;
|
|
1321
1293
|
private currentRhythmMultiplier;
|
|
1322
1294
|
private readonly skillMultiplier;
|
|
1323
|
-
private readonly considerCheesability;
|
|
1324
|
-
private readonly strainTimeCap?;
|
|
1325
1295
|
private readonly _objectDeltaTimes;
|
|
1326
1296
|
/**
|
|
1327
1297
|
* The delta time of hitobjects.
|
|
1328
1298
|
*/
|
|
1329
1299
|
get objectDeltaTimes(): readonly number[];
|
|
1300
|
+
readonly considerCheesability: boolean;
|
|
1301
|
+
private readonly strainTimeCap?;
|
|
1330
1302
|
constructor(mods: Mod[], considerCheesability: boolean, strainTimeCap?: number);
|
|
1331
1303
|
/**
|
|
1332
1304
|
* The amount of notes that are relevant to the difficulty.
|
|
@@ -1345,19 +1317,11 @@ declare class DroidTap extends DroidSkill {
|
|
|
1345
1317
|
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
1346
1318
|
}
|
|
1347
1319
|
|
|
1348
|
-
/**
|
|
1349
|
-
* An evaluator for calculating speed or tap skill.
|
|
1350
|
-
*
|
|
1351
|
-
* This class should be considered an "evaluating" class and not persisted.
|
|
1352
|
-
*/
|
|
1353
|
-
declare abstract class SpeedEvaluator {
|
|
1354
|
-
protected static readonly minSpeedBonus: number;
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
1320
|
/**
|
|
1358
1321
|
* An evaluator for calculating osu!droid tap skill.
|
|
1359
1322
|
*/
|
|
1360
|
-
declare abstract class DroidTapEvaluator
|
|
1323
|
+
declare abstract class DroidTapEvaluator {
|
|
1324
|
+
private static readonly minSpeedBonus;
|
|
1361
1325
|
/**
|
|
1362
1326
|
* Evaluates the difficulty of tapping the current object, based on:
|
|
1363
1327
|
*
|
|
@@ -1382,10 +1346,10 @@ declare class DroidVisual extends DroidSkill {
|
|
|
1382
1346
|
protected readonly reducedSectionBaseline = 0.75;
|
|
1383
1347
|
protected readonly strainDecayBase = 0.1;
|
|
1384
1348
|
private readonly isHidden;
|
|
1385
|
-
private readonly withSliders;
|
|
1386
1349
|
private currentVisualStrain;
|
|
1387
1350
|
private currentRhythmMultiplier;
|
|
1388
1351
|
private readonly skillMultiplier;
|
|
1352
|
+
readonly withSliders: boolean;
|
|
1389
1353
|
constructor(mods: Mod[], withSliders: boolean);
|
|
1390
1354
|
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
1391
1355
|
protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
|
|
@@ -1454,8 +1418,13 @@ declare class OsuAim extends OsuSkill {
|
|
|
1454
1418
|
protected readonly decayWeight = 0.9;
|
|
1455
1419
|
private currentAimStrain;
|
|
1456
1420
|
private readonly skillMultiplier;
|
|
1457
|
-
private readonly
|
|
1421
|
+
private readonly sliderStrains;
|
|
1422
|
+
readonly withSliders: boolean;
|
|
1458
1423
|
constructor(mods: Mod[], withSliders: boolean);
|
|
1424
|
+
/**
|
|
1425
|
+
* Obtains the amount of sliders that are considered difficult in terms of relative strain.
|
|
1426
|
+
*/
|
|
1427
|
+
countDifficultSliders(): number;
|
|
1459
1428
|
protected strainValueAt(current: OsuDifficultyHitObject): number;
|
|
1460
1429
|
protected calculateInitialStrain(time: number, current: OsuDifficultyHitObject): number;
|
|
1461
1430
|
/**
|
|
@@ -1467,7 +1436,12 @@ declare class OsuAim extends OsuSkill {
|
|
|
1467
1436
|
/**
|
|
1468
1437
|
* An evaluator for calculating osu!standard Aim skill.
|
|
1469
1438
|
*/
|
|
1470
|
-
declare abstract class OsuAimEvaluator
|
|
1439
|
+
declare abstract class OsuAimEvaluator {
|
|
1440
|
+
private static readonly wideAngleMultiplier;
|
|
1441
|
+
private static readonly acuteAngleMultiplier;
|
|
1442
|
+
private static readonly sliderMultiplier;
|
|
1443
|
+
private static readonly velocityChangeMultiplier;
|
|
1444
|
+
private static readonly wiggleMultiplier;
|
|
1471
1445
|
/**
|
|
1472
1446
|
* Evaluates the difficulty of aiming the current object, based on:
|
|
1473
1447
|
*
|
|
@@ -1480,6 +1454,8 @@ declare abstract class OsuAimEvaluator extends AimEvaluator {
|
|
|
1480
1454
|
* @param withSliders Whether to take slider difficulty into account.
|
|
1481
1455
|
*/
|
|
1482
1456
|
static evaluateDifficultyOf(current: OsuDifficultyHitObject, withSliders: boolean): number;
|
|
1457
|
+
private static calculateWideAngleBonus;
|
|
1458
|
+
private static calculateAcuteAngleBonus;
|
|
1483
1459
|
}
|
|
1484
1460
|
|
|
1485
1461
|
/**
|
|
@@ -1553,10 +1529,6 @@ declare class OsuDifficultyCalculator extends DifficultyCalculator<OsuDifficulty
|
|
|
1553
1529
|
* @param speedSkill The speed skill.
|
|
1554
1530
|
*/
|
|
1555
1531
|
private postCalculateSpeed;
|
|
1556
|
-
/**
|
|
1557
|
-
* Calculates speed-related attributes.
|
|
1558
|
-
*/
|
|
1559
|
-
private calculateSpeedAttributes;
|
|
1560
1532
|
/**
|
|
1561
1533
|
* Called after flashlight skill calculation.
|
|
1562
1534
|
*
|
|
@@ -1586,7 +1558,12 @@ declare class OsuFlashlight extends OsuSkill {
|
|
|
1586
1558
|
/**
|
|
1587
1559
|
* An evaluator for calculating osu!standard Flashlight skill.
|
|
1588
1560
|
*/
|
|
1589
|
-
declare abstract class OsuFlashlightEvaluator
|
|
1561
|
+
declare abstract class OsuFlashlightEvaluator {
|
|
1562
|
+
private static readonly maxOpacityBonus;
|
|
1563
|
+
private static readonly hiddenBonus;
|
|
1564
|
+
private static readonly minVelocity;
|
|
1565
|
+
private static readonly sliderMultiplier;
|
|
1566
|
+
private static readonly minAngleMultiplier;
|
|
1590
1567
|
/**
|
|
1591
1568
|
* Evaluates the difficulty of memorizing and hitting the current object, based on:
|
|
1592
1569
|
*
|
|
@@ -1625,6 +1602,7 @@ declare class OsuPerformanceCalculator extends PerformanceCalculator<OsuDifficul
|
|
|
1625
1602
|
protected finalMultiplier: number;
|
|
1626
1603
|
protected readonly mode = Modes.osu;
|
|
1627
1604
|
private comboPenalty;
|
|
1605
|
+
private speedDeviation;
|
|
1628
1606
|
protected calculateValues(): void;
|
|
1629
1607
|
protected calculateTotalValue(): number;
|
|
1630
1608
|
protected handleOptions(options?: PerformanceCalculationOptions): void;
|
|
@@ -1644,6 +1622,28 @@ declare class OsuPerformanceCalculator extends PerformanceCalculator<OsuDifficul
|
|
|
1644
1622
|
* Calculates the flashlight performance value of the beatmap.
|
|
1645
1623
|
*/
|
|
1646
1624
|
private calculateFlashlightValue;
|
|
1625
|
+
/**
|
|
1626
|
+
* Estimates a player's deviation on speed notes using {@link calculateDeviation}, assuming worst-case.
|
|
1627
|
+
*
|
|
1628
|
+
* Treats all speed notes as hit circles.
|
|
1629
|
+
*/
|
|
1630
|
+
private calculateSpeedDeviation;
|
|
1631
|
+
/**
|
|
1632
|
+
* Estimates the player's tap deviation based on the OD, given number of greats, oks, mehs and misses,
|
|
1633
|
+
* assuming the player's mean hit error is 0. The estimation is consistent in that two SS scores on the
|
|
1634
|
+
* same map with the same settings will always return the same deviation.
|
|
1635
|
+
*
|
|
1636
|
+
* Misses are ignored because they are usually due to misaiming.
|
|
1637
|
+
*
|
|
1638
|
+
* Greats and oks are assumed to follow a normal distribution, whereas mehs are assumed to follow a uniform distribution.
|
|
1639
|
+
*/
|
|
1640
|
+
private calculateDeviation;
|
|
1641
|
+
/**
|
|
1642
|
+
* Calculates multiplier for speed to account for improper tapping based on the deviation and speed difficulty.
|
|
1643
|
+
*
|
|
1644
|
+
* [Graph](https://www.desmos.com/calculator/dmogdhzofn)
|
|
1645
|
+
*/
|
|
1646
|
+
private calculateSpeedHighDeviationNerf;
|
|
1647
1647
|
toString(): string;
|
|
1648
1648
|
}
|
|
1649
1649
|
|
|
@@ -1689,13 +1689,14 @@ declare class OsuSpeed extends OsuSkill {
|
|
|
1689
1689
|
/**
|
|
1690
1690
|
* An evaluator for calculating osu!standard speed skill.
|
|
1691
1691
|
*/
|
|
1692
|
-
declare abstract class OsuSpeedEvaluator
|
|
1692
|
+
declare abstract class OsuSpeedEvaluator {
|
|
1693
1693
|
/**
|
|
1694
1694
|
* Spacing threshold for a single hitobject spacing.
|
|
1695
1695
|
*
|
|
1696
1696
|
* About 1.25 circles distance between hitobject centers.
|
|
1697
1697
|
*/
|
|
1698
1698
|
private static readonly SINGLE_SPACING_THRESHOLD;
|
|
1699
|
+
private static readonly minSpeedBonus;
|
|
1699
1700
|
private static readonly DISTANCE_MULTIPLIER;
|
|
1700
1701
|
/**
|
|
1701
1702
|
* Evaluates the difficulty of tapping the current object, based on:
|
|
@@ -1710,4 +1711,4 @@ declare abstract class OsuSpeedEvaluator extends SpeedEvaluator {
|
|
|
1710
1711
|
static evaluateDifficultyOf(current: OsuDifficultyHitObject, mods: Mod[]): number;
|
|
1711
1712
|
}
|
|
1712
1713
|
|
|
1713
|
-
export {
|
|
1714
|
+
export { type CacheableDifficultyAttributes, type DifficultSlider, type DifficultyAttributes, type DifficultyCalculationOptions, DifficultyCalculator, DifficultyHitObject, DroidAim, DroidAimEvaluator, type DroidDifficultyAttributes, type DroidDifficultyCalculationOptions, DroidDifficultyCalculator, DroidDifficultyHitObject, DroidFlashlight, DroidFlashlightEvaluator, DroidPerformanceCalculator, DroidRhythm, DroidRhythmEvaluator, DroidTap, DroidTapEvaluator, DroidVisual, DroidVisualEvaluator, type ExtendedDroidDifficultyAttributes, type HighStrainSection, OsuAim, OsuAimEvaluator, type OsuDifficultyAttributes, OsuDifficultyCalculator, OsuDifficultyHitObject, OsuFlashlight, OsuFlashlightEvaluator, OsuPerformanceCalculator, OsuRhythmEvaluator, OsuSpeed, OsuSpeedEvaluator, type PerformanceCalculationOptions, PerformanceCalculator, type StrainPeaks };
|