@rian8337/osu-rebalance-difficulty-calculator 4.0.0-beta.44 → 4.0.0-beta.45
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 +41 -84
- package/package.json +2 -2
- package/typings/index.d.ts +8 -27
package/dist/index.js
CHANGED
|
@@ -806,8 +806,8 @@ class DroidAimEvaluator extends AimEvaluator {
|
|
|
806
806
|
osuBase.MathUtils.smootherstep(current.lazyJumpDistance, radius, diameter) *
|
|
807
807
|
Math.pow(osuBase.MathUtils.reverseLerp(current.lazyJumpDistance, diameter * 3, diameter), 1.8) *
|
|
808
808
|
osuBase.MathUtils.smootherstep(currentAngle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60)) *
|
|
809
|
-
osuBase.MathUtils.smootherstep(
|
|
810
|
-
Math.pow(osuBase.MathUtils.reverseLerp(
|
|
809
|
+
osuBase.MathUtils.smootherstep(last.lazyJumpDistance, radius, diameter) *
|
|
810
|
+
Math.pow(osuBase.MathUtils.reverseLerp(last.lazyJumpDistance, diameter * 3, diameter), 1.8) *
|
|
811
811
|
osuBase.MathUtils.smootherstep(lastAngle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60));
|
|
812
812
|
}
|
|
813
813
|
if (Math.max(prevVelocity, currentVelocity)) {
|
|
@@ -1100,15 +1100,13 @@ class DroidTapEvaluator extends SpeedEvaluator {
|
|
|
1100
1100
|
* Evaluates the difficulty of tapping the current object, based on:
|
|
1101
1101
|
*
|
|
1102
1102
|
* - time between pressing the previous and current object,
|
|
1103
|
-
* - distance between those objects,
|
|
1104
1103
|
* - how easily they can be cheesed,
|
|
1105
1104
|
* - and the strain time cap.
|
|
1106
1105
|
*
|
|
1107
1106
|
* @param current The current object.
|
|
1108
1107
|
* @param considerCheesability Whether to consider cheesability.
|
|
1109
|
-
* @param strainTimeCap The strain time to cap the object's strain time to.
|
|
1110
1108
|
*/
|
|
1111
|
-
static evaluateDifficultyOf(current, considerCheesability
|
|
1109
|
+
static evaluateDifficultyOf(current, considerCheesability) {
|
|
1112
1110
|
if (current.object instanceof osuBase.Spinner ||
|
|
1113
1111
|
// Exclude overlapping objects that can be tapped at once.
|
|
1114
1112
|
current.isOverlapping(false)) {
|
|
@@ -1117,17 +1115,14 @@ class DroidTapEvaluator extends SpeedEvaluator {
|
|
|
1117
1115
|
const doubletapness = considerCheesability
|
|
1118
1116
|
? 1 - current.doubletapness
|
|
1119
1117
|
: 1;
|
|
1120
|
-
const strainTime = strainTimeCap !== undefined
|
|
1121
|
-
? // We cap the strain time to 50 here as the chance of vibro is higher in any BPM higher than 300.
|
|
1122
|
-
Math.max(50, strainTimeCap, current.strainTime)
|
|
1123
|
-
: current.strainTime;
|
|
1124
1118
|
let speedBonus = 1;
|
|
1125
|
-
if (strainTime < this.minSpeedBonus) {
|
|
1119
|
+
if (current.strainTime < this.minSpeedBonus) {
|
|
1126
1120
|
speedBonus +=
|
|
1127
1121
|
0.75 *
|
|
1128
|
-
Math.pow(osuBase.ErrorFunction.erf((this.minSpeedBonus - strainTime) / 40), 2);
|
|
1122
|
+
Math.pow(osuBase.ErrorFunction.erf((this.minSpeedBonus - current.strainTime) / 40), 2);
|
|
1129
1123
|
}
|
|
1130
|
-
return (speedBonus * Math.pow(doubletapness, 1.5) * 1000) /
|
|
1124
|
+
return ((speedBonus * Math.pow(doubletapness, 1.5) * 1000) /
|
|
1125
|
+
current.strainTime);
|
|
1131
1126
|
}
|
|
1132
1127
|
}
|
|
1133
1128
|
|
|
@@ -1135,13 +1130,7 @@ class DroidTapEvaluator extends SpeedEvaluator {
|
|
|
1135
1130
|
* Represents the skill required to press keys or tap with regards to keeping up with the speed at which objects need to be hit.
|
|
1136
1131
|
*/
|
|
1137
1132
|
class DroidTap extends DroidSkill {
|
|
1138
|
-
|
|
1139
|
-
* The delta time of hitobjects.
|
|
1140
|
-
*/
|
|
1141
|
-
get objectDeltaTimes() {
|
|
1142
|
-
return this._objectDeltaTimes;
|
|
1143
|
-
}
|
|
1144
|
-
constructor(mods, considerCheesability, strainTimeCap) {
|
|
1133
|
+
constructor(mods, considerCheesability) {
|
|
1145
1134
|
super(mods);
|
|
1146
1135
|
this.reducedSectionCount = 10;
|
|
1147
1136
|
this.reducedSectionBaseline = 0.75;
|
|
@@ -1150,9 +1139,7 @@ class DroidTap extends DroidSkill {
|
|
|
1150
1139
|
this.currentTapStrain = 0;
|
|
1151
1140
|
this.currentRhythmMultiplier = 0;
|
|
1152
1141
|
this.skillMultiplier = 1.375;
|
|
1153
|
-
this._objectDeltaTimes = [];
|
|
1154
1142
|
this.considerCheesability = considerCheesability;
|
|
1155
|
-
this.strainTimeCap = strainTimeCap;
|
|
1156
1143
|
}
|
|
1157
1144
|
/**
|
|
1158
1145
|
* The amount of notes that are relevant to the difficulty.
|
|
@@ -1167,31 +1154,11 @@ class DroidTap extends DroidSkill {
|
|
|
1167
1154
|
}
|
|
1168
1155
|
return this._objectStrains.reduce((total, next) => total + 1 / (1 + Math.exp(-((next / maxStrain) * 12 - 6))), 0);
|
|
1169
1156
|
}
|
|
1170
|
-
/**
|
|
1171
|
-
* The delta time relevant to the difficulty.
|
|
1172
|
-
*/
|
|
1173
|
-
relevantDeltaTime() {
|
|
1174
|
-
if (this._objectStrains.length === 0) {
|
|
1175
|
-
return 0;
|
|
1176
|
-
}
|
|
1177
|
-
const maxStrain = Math.max(...this._objectStrains);
|
|
1178
|
-
if (maxStrain === 0) {
|
|
1179
|
-
return 0;
|
|
1180
|
-
}
|
|
1181
|
-
return (this._objectDeltaTimes.reduce((total, next, index) => total +
|
|
1182
|
-
(next * 1) /
|
|
1183
|
-
(1 +
|
|
1184
|
-
Math.exp(-((this._objectStrains[index] / maxStrain) *
|
|
1185
|
-
25 -
|
|
1186
|
-
20))), 0) /
|
|
1187
|
-
this._objectStrains.reduce((total, next) => total + 1 / (1 + Math.exp(-((next / maxStrain) * 25 - 20))), 0));
|
|
1188
|
-
}
|
|
1189
1157
|
strainValueAt(current) {
|
|
1190
1158
|
this.currentTapStrain *= this.strainDecay(current.strainTime);
|
|
1191
1159
|
this.currentTapStrain +=
|
|
1192
|
-
DroidTapEvaluator.evaluateDifficultyOf(current, this.considerCheesability
|
|
1160
|
+
DroidTapEvaluator.evaluateDifficultyOf(current, this.considerCheesability) * this.skillMultiplier;
|
|
1193
1161
|
this.currentRhythmMultiplier = current.rhythmMultiplier;
|
|
1194
|
-
this._objectDeltaTimes.push(current.deltaTime);
|
|
1195
1162
|
return this.currentTapStrain * current.rhythmMultiplier;
|
|
1196
1163
|
}
|
|
1197
1164
|
calculateInitialStrain(time, current) {
|
|
@@ -1207,9 +1174,6 @@ class DroidTap extends DroidSkill {
|
|
|
1207
1174
|
* @param current The hitobject to save to.
|
|
1208
1175
|
*/
|
|
1209
1176
|
saveToHitObject(current) {
|
|
1210
|
-
if (this.strainTimeCap !== undefined) {
|
|
1211
|
-
return;
|
|
1212
|
-
}
|
|
1213
1177
|
const strain = this.currentTapStrain * this.currentRhythmMultiplier;
|
|
1214
1178
|
if (this.considerCheesability) {
|
|
1215
1179
|
current.tapStrain = strain;
|
|
@@ -1759,8 +1723,6 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1759
1723
|
visualSliderFactor: 0,
|
|
1760
1724
|
possibleThreeFingeredSections: [],
|
|
1761
1725
|
difficultSliders: [],
|
|
1762
|
-
averageSpeedDeltaTime: 0,
|
|
1763
|
-
vibroFactor: 1,
|
|
1764
1726
|
};
|
|
1765
1727
|
this.difficultyMultiplier = 0.18;
|
|
1766
1728
|
this.mode = osuBase.Modes.droid;
|
|
@@ -1818,9 +1780,7 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1818
1780
|
const tapSkillCheese = new DroidTap(this.mods, true);
|
|
1819
1781
|
const tapSkillNoCheese = new DroidTap(this.mods, false);
|
|
1820
1782
|
this.calculateSkills(tapSkillCheese, tapSkillNoCheese);
|
|
1821
|
-
|
|
1822
|
-
this.calculateSkills(tapSkillVibro);
|
|
1823
|
-
this.postCalculateTap(tapSkillCheese, tapSkillVibro);
|
|
1783
|
+
this.postCalculateTap(tapSkillCheese);
|
|
1824
1784
|
}
|
|
1825
1785
|
/**
|
|
1826
1786
|
* Calculates the rhythm star rating of the beatmap and stores it in this instance.
|
|
@@ -1886,10 +1846,8 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1886
1846
|
const flashlightSkillWithoutSliders = skills[6];
|
|
1887
1847
|
const visualSkill = skills[7];
|
|
1888
1848
|
const visualSkillWithoutSliders = skills[8];
|
|
1889
|
-
const tapSkillVibro = new DroidTap(this.mods, true, tapSkillCheese.relevantDeltaTime());
|
|
1890
|
-
this.calculateSkills(tapSkillVibro);
|
|
1891
1849
|
this.postCalculateAim(aimSkill, aimSkillWithoutSliders);
|
|
1892
|
-
this.postCalculateTap(tapSkillCheese
|
|
1850
|
+
this.postCalculateTap(tapSkillCheese);
|
|
1893
1851
|
this.postCalculateRhythm(rhythmSkill);
|
|
1894
1852
|
this.postCalculateFlashlight(flashlightSkill, flashlightSkillWithoutSliders);
|
|
1895
1853
|
this.postCalculateVisual(visualSkill, visualSkillWithoutSliders);
|
|
@@ -2004,20 +1962,13 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
2004
1962
|
* Called after tap skill calculation.
|
|
2005
1963
|
*
|
|
2006
1964
|
* @param tapSkillCheese The tap skill that considers cheesing.
|
|
2007
|
-
* @param tapSkillVibro The tap skill that considers vibro.
|
|
2008
1965
|
*/
|
|
2009
|
-
postCalculateTap(tapSkillCheese
|
|
1966
|
+
postCalculateTap(tapSkillCheese) {
|
|
2010
1967
|
this.strainPeaks.speed = tapSkillCheese.strainPeaks;
|
|
2011
1968
|
this.attributes.tapDifficulty = this.mods.some((m) => m instanceof osuBase.ModRelax)
|
|
2012
1969
|
? 0
|
|
2013
1970
|
: this.starValue(tapSkillCheese.difficultyValue());
|
|
2014
|
-
if (this.tap) {
|
|
2015
|
-
this.attributes.vibroFactor =
|
|
2016
|
-
this.starValue(tapSkillVibro.difficultyValue()) / this.tap;
|
|
2017
|
-
}
|
|
2018
1971
|
this.attributes.speedNoteCount = tapSkillCheese.relevantNoteCount();
|
|
2019
|
-
this.attributes.averageSpeedDeltaTime =
|
|
2020
|
-
tapSkillCheese.relevantDeltaTime();
|
|
2021
1972
|
this.attributes.tapDifficultStrainCount =
|
|
2022
1973
|
tapSkillCheese.countDifficultStrains();
|
|
2023
1974
|
this.calculateTapAttributes();
|
|
@@ -2548,32 +2499,12 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2548
2499
|
// Consider notes that are difficult to tap with respect to other notes, but
|
|
2549
2500
|
// also cap the note count to prevent buffing filler patterns.
|
|
2550
2501
|
tapValue *= this.calculateDeviationBasedLengthScaling(Math.min(this.difficultyAttributes.speedNoteCount, this.totalHits / 1.45));
|
|
2551
|
-
// Normalize the deviation to 300 BPM.
|
|
2552
|
-
const normalizedDeviation = this.tapDeviation *
|
|
2553
|
-
Math.max(1, 50 / this.difficultyAttributes.averageSpeedDeltaTime);
|
|
2554
|
-
// We expect the player to get 7500/x deviation when doubletapping x BPM.
|
|
2555
|
-
// Using this expectation, we penalize scores with deviation above 25.
|
|
2556
|
-
const averageBPM = 60000 / 4 / this.difficultyAttributes.averageSpeedDeltaTime;
|
|
2557
|
-
const adjustedDeviation = normalizedDeviation *
|
|
2558
|
-
(1 +
|
|
2559
|
-
1 /
|
|
2560
|
-
(1 +
|
|
2561
|
-
Math.exp(-(normalizedDeviation - 7500 / averageBPM) /
|
|
2562
|
-
((2 * 300) / averageBPM))));
|
|
2563
2502
|
// Scale the tap value with tap deviation.
|
|
2564
2503
|
tapValue *=
|
|
2565
2504
|
1.05 *
|
|
2566
|
-
Math.pow(osuBase.ErrorFunction.erf(20 / (Math.SQRT2 *
|
|
2567
|
-
//
|
|
2568
|
-
|
|
2569
|
-
// it can be assumed that the player taps invariant to rhythm.
|
|
2570
|
-
// We harshen the punishment for such scenario.
|
|
2571
|
-
tapValue *=
|
|
2572
|
-
(1 - Math.pow(this.difficultyAttributes.vibroFactor, 6)) /
|
|
2573
|
-
(1 +
|
|
2574
|
-
Math.exp((this._tapDeviation - 7500 / averageBPM) /
|
|
2575
|
-
((2 * 300) / averageBPM))) +
|
|
2576
|
-
Math.pow(this.difficultyAttributes.vibroFactor, 6);
|
|
2505
|
+
Math.pow(osuBase.ErrorFunction.erf(20 / (Math.SQRT2 * this.tapDeviation)), 0.6);
|
|
2506
|
+
// Scale the tap value with high deviation nerf.
|
|
2507
|
+
tapValue *= this.calculateTapHighDeviationNerf();
|
|
2577
2508
|
// Scale the tap value with three-fingered penalty.
|
|
2578
2509
|
tapValue /= this._tapPenalty;
|
|
2579
2510
|
// OD 8 SS stays the same.
|
|
@@ -2831,6 +2762,32 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2831
2762
|
}
|
|
2832
2763
|
return Number.POSITIVE_INFINITY;
|
|
2833
2764
|
}
|
|
2765
|
+
/**
|
|
2766
|
+
* Calculates multiplier for tap to account for improper tapping based on the deviation and tap difficulty.
|
|
2767
|
+
*
|
|
2768
|
+
* https://www.desmos.com/calculator/dmogdhzofn
|
|
2769
|
+
*/
|
|
2770
|
+
calculateTapHighDeviationNerf() {
|
|
2771
|
+
if (this.tapDeviation === Number.POSITIVE_INFINITY) {
|
|
2772
|
+
return 0;
|
|
2773
|
+
}
|
|
2774
|
+
const tapValue = this.baseValue(this.difficultyAttributes.tapDifficulty);
|
|
2775
|
+
// Decide a point where the PP value achieved compared to the tap deviation is assumed to be
|
|
2776
|
+
// tapped improperly. Any PP above this point is considered "excess" tap difficulty.
|
|
2777
|
+
// This is used to cause PP above the cutoff to scale logarithmically towards the original
|
|
2778
|
+
// tap value, thus nerfing the value.
|
|
2779
|
+
const excessTapDifficultyCutoff = 100 + 220 * Math.pow(22 / this.tapDeviation, 6.5);
|
|
2780
|
+
if (tapValue <= excessTapDifficultyCutoff) {
|
|
2781
|
+
return 1;
|
|
2782
|
+
}
|
|
2783
|
+
const scale = 50;
|
|
2784
|
+
const adjustedTapValue = scale *
|
|
2785
|
+
(Math.log((tapValue - excessTapDifficultyCutoff) / scale + 1) +
|
|
2786
|
+
excessTapDifficultyCutoff / scale);
|
|
2787
|
+
// 200 UR and less are considered tapped correctly to ensure that normal scores will be punished as little as possible
|
|
2788
|
+
const lerp = 1 - osuBase.MathUtils.clamp((this.tapDeviation - 20) / (24 - 20), 0, 1);
|
|
2789
|
+
return osuBase.Interpolation.lerp(adjustedTapValue, tapValue, lerp) / tapValue;
|
|
2790
|
+
}
|
|
2834
2791
|
getConvertedHitWindow() {
|
|
2835
2792
|
const hitWindow300 = new osuBase.OsuHitWindow(this.difficultyAttributes.overallDifficulty).greatWindow;
|
|
2836
2793
|
if (this.difficultyAttributes.mods.some((m) => m instanceof osuBase.ModPrecise)) {
|
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.45",
|
|
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",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "de7b995e670f1703fcd134209d16fbc1c6788eb9"
|
|
42
42
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -735,18 +735,6 @@ interface DroidDifficultyAttributes extends DifficultyAttributes {
|
|
|
735
735
|
* The amount of strains that are considered difficult with respect to the visual skill.
|
|
736
736
|
*/
|
|
737
737
|
visualDifficultStrainCount: number;
|
|
738
|
-
/**
|
|
739
|
-
* The average delta time of speed objects.
|
|
740
|
-
*/
|
|
741
|
-
averageSpeedDeltaTime: number;
|
|
742
|
-
/**
|
|
743
|
-
* Describes how much of tap difficulty is contributed by notes that are "vibroable".
|
|
744
|
-
*
|
|
745
|
-
* A value closer to 1 indicates most of tap difficulty is contributed by notes that are not "vibroable".
|
|
746
|
-
*
|
|
747
|
-
* A value closer to 0 indicates most of tap difficulty is contributed by notes that are "vibroable".
|
|
748
|
-
*/
|
|
749
|
-
vibroFactor: number;
|
|
750
738
|
}
|
|
751
739
|
|
|
752
740
|
/**
|
|
@@ -894,7 +882,6 @@ declare class DroidDifficultyCalculator extends DifficultyCalculator<DroidDiffic
|
|
|
894
882
|
* Called after tap skill calculation.
|
|
895
883
|
*
|
|
896
884
|
* @param tapSkillCheese The tap skill that considers cheesing.
|
|
897
|
-
* @param tapSkillVibro The tap skill that considers vibro.
|
|
898
885
|
*/
|
|
899
886
|
private postCalculateTap;
|
|
900
887
|
/**
|
|
@@ -1266,6 +1253,12 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator<DroidDiff
|
|
|
1266
1253
|
* This is fine though, since this method is only used to scale tap pp.
|
|
1267
1254
|
*/
|
|
1268
1255
|
private calculateTapDeviation;
|
|
1256
|
+
/**
|
|
1257
|
+
* Calculates multiplier for tap to account for improper tapping based on the deviation and tap difficulty.
|
|
1258
|
+
*
|
|
1259
|
+
* https://www.desmos.com/calculator/dmogdhzofn
|
|
1260
|
+
*/
|
|
1261
|
+
private calculateTapHighDeviationNerf;
|
|
1269
1262
|
private getConvertedHitWindow;
|
|
1270
1263
|
toString(): string;
|
|
1271
1264
|
}
|
|
@@ -1315,21 +1308,11 @@ declare class DroidTap extends DroidSkill {
|
|
|
1315
1308
|
private currentRhythmMultiplier;
|
|
1316
1309
|
private readonly skillMultiplier;
|
|
1317
1310
|
private readonly considerCheesability;
|
|
1318
|
-
|
|
1319
|
-
private readonly _objectDeltaTimes;
|
|
1320
|
-
/**
|
|
1321
|
-
* The delta time of hitobjects.
|
|
1322
|
-
*/
|
|
1323
|
-
get objectDeltaTimes(): readonly number[];
|
|
1324
|
-
constructor(mods: Mod[], considerCheesability: boolean, strainTimeCap?: number);
|
|
1311
|
+
constructor(mods: Mod[], considerCheesability: boolean);
|
|
1325
1312
|
/**
|
|
1326
1313
|
* The amount of notes that are relevant to the difficulty.
|
|
1327
1314
|
*/
|
|
1328
1315
|
relevantNoteCount(): number;
|
|
1329
|
-
/**
|
|
1330
|
-
* The delta time relevant to the difficulty.
|
|
1331
|
-
*/
|
|
1332
|
-
relevantDeltaTime(): number;
|
|
1333
1316
|
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
1334
1317
|
protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
|
|
1335
1318
|
protected getObjectStrain(): number;
|
|
@@ -1356,15 +1339,13 @@ declare abstract class DroidTapEvaluator extends SpeedEvaluator {
|
|
|
1356
1339
|
* Evaluates the difficulty of tapping the current object, based on:
|
|
1357
1340
|
*
|
|
1358
1341
|
* - time between pressing the previous and current object,
|
|
1359
|
-
* - distance between those objects,
|
|
1360
1342
|
* - how easily they can be cheesed,
|
|
1361
1343
|
* - and the strain time cap.
|
|
1362
1344
|
*
|
|
1363
1345
|
* @param current The current object.
|
|
1364
1346
|
* @param considerCheesability Whether to consider cheesability.
|
|
1365
|
-
* @param strainTimeCap The strain time to cap the object's strain time to.
|
|
1366
1347
|
*/
|
|
1367
|
-
static evaluateDifficultyOf(current: DroidDifficultyHitObject, considerCheesability: boolean
|
|
1348
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject, considerCheesability: boolean): number;
|
|
1368
1349
|
}
|
|
1369
1350
|
|
|
1370
1351
|
/**
|