@rian8337/osu-rebalance-difficulty-calculator 1.2.1 → 1.2.5
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/DroidPerformanceCalculator.js +20 -24
- package/dist/DroidStarRating.js +70 -36
- package/dist/OsuStarRating.js +42 -25
- package/dist/base/StarRating.js +2 -0
- package/dist/skills/DroidAim.js +2 -2
- package/dist/skills/DroidRhythm.js +4 -4
- package/dist/skills/DroidSkill.js +14 -1
- package/dist/skills/OsuSpeed.js +3 -3
- package/package.json +2 -2
- package/typings/index.d.ts +64 -17
|
@@ -28,11 +28,9 @@ class DroidPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalc
|
|
|
28
28
|
* The flashlight performance value.
|
|
29
29
|
*/
|
|
30
30
|
this.flashlight = 0;
|
|
31
|
-
this.aggregatedRhythmMultiplier = 0;
|
|
32
31
|
}
|
|
33
32
|
calculate(params) {
|
|
34
33
|
this.handleParams(params, osu_base_1.modes.droid);
|
|
35
|
-
this.calculateAverageRhythmMultiplier();
|
|
36
34
|
this.calculateAimValue();
|
|
37
35
|
this.calculateTapValue();
|
|
38
36
|
this.calculateAccuracyValue();
|
|
@@ -46,17 +44,6 @@ class DroidPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalc
|
|
|
46
44
|
Math.pow(this.flashlight, 1.1), 1 / 1.1) * this.finalMultiplier;
|
|
47
45
|
return this;
|
|
48
46
|
}
|
|
49
|
-
/**
|
|
50
|
-
* Calculates the average rhythm multiplier of the beatmap.
|
|
51
|
-
*/
|
|
52
|
-
calculateAverageRhythmMultiplier() {
|
|
53
|
-
// The first object doesn't have any rhythm multiplier, so we begin with the second object
|
|
54
|
-
const rhythmMultipliers = this.stars.objects
|
|
55
|
-
.map((v) => v.rhythmMultiplier)
|
|
56
|
-
.slice(1);
|
|
57
|
-
this.aggregatedRhythmMultiplier = Math.max(1, rhythmMultipliers.reduce((total, value) => total + value, 0) /
|
|
58
|
-
Math.max(500, rhythmMultipliers.length));
|
|
59
|
-
}
|
|
60
47
|
/**
|
|
61
48
|
* Calculates the aim performance value of the beatmap.
|
|
62
49
|
*/
|
|
@@ -66,9 +53,7 @@ class DroidPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalc
|
|
|
66
53
|
const calculatedAR = this.mapStatistics.ar;
|
|
67
54
|
this.aim = this.baseValue(Math.pow(this.stars.aim, 0.8));
|
|
68
55
|
if (this.effectiveMissCount > 0) {
|
|
69
|
-
this.aim *=
|
|
70
|
-
0.97 *
|
|
71
|
-
Math.pow(1 - Math.pow(this.effectiveMissCount / objectCount, 0.775), this.effectiveMissCount);
|
|
56
|
+
this.aim *= this.calculateMissPenalty(this.stars.attributes.aimDifficultStrainCount);
|
|
72
57
|
}
|
|
73
58
|
// Combo scaling
|
|
74
59
|
this.aim *= this.comboPenalty;
|
|
@@ -116,10 +101,7 @@ class DroidPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalc
|
|
|
116
101
|
const calculatedAR = this.mapStatistics.ar;
|
|
117
102
|
this.tap = this.baseValue(this.stars.tap);
|
|
118
103
|
if (this.effectiveMissCount > 0) {
|
|
119
|
-
|
|
120
|
-
this.tap *=
|
|
121
|
-
0.97 *
|
|
122
|
-
Math.pow(1 - Math.pow(this.effectiveMissCount / objectCount, 0.775), Math.pow(this.effectiveMissCount, 0.875));
|
|
104
|
+
this.tap *= this.calculateMissPenalty(this.stars.attributes.speedDifficultStrainCount);
|
|
123
105
|
}
|
|
124
106
|
// Combo scaling
|
|
125
107
|
this.tap *= this.comboPenalty;
|
|
@@ -164,16 +146,16 @@ class DroidPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalc
|
|
|
164
146
|
return;
|
|
165
147
|
}
|
|
166
148
|
// Global variables
|
|
149
|
+
const objectCount = this.stars.objects.length;
|
|
167
150
|
const ncircles = this.stars.mods.some((m) => m instanceof osu_base_1.ModScoreV2)
|
|
168
|
-
?
|
|
151
|
+
? objectCount - this.stars.map.spinners
|
|
169
152
|
: this.stars.map.circles;
|
|
170
153
|
if (ncircles === 0) {
|
|
171
154
|
return;
|
|
172
155
|
}
|
|
173
156
|
const realAccuracy = new osu_base_1.Accuracy({
|
|
174
157
|
...this.computedAccuracy,
|
|
175
|
-
n300: this.computedAccuracy.n300 -
|
|
176
|
-
(this.stars.objects.length - ncircles),
|
|
158
|
+
n300: this.computedAccuracy.n300 - (objectCount - ncircles),
|
|
177
159
|
});
|
|
178
160
|
// Lots of arbitrary values from testing.
|
|
179
161
|
// Considering to use derivation from perfect accuracy in a probabilistic manner - assume normal distribution
|
|
@@ -184,7 +166,7 @@ class DroidPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalc
|
|
|
184
166
|
// Bonus for many hitcircles - it's harder to keep good accuracy up for longer
|
|
185
167
|
this.accuracy *= Math.min(1.15, Math.pow(ncircles / 1000, 0.3));
|
|
186
168
|
// Scale the accuracy value with rhythm complexity.
|
|
187
|
-
this.accuracy *=
|
|
169
|
+
this.accuracy *= 1.5 / (1 + Math.exp(-(this.stars.rhythm - 1) / 2));
|
|
188
170
|
if (this.stars.mods.some((m) => m instanceof osu_base_1.ModHidden)) {
|
|
189
171
|
this.accuracy *= 1.08;
|
|
190
172
|
}
|
|
@@ -241,5 +223,19 @@ class DroidPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalc
|
|
|
241
223
|
this.flashlight.toFixed(2) +
|
|
242
224
|
" flashlight)");
|
|
243
225
|
}
|
|
226
|
+
/**
|
|
227
|
+
* Calculates miss penalty.
|
|
228
|
+
*
|
|
229
|
+
* @param difficultStrainCount Difficult strain count from calculation.
|
|
230
|
+
* @returns The miss penalty.
|
|
231
|
+
*/
|
|
232
|
+
calculateMissPenalty(difficultStrainCount) {
|
|
233
|
+
// Miss penalty assumes that a player will miss on the hardest parts of a map,
|
|
234
|
+
// so we use the amount of relatively difficult sections to adjust miss penalty
|
|
235
|
+
// to make it more punishing on maps with lower amount of hard sections.
|
|
236
|
+
return (0.97 /
|
|
237
|
+
(this.effectiveMissCount / (2 * Math.sqrt(difficultStrainCount)) +
|
|
238
|
+
1));
|
|
239
|
+
}
|
|
244
240
|
}
|
|
245
241
|
exports.DroidPerformanceCalculator = DroidPerformanceCalculator;
|
package/dist/DroidStarRating.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DroidStarRating = void 0;
|
|
4
|
-
const osu_base_1 = require("@rian8337/osu-base");
|
|
5
4
|
const DroidAim_1 = require("./skills/DroidAim");
|
|
6
5
|
const DroidTap_1 = require("./skills/DroidTap");
|
|
7
6
|
const StarRating_1 = require("./base/StarRating");
|
|
8
7
|
const DroidFlashlight_1 = require("./skills/DroidFlashlight");
|
|
8
|
+
const osu_base_1 = require("@rian8337/osu-base");
|
|
9
9
|
const DroidRhythm_1 = require("./skills/DroidRhythm");
|
|
10
10
|
/**
|
|
11
11
|
* Difficulty calculator for osu!droid gamemode.
|
|
@@ -59,14 +59,7 @@ class DroidStarRating extends StarRating_1.StarRating {
|
|
|
59
59
|
const aimSkill = new DroidAim_1.DroidAim(this.mods, true);
|
|
60
60
|
const aimSkillWithoutSliders = new DroidAim_1.DroidAim(this.mods, false);
|
|
61
61
|
this.calculateSkills(aimSkill, aimSkillWithoutSliders);
|
|
62
|
-
this.
|
|
63
|
-
this.strainPeaks.aimWithoutSliders = aimSkillWithoutSliders.strainPeaks;
|
|
64
|
-
this.aim = this.starValue(aimSkill.difficultyValue());
|
|
65
|
-
if (this.aim) {
|
|
66
|
-
this.attributes.sliderFactor =
|
|
67
|
-
this.starValue(aimSkillWithoutSliders.difficultyValue()) /
|
|
68
|
-
this.aim;
|
|
69
|
-
}
|
|
62
|
+
this.postCalculateAim(aimSkill, aimSkillWithoutSliders);
|
|
70
63
|
}
|
|
71
64
|
/**
|
|
72
65
|
* Calculates the speed star rating of the beatmap and stores it in this instance.
|
|
@@ -74,13 +67,7 @@ class DroidStarRating extends StarRating_1.StarRating {
|
|
|
74
67
|
calculateTap() {
|
|
75
68
|
const tapSkill = new DroidTap_1.DroidTap(this.mods, this.stats.od);
|
|
76
69
|
this.calculateSkills(tapSkill);
|
|
77
|
-
this.
|
|
78
|
-
this.tap = this.starValue(tapSkill.difficultyValue());
|
|
79
|
-
const objectStrains = this.objects.map((v) => v.tapStrain);
|
|
80
|
-
const maxStrain = Math.max(...objectStrains);
|
|
81
|
-
if (maxStrain) {
|
|
82
|
-
this.attributes.speedNoteCount = objectStrains.reduce((total, next) => total + 1 / (1 + Math.exp(-((next / maxStrain) * 12 - 6))), 0);
|
|
83
|
-
}
|
|
70
|
+
this.postCalculateTap(tapSkill);
|
|
84
71
|
}
|
|
85
72
|
/**
|
|
86
73
|
* Calculates the rhythm star rating of the beatmap and stores it in this instance.
|
|
@@ -88,7 +75,7 @@ class DroidStarRating extends StarRating_1.StarRating {
|
|
|
88
75
|
calculateRhythm() {
|
|
89
76
|
const rhythmSkill = new DroidRhythm_1.DroidRhythm(this.mods, this.stats.od);
|
|
90
77
|
this.calculateSkills(rhythmSkill);
|
|
91
|
-
this.
|
|
78
|
+
this.postCalculateRhythm(rhythmSkill);
|
|
92
79
|
}
|
|
93
80
|
/**
|
|
94
81
|
* Calculates the flashlight star rating of the beatmap and stores it in this instance.
|
|
@@ -96,8 +83,7 @@ class DroidStarRating extends StarRating_1.StarRating {
|
|
|
96
83
|
calculateFlashlight() {
|
|
97
84
|
const flashlightSkill = new DroidFlashlight_1.DroidFlashlight(this.mods);
|
|
98
85
|
this.calculateSkills(flashlightSkill);
|
|
99
|
-
this.
|
|
100
|
-
this.flashlight = this.starValue(flashlightSkill.difficultyValue());
|
|
86
|
+
this.postCalculateFlashlight(flashlightSkill);
|
|
101
87
|
}
|
|
102
88
|
calculateTotal() {
|
|
103
89
|
const aimPerformanceValue = this.basePerformanceValue(this.aim);
|
|
@@ -125,28 +111,17 @@ class DroidStarRating extends StarRating_1.StarRating {
|
|
|
125
111
|
const rhythmSkill = skills[2];
|
|
126
112
|
const tapSkill = skills[3];
|
|
127
113
|
const flashlightSkill = skills[4];
|
|
128
|
-
this.
|
|
129
|
-
this.strainPeaks.aimWithoutSliders = aimSkillWithoutSliders.strainPeaks;
|
|
130
|
-
this.aim = this.starValue(aimSkill.difficultyValue());
|
|
131
|
-
if (this.aim) {
|
|
132
|
-
this.attributes.sliderFactor =
|
|
133
|
-
this.starValue(aimSkillWithoutSliders.difficultyValue()) /
|
|
134
|
-
this.aim;
|
|
135
|
-
}
|
|
114
|
+
this.postCalculateAim(aimSkill, aimSkillWithoutSliders);
|
|
136
115
|
if (!isRelax) {
|
|
137
|
-
this.
|
|
138
|
-
this.tap = this.starValue(tapSkill.difficultyValue());
|
|
116
|
+
this.postCalculateTap(tapSkill);
|
|
139
117
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
if (maxStrain) {
|
|
143
|
-
this.attributes.speedNoteCount = objectStrains.reduce((total, next) => total + 1 / (1 + Math.exp(-((next / maxStrain) * 12 - 6))), 0);
|
|
118
|
+
else {
|
|
119
|
+
this.calculateSpeedAttributes();
|
|
144
120
|
}
|
|
145
121
|
if (!isRelax) {
|
|
146
|
-
this.
|
|
122
|
+
this.postCalculateRhythm(rhythmSkill);
|
|
147
123
|
}
|
|
148
|
-
this.
|
|
149
|
-
this.flashlight = this.starValue(flashlightSkill.difficultyValue());
|
|
124
|
+
this.postCalculateFlashlight(flashlightSkill);
|
|
150
125
|
this.calculateTotal();
|
|
151
126
|
}
|
|
152
127
|
/**
|
|
@@ -177,5 +152,64 @@ class DroidStarRating extends StarRating_1.StarRating {
|
|
|
177
152
|
new DroidFlashlight_1.DroidFlashlight(this.mods),
|
|
178
153
|
];
|
|
179
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* Called after aim skill calculation.
|
|
157
|
+
*
|
|
158
|
+
* @param aimSkill The aim skill that considers sliders.
|
|
159
|
+
* @param aimSkillWithoutSliders The aim skill that doesn't consider sliders.
|
|
160
|
+
*/
|
|
161
|
+
postCalculateAim(aimSkill, aimSkillWithoutSliders) {
|
|
162
|
+
this.strainPeaks.aimWithSliders = aimSkill.strainPeaks;
|
|
163
|
+
this.strainPeaks.aimWithoutSliders = aimSkillWithoutSliders.strainPeaks;
|
|
164
|
+
this.aim = this.starValue(aimSkill.difficultyValue());
|
|
165
|
+
if (this.aim) {
|
|
166
|
+
this.attributes.sliderFactor =
|
|
167
|
+
this.starValue(aimSkillWithoutSliders.difficultyValue()) /
|
|
168
|
+
this.aim;
|
|
169
|
+
}
|
|
170
|
+
const objectStrains = this.objects.map((v) => v.aimStrainWithSliders);
|
|
171
|
+
const maxStrain = Math.max(...objectStrains);
|
|
172
|
+
if (maxStrain) {
|
|
173
|
+
this.attributes.aimDifficultStrainCount = objectStrains.reduce((a, v) => a + Math.pow(v / maxStrain, 4), 0);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Called after tap skill calculation.
|
|
178
|
+
*
|
|
179
|
+
* @param tapSkill The tap skill.
|
|
180
|
+
*/
|
|
181
|
+
postCalculateTap(tapSkill) {
|
|
182
|
+
this.strainPeaks.speed = tapSkill.strainPeaks;
|
|
183
|
+
this.tap = this.starValue(tapSkill.difficultyValue());
|
|
184
|
+
this.calculateSpeedAttributes();
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Calculates speed-related attributes.
|
|
188
|
+
*/
|
|
189
|
+
calculateSpeedAttributes() {
|
|
190
|
+
const objectStrains = this.objects.map((v) => v.tapStrain);
|
|
191
|
+
const maxStrain = Math.max(...objectStrains);
|
|
192
|
+
if (maxStrain) {
|
|
193
|
+
this.attributes.speedNoteCount = objectStrains.reduce((total, next) => total + 1 / (1 + Math.exp(-((next / maxStrain) * 12 - 6))), 0);
|
|
194
|
+
this.attributes.speedDifficultStrainCount = objectStrains.reduce((a, v) => a + Math.pow(v / maxStrain, 4), 0);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Called after rhythm skill calculation.
|
|
199
|
+
*
|
|
200
|
+
* @param rhythmSkill The rhythm skill.
|
|
201
|
+
*/
|
|
202
|
+
postCalculateRhythm(rhythmSkill) {
|
|
203
|
+
this.rhythm = this.starValue(rhythmSkill.difficultyValue());
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Called after flashlight skill calculation.
|
|
207
|
+
*
|
|
208
|
+
* @param flashlightSkill The flashlight skill.
|
|
209
|
+
*/
|
|
210
|
+
postCalculateFlashlight(flashlightSkill) {
|
|
211
|
+
this.strainPeaks.flashlight = flashlightSkill.strainPeaks;
|
|
212
|
+
this.flashlight = this.starValue(flashlightSkill.difficultyValue());
|
|
213
|
+
}
|
|
180
214
|
}
|
|
181
215
|
exports.DroidStarRating = DroidStarRating;
|
package/dist/OsuStarRating.js
CHANGED
|
@@ -35,15 +35,8 @@ class OsuStarRating extends StarRating_1.StarRating {
|
|
|
35
35
|
calculateAim() {
|
|
36
36
|
const aimSkill = new OsuAim_1.OsuAim(this.mods, true);
|
|
37
37
|
const aimSkillWithoutSliders = new OsuAim_1.OsuAim(this.mods, false);
|
|
38
|
-
this.calculateSkills(aimSkill);
|
|
39
|
-
this.
|
|
40
|
-
this.strainPeaks.aimWithoutSliders = aimSkillWithoutSliders.strainPeaks;
|
|
41
|
-
this.aim = this.starValue(aimSkill.difficultyValue());
|
|
42
|
-
if (this.aim) {
|
|
43
|
-
this.attributes.sliderFactor =
|
|
44
|
-
this.starValue(aimSkillWithoutSliders.difficultyValue()) /
|
|
45
|
-
this.aim;
|
|
46
|
-
}
|
|
38
|
+
this.calculateSkills(aimSkill, aimSkillWithoutSliders);
|
|
39
|
+
this.postCalculateAim(aimSkill, aimSkillWithoutSliders);
|
|
47
40
|
}
|
|
48
41
|
/**
|
|
49
42
|
* Calculates the speed star rating of the beatmap and stores it in this instance.
|
|
@@ -52,10 +45,9 @@ class OsuStarRating extends StarRating_1.StarRating {
|
|
|
52
45
|
if (this.mods.some((m) => m instanceof osu_base_1.ModRelax)) {
|
|
53
46
|
return;
|
|
54
47
|
}
|
|
55
|
-
const speedSkill = new OsuSpeed_1.
|
|
48
|
+
const speedSkill = new OsuSpeed_1.OsuSpeed(this.mods, new osu_base_1.OsuHitWindow(this.stats.od).hitWindowFor300());
|
|
56
49
|
this.calculateSkills(speedSkill);
|
|
57
|
-
this.
|
|
58
|
-
this.speed = this.starValue(speedSkill.difficultyValue());
|
|
50
|
+
this.postCalculateSpeed(speedSkill);
|
|
59
51
|
}
|
|
60
52
|
/**
|
|
61
53
|
* Calculates the flashlight star rating of the beatmap and stores it in this instance.
|
|
@@ -103,20 +95,11 @@ class OsuStarRating extends StarRating_1.StarRating {
|
|
|
103
95
|
speedSkill = skills[2];
|
|
104
96
|
flashlightSkill = skills[3];
|
|
105
97
|
}
|
|
106
|
-
this.
|
|
107
|
-
this.strainPeaks.aimWithoutSliders = aimSkillWithoutSliders.strainPeaks;
|
|
108
|
-
this.aim = this.starValue(aimSkill.difficultyValue());
|
|
109
|
-
if (this.aim) {
|
|
110
|
-
this.attributes.sliderFactor =
|
|
111
|
-
this.starValue(aimSkillWithoutSliders.difficultyValue()) /
|
|
112
|
-
this.aim;
|
|
113
|
-
}
|
|
98
|
+
this.postCalculateAim(aimSkill, aimSkillWithoutSliders);
|
|
114
99
|
if (speedSkill) {
|
|
115
|
-
this.
|
|
116
|
-
this.speed = this.starValue(speedSkill.difficultyValue());
|
|
100
|
+
this.postCalculateSpeed(speedSkill);
|
|
117
101
|
}
|
|
118
|
-
this.
|
|
119
|
-
this.flashlight = this.starValue(flashlightSkill.difficultyValue());
|
|
102
|
+
this.postCalculateFlashlight(flashlightSkill);
|
|
120
103
|
this.calculateTotal();
|
|
121
104
|
}
|
|
122
105
|
/**
|
|
@@ -139,9 +122,43 @@ class OsuStarRating extends StarRating_1.StarRating {
|
|
|
139
122
|
return [
|
|
140
123
|
new OsuAim_1.OsuAim(this.mods, true),
|
|
141
124
|
new OsuAim_1.OsuAim(this.mods, false),
|
|
142
|
-
new OsuSpeed_1.
|
|
125
|
+
new OsuSpeed_1.OsuSpeed(this.mods, new osu_base_1.OsuHitWindow(this.stats.od).hitWindowFor300()),
|
|
143
126
|
new OsuFlashlight_1.OsuFlashlight(this.mods),
|
|
144
127
|
];
|
|
145
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Called after aim skill calculation.
|
|
131
|
+
*
|
|
132
|
+
* @param aimSkill The aim skill that considers sliders.
|
|
133
|
+
* @param aimSkillWithoutSliders The aim skill that doesn't consider sliders.
|
|
134
|
+
*/
|
|
135
|
+
postCalculateAim(aimSkill, aimSkillWithoutSliders) {
|
|
136
|
+
this.strainPeaks.aimWithSliders = aimSkill.strainPeaks;
|
|
137
|
+
this.strainPeaks.aimWithoutSliders = aimSkillWithoutSliders.strainPeaks;
|
|
138
|
+
this.aim = this.starValue(aimSkill.difficultyValue());
|
|
139
|
+
if (this.aim) {
|
|
140
|
+
this.attributes.sliderFactor =
|
|
141
|
+
this.starValue(aimSkillWithoutSliders.difficultyValue()) /
|
|
142
|
+
this.aim;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Called after speed skill calculation.
|
|
147
|
+
*
|
|
148
|
+
* @param speedSkill The speed skill.
|
|
149
|
+
*/
|
|
150
|
+
postCalculateSpeed(speedSkill) {
|
|
151
|
+
this.strainPeaks.speed = speedSkill.strainPeaks;
|
|
152
|
+
this.speed = this.starValue(speedSkill.difficultyValue());
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Called after flashlight skill calculation.
|
|
156
|
+
*
|
|
157
|
+
* @param flashlightSkill The flashlight skill.
|
|
158
|
+
*/
|
|
159
|
+
postCalculateFlashlight(flashlightSkill) {
|
|
160
|
+
this.strainPeaks.flashlight = flashlightSkill.strainPeaks;
|
|
161
|
+
this.flashlight = this.starValue(flashlightSkill.difficultyValue());
|
|
162
|
+
}
|
|
146
163
|
}
|
|
147
164
|
exports.OsuStarRating = OsuStarRating;
|
package/dist/base/StarRating.js
CHANGED
package/dist/skills/DroidAim.js
CHANGED
|
@@ -49,7 +49,7 @@ class DroidAim extends DroidSkill_1.DroidSkill {
|
|
|
49
49
|
let currentVelocity = current.lazyJumpDistance / current.strainTime;
|
|
50
50
|
// But if the last object is a slider, then we extend the travel velocity through the slider into the current object.
|
|
51
51
|
if (last.object instanceof osu_base_1.Slider &&
|
|
52
|
-
last.object.ticks >
|
|
52
|
+
last.object.ticks > 0 &&
|
|
53
53
|
this.withSliders) {
|
|
54
54
|
// Calculate the slider velocity from slider head to slider end.
|
|
55
55
|
const travelVelocity = last.travelDistance / last.travelTime;
|
|
@@ -61,7 +61,7 @@ class DroidAim extends DroidSkill_1.DroidSkill {
|
|
|
61
61
|
// As above, do the same for the previous hitobject.
|
|
62
62
|
let prevVelocity = last.lazyJumpDistance / last.strainTime;
|
|
63
63
|
if (lastLast.object instanceof osu_base_1.Slider &&
|
|
64
|
-
lastLast.object.ticks >
|
|
64
|
+
lastLast.object.ticks > 0 &&
|
|
65
65
|
this.withSliders) {
|
|
66
66
|
const travelVelocity = lastLast.travelDistance / lastLast.travelTime;
|
|
67
67
|
const movementVelocity = last.minimumJumpDistance / last.minimumJumpTime;
|
|
@@ -13,8 +13,8 @@ class DroidRhythm extends DroidSkill_1.DroidSkill {
|
|
|
13
13
|
this.skillMultiplier = 1;
|
|
14
14
|
this.reducedSectionCount = 5;
|
|
15
15
|
this.reducedSectionBaseline = 0.75;
|
|
16
|
-
this.strainDecayBase = 0.
|
|
17
|
-
this.starsPerDouble =
|
|
16
|
+
this.strainDecayBase = 0.15;
|
|
17
|
+
this.starsPerDouble = 1.75;
|
|
18
18
|
this.rhythmMultiplier = 0.75;
|
|
19
19
|
this.historyTimeMax = 5000; // 5 seconds of calculateRhythmBonus max.
|
|
20
20
|
this.currentRhythm = 1;
|
|
@@ -55,8 +55,8 @@ class DroidRhythm extends DroidSkill_1.DroidSkill {
|
|
|
55
55
|
(Math.min(prevDelta, currentDelta) /
|
|
56
56
|
Math.max(prevDelta, currentDelta))), 2));
|
|
57
57
|
const windowPenalty = Math.min(1, Math.max(0, Math.abs(prevDelta - currentDelta) -
|
|
58
|
-
this.hitWindow.hitWindowFor300() * 0.
|
|
59
|
-
(this.hitWindow.hitWindowFor300() * 0.
|
|
58
|
+
this.hitWindow.hitWindowFor300() * 0.2) /
|
|
59
|
+
(this.hitWindow.hitWindowFor300() * 0.2));
|
|
60
60
|
let effectiveRatio = windowPenalty * currentRatio;
|
|
61
61
|
if (firstDeltaSwitch) {
|
|
62
62
|
if (prevDelta <= 1.25 * currentDelta &&
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DroidSkill = void 0;
|
|
4
|
+
const osu_base_1 = require("@rian8337/osu-base");
|
|
4
5
|
const StrainSkill_1 = require("../base/StrainSkill");
|
|
5
6
|
/**
|
|
6
7
|
* Used to processes strain values of difficulty hitobjects, keep track of strain levels caused by the processed objects
|
|
@@ -8,9 +9,21 @@ const StrainSkill_1 = require("../base/StrainSkill");
|
|
|
8
9
|
*/
|
|
9
10
|
class DroidSkill extends StrainSkill_1.StrainSkill {
|
|
10
11
|
difficultyValue() {
|
|
12
|
+
const sortedStrains = this.strainPeaks
|
|
13
|
+
.slice()
|
|
14
|
+
.sort((a, b) => {
|
|
15
|
+
return b - a;
|
|
16
|
+
});
|
|
17
|
+
// We are reducing the highest strains first to account for extreme difficulty spikes.
|
|
18
|
+
for (let i = 0; i < Math.min(sortedStrains.length, this.reducedSectionCount); ++i) {
|
|
19
|
+
const scale = Math.log10(osu_base_1.Interpolation.lerp(1, 10, osu_base_1.MathUtils.clamp(i / this.reducedSectionCount, 0, 1)));
|
|
20
|
+
sortedStrains[i] *= osu_base_1.Interpolation.lerp(this.reducedSectionBaseline, 1, scale);
|
|
21
|
+
}
|
|
11
22
|
// Math here preserves the property that two notes of equal difficulty x, we have their summed difficulty = x * starsPerDouble.
|
|
12
23
|
// This also applies to two sets of notes with equal difficulty.
|
|
13
|
-
return Math.pow(
|
|
24
|
+
return Math.pow(sortedStrains
|
|
25
|
+
.filter((v) => v > 0)
|
|
26
|
+
.reduce((a, v) => a + Math.pow(v, 1 / Math.log2(this.starsPerDouble)), 0), Math.log2(this.starsPerDouble));
|
|
14
27
|
}
|
|
15
28
|
}
|
|
16
29
|
exports.DroidSkill = DroidSkill;
|
package/dist/skills/OsuSpeed.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.OsuSpeed = void 0;
|
|
4
4
|
const osu_base_1 = require("@rian8337/osu-base");
|
|
5
5
|
const OsuSkill_1 = require("./OsuSkill");
|
|
6
6
|
/**
|
|
7
7
|
* Represents the skill required to press keys or tap with regards to keeping up with the speed at which objects need to be hit.
|
|
8
8
|
*/
|
|
9
|
-
class
|
|
9
|
+
class OsuSpeed extends OsuSkill_1.OsuSkill {
|
|
10
10
|
constructor(mods, greatWindow) {
|
|
11
11
|
super(mods);
|
|
12
12
|
/**
|
|
@@ -172,4 +172,4 @@ class RebalanceOsuSpeed extends OsuSkill_1.OsuSkill {
|
|
|
172
172
|
current.rhythmMultiplier = this.currentRhythm;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
exports.
|
|
175
|
+
exports.OsuSpeed = OsuSpeed;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rian8337/osu-rebalance-difficulty-calculator",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
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",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "61d7f194d379f06f49fc38e2934c88e8f58f64a1"
|
|
39
39
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -233,7 +233,6 @@ declare module "@rian8337/osu-rebalance-difficulty-calculator" {
|
|
|
233
233
|
* The flashlight performance value.
|
|
234
234
|
*/
|
|
235
235
|
flashlight: number;
|
|
236
|
-
private averageRhythmMultiplier: number;
|
|
237
236
|
override calculate(params: {
|
|
238
237
|
/**
|
|
239
238
|
* The star rating instance to calculate.
|
|
@@ -260,10 +259,6 @@ declare module "@rian8337/osu-rebalance-difficulty-calculator" {
|
|
|
260
259
|
*/
|
|
261
260
|
stats?: MapStats;
|
|
262
261
|
}): this;
|
|
263
|
-
/**
|
|
264
|
-
* Calculates the average rhythm multiplier of the beatmap.
|
|
265
|
-
*/
|
|
266
|
-
private calculateAverageRhythmMultiplier(): void;
|
|
267
262
|
/**
|
|
268
263
|
* Calculates the aim performance value of the beatmap.
|
|
269
264
|
*/
|
|
@@ -280,8 +275,14 @@ declare module "@rian8337/osu-rebalance-difficulty-calculator" {
|
|
|
280
275
|
* Calculates the flashlight performance value of the beatmap.
|
|
281
276
|
*/
|
|
282
277
|
private calculateFlashlightValue(): void;
|
|
283
|
-
private calculateMissPenalty(strainCount: number): number;
|
|
284
278
|
override toString(): string;
|
|
279
|
+
/**
|
|
280
|
+
* Calculates miss penalty.
|
|
281
|
+
*
|
|
282
|
+
* @param difficultStrainCount Difficult strain count from calculation.
|
|
283
|
+
* @returns The miss penalty.
|
|
284
|
+
*/
|
|
285
|
+
private calculateMissPenalty(difficultStrainCount: number): number;
|
|
285
286
|
}
|
|
286
287
|
|
|
287
288
|
/**
|
|
@@ -393,15 +394,37 @@ declare module "@rian8337/osu-rebalance-difficulty-calculator" {
|
|
|
393
394
|
*/
|
|
394
395
|
protected override createSkills(): DroidSkill[];
|
|
395
396
|
/**
|
|
396
|
-
*
|
|
397
|
+
* Called after aim skill calculation.
|
|
398
|
+
*
|
|
399
|
+
* @param aimSkill The aim skill that considers sliders.
|
|
400
|
+
* @param aimSkillWithoutSliders The aim skill that doesn't consider sliders.
|
|
397
401
|
*/
|
|
398
|
-
private
|
|
402
|
+
private postCalculateAim(
|
|
403
|
+
aimSkill: DroidAim,
|
|
404
|
+
aimSkillWithoutSliders: DroidAim
|
|
405
|
+
): void;
|
|
399
406
|
/**
|
|
400
|
-
*
|
|
407
|
+
* Called after tap skill calculation.
|
|
401
408
|
*
|
|
402
|
-
* @param
|
|
409
|
+
* @param tapSkill The tap skill.
|
|
403
410
|
*/
|
|
404
|
-
private
|
|
411
|
+
private postCalculateTap(tapSkill: DroidTap): void;
|
|
412
|
+
/**
|
|
413
|
+
* Calculates speed-related attributes.
|
|
414
|
+
*/
|
|
415
|
+
private calculateSpeedAttributes(): void;
|
|
416
|
+
/**
|
|
417
|
+
* Called after rhythm skill calculation.
|
|
418
|
+
*
|
|
419
|
+
* @param rhythmSkill The rhythm skill.
|
|
420
|
+
*/
|
|
421
|
+
private postCalculateRhythm(rhythmSkill: DroidRhythm): void;
|
|
422
|
+
/**
|
|
423
|
+
* Called after flashlight skill calculation.
|
|
424
|
+
*
|
|
425
|
+
* @param flashlightSkill The flashlight skill.
|
|
426
|
+
*/
|
|
427
|
+
private postCalculateFlashlight(flashlightSkill: DroidFlashlight): void;
|
|
405
428
|
}
|
|
406
429
|
|
|
407
430
|
/**
|
|
@@ -686,17 +709,27 @@ declare module "@rian8337/osu-rebalance-difficulty-calculator" {
|
|
|
686
709
|
*/
|
|
687
710
|
protected override createSkills(): OsuSkill[];
|
|
688
711
|
/**
|
|
689
|
-
*
|
|
712
|
+
* Called after aim skill calculation.
|
|
690
713
|
*
|
|
691
|
-
* @param
|
|
714
|
+
* @param aimSkill The aim skill that considers sliders.
|
|
715
|
+
* @param aimSkillWithoutSliders The aim skill that doesn't consider sliders.
|
|
692
716
|
*/
|
|
693
|
-
private
|
|
717
|
+
private postCalculateAim(
|
|
718
|
+
aimSkill: OsuAim,
|
|
719
|
+
aimSkillWithoutSliders: OsuAim
|
|
720
|
+
): void;
|
|
694
721
|
/**
|
|
695
|
-
*
|
|
722
|
+
* Called after speed skill calculation.
|
|
696
723
|
*
|
|
697
|
-
* @param
|
|
724
|
+
* @param speedSkill The speed skill.
|
|
698
725
|
*/
|
|
699
|
-
private
|
|
726
|
+
private postCalculateSpeed(speedSkill: OsuSpeed): void;
|
|
727
|
+
/**
|
|
728
|
+
* Called after flashlight skill calculation.
|
|
729
|
+
*
|
|
730
|
+
* @param flashlightSkill The flashlight skill.
|
|
731
|
+
*/
|
|
732
|
+
private postCalculateFlashlight(flashlightSkill: OsuFlashlight): void;
|
|
700
733
|
}
|
|
701
734
|
|
|
702
735
|
//#endregion
|
|
@@ -709,6 +742,8 @@ declare module "@rian8337/osu-rebalance-difficulty-calculator" {
|
|
|
709
742
|
export interface DifficultyAttributes {
|
|
710
743
|
speedNoteCount: number;
|
|
711
744
|
sliderFactor: number;
|
|
745
|
+
aimDifficultStrainCount: number;
|
|
746
|
+
speedDifficultStrainCount: number;
|
|
712
747
|
}
|
|
713
748
|
|
|
714
749
|
/**
|
|
@@ -1114,6 +1149,18 @@ declare module "@rian8337/osu-rebalance-difficulty-calculator" {
|
|
|
1114
1149
|
* Creates skills to be calculated.
|
|
1115
1150
|
*/
|
|
1116
1151
|
protected abstract createSkills(): Skill[];
|
|
1152
|
+
/**
|
|
1153
|
+
* Calculates the star rating value of a difficulty.
|
|
1154
|
+
*
|
|
1155
|
+
* @param difficulty The difficulty to calculate.
|
|
1156
|
+
*/
|
|
1157
|
+
protected starValue(difficulty: number): number;
|
|
1158
|
+
/**
|
|
1159
|
+
* Calculates the base performance value of a difficulty rating.
|
|
1160
|
+
*
|
|
1161
|
+
* @param rating The difficulty rating.
|
|
1162
|
+
*/
|
|
1163
|
+
protected basePerformanceValue(rating: number): number;
|
|
1117
1164
|
}
|
|
1118
1165
|
|
|
1119
1166
|
//#endregion
|