@rian8337/osu-rebalance-difficulty-calculator 1.0.2 → 1.0.4
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.
|
@@ -73,18 +73,16 @@ class DroidPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalc
|
|
|
73
73
|
// Combo scaling
|
|
74
74
|
this.aim *= this.comboPenalty;
|
|
75
75
|
// We want to give more reward for lower AR when it comes to aim and HD. This nerfs high AR and buffs lower AR.
|
|
76
|
-
let hiddenBonus = 1;
|
|
77
76
|
if (this.stars.mods.some((m) => m instanceof osu_base_1.ModHidden)) {
|
|
78
77
|
// The bonus starts decreasing twice as fast
|
|
79
78
|
// beyond AR10 and reaches 1 at AR11.
|
|
80
79
|
if (calculatedAR > 10) {
|
|
81
|
-
|
|
80
|
+
this.aim *= 1 + Math.max(0, 0.08 * (11 - calculatedAR));
|
|
82
81
|
}
|
|
83
82
|
else {
|
|
84
|
-
|
|
83
|
+
this.aim *= 1 + 0.04 * (12 - calculatedAR);
|
|
85
84
|
}
|
|
86
85
|
}
|
|
87
|
-
this.aim *= hiddenBonus;
|
|
88
86
|
// AR scaling
|
|
89
87
|
let arFactor = 0;
|
|
90
88
|
if (calculatedAR > 10.33) {
|
|
@@ -121,7 +119,7 @@ class DroidPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalc
|
|
|
121
119
|
// Penalize misses by assessing # of misses relative to the total # of objects. Default a 3% reduction for any # of misses.
|
|
122
120
|
this.tap *=
|
|
123
121
|
0.97 *
|
|
124
|
-
Math.pow(1 - Math.pow(this.effectiveMissCount / objectCount, 0.775), this.effectiveMissCount);
|
|
122
|
+
Math.pow(1 - Math.pow(this.effectiveMissCount / objectCount, 0.775), Math.pow(this.effectiveMissCount, 0.875));
|
|
125
123
|
}
|
|
126
124
|
// Combo scaling
|
|
127
125
|
this.tap *= this.comboPenalty;
|
package/dist/DroidStarRating.js
CHANGED
|
@@ -115,7 +115,7 @@ class DroidStarRating extends StarRating_1.StarRating {
|
|
|
115
115
|
}
|
|
116
116
|
this.calculateSkills(...skills);
|
|
117
117
|
const aimSkill = skills[0];
|
|
118
|
-
const aimSkillWithoutSliders =
|
|
118
|
+
const aimSkillWithoutSliders = skills[1];
|
|
119
119
|
let tapSkill;
|
|
120
120
|
let flashlightSkill;
|
|
121
121
|
if (!isRelax) {
|
|
@@ -77,11 +77,9 @@ class OsuPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalcul
|
|
|
77
77
|
// Buff for longer maps with high AR.
|
|
78
78
|
this.aim *= 1 + arFactor * lengthBonus;
|
|
79
79
|
// We want to give more reward for lower AR when it comes to aim and HD. This nerfs high AR and buffs lower AR.
|
|
80
|
-
let hiddenBonus = 1;
|
|
81
80
|
if (this.stars.mods.some((m) => m instanceof osu_base_1.ModHidden)) {
|
|
82
|
-
|
|
81
|
+
this.aim *= 1 + 0.04 * (12 - calculatedAR);
|
|
83
82
|
}
|
|
84
|
-
this.aim *= hiddenBonus;
|
|
85
83
|
// Scale the aim value with slider factor to nerf very likely dropped sliderends.
|
|
86
84
|
this.aim *= this.sliderNerfFactor;
|
|
87
85
|
// Scale the aim value with accuracy.
|
package/dist/OsuStarRating.js
CHANGED
|
@@ -93,7 +93,7 @@ class OsuStarRating extends StarRating_1.StarRating {
|
|
|
93
93
|
}
|
|
94
94
|
this.calculateSkills(...skills);
|
|
95
95
|
const aimSkill = skills[0];
|
|
96
|
-
const aimSkillWithoutSliders =
|
|
96
|
+
const aimSkillWithoutSliders = skills[1];
|
|
97
97
|
let speedSkill;
|
|
98
98
|
let flashlightSkill;
|
|
99
99
|
if (isRelax) {
|
|
@@ -62,8 +62,9 @@ class PerformanceCalculator {
|
|
|
62
62
|
nmiss: params.miss || 0,
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
+
this.effectiveMissCount = this.calculateEffectiveMissCount(combo, maxCombo);
|
|
65
66
|
if (this.stars.mods.some((m) => m instanceof osu_base_1.ModNoFail)) {
|
|
66
|
-
this.finalMultiplier *= Math.max(0.9, 1 - 0.02 * this.
|
|
67
|
+
this.finalMultiplier *= Math.max(0.9, 1 - 0.02 * this.effectiveMissCount);
|
|
67
68
|
}
|
|
68
69
|
if (this.stars.mods.some((m) => m instanceof osu_base_1.ModSpunOut)) {
|
|
69
70
|
this.finalMultiplier *=
|
|
@@ -71,22 +72,24 @@ class PerformanceCalculator {
|
|
|
71
72
|
Math.pow(this.stars.map.spinners / this.stars.objects.length, 0.85);
|
|
72
73
|
}
|
|
73
74
|
if (this.stars.mods.some((m) => m instanceof osu_base_1.ModRelax)) {
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
// As we're adding 100s and 50s to an approximated number of combo breaks, the result can be higher
|
|
76
|
+
// than total hits in specific scenarios (which breaks some calculations), so we need to clamp it.
|
|
77
|
+
this.effectiveMissCount = Math.min(this.effectiveMissCount +
|
|
78
|
+
this.computedAccuracy.n100 +
|
|
79
|
+
this.computedAccuracy.n50, this.stars.objects.length);
|
|
76
80
|
this.finalMultiplier *= 0.6;
|
|
77
81
|
}
|
|
78
|
-
this.effectiveMissCount = this.calculateEffectiveMissCount(combo, maxCombo);
|
|
79
82
|
this.mapStatistics = new osu_base_1.MapStats({
|
|
80
83
|
ar: baseAR,
|
|
81
84
|
od: baseOD,
|
|
82
85
|
mods: mod,
|
|
83
86
|
});
|
|
84
|
-
// We assume 15% of sliders in a beatmap are difficult since there's no way to tell from the performance calculator.
|
|
85
|
-
const estimateDifficultSliders = this.stars.map.sliders * 0.15;
|
|
86
|
-
const estimateSliderEndsDropped = osu_base_1.MathUtils.clamp(Math.min(this.computedAccuracy.n300 +
|
|
87
|
-
this.computedAccuracy.n50 +
|
|
88
|
-
this.computedAccuracy.nmiss, maxCombo - combo), 0, estimateDifficultSliders);
|
|
89
87
|
if (this.stars.map.sliders > 0) {
|
|
88
|
+
// We assume 15% of sliders in a beatmap are difficult since there's no way to tell from the performance calculator.
|
|
89
|
+
const estimateDifficultSliders = this.stars.map.sliders * 0.15;
|
|
90
|
+
const estimateSliderEndsDropped = osu_base_1.MathUtils.clamp(Math.min(this.computedAccuracy.n300 +
|
|
91
|
+
this.computedAccuracy.n50 +
|
|
92
|
+
this.computedAccuracy.nmiss, maxCombo - combo), 0, estimateDifficultSliders);
|
|
90
93
|
this.sliderNerfFactor =
|
|
91
94
|
(1 - this.stars.attributes.sliderFactor) *
|
|
92
95
|
Math.pow(1 -
|
|
@@ -119,7 +122,7 @@ class PerformanceCalculator {
|
|
|
119
122
|
comboBasedMissCount = Math.min(fullComboThreshold / Math.max(1, combo), this.stars.objects.length);
|
|
120
123
|
}
|
|
121
124
|
}
|
|
122
|
-
return Math.max(this.computedAccuracy.nmiss,
|
|
125
|
+
return Math.max(this.computedAccuracy.nmiss, comboBasedMissCount);
|
|
123
126
|
}
|
|
124
127
|
}
|
|
125
128
|
exports.PerformanceCalculator = PerformanceCalculator;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rian8337/osu-rebalance-difficulty-calculator",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
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",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"url": "https://github.com/Rian8337/osu-droid-module/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@rian8337/osu-base": "^1.0.
|
|
33
|
+
"@rian8337/osu-base": "^1.0.4"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "31e88dedb78e6b1e0123b67bcc5d4dd31f5dfc60"
|
|
39
39
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
declare module "@rian8337/osu-rebalance-difficulty-calculator" {
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Accuracy,
|
|
4
|
+
Beatmap,
|
|
5
|
+
HitObject,
|
|
6
|
+
MapStats,
|
|
7
|
+
Mod,
|
|
8
|
+
modes,
|
|
9
|
+
OsuHitWindow,
|
|
10
|
+
Slider,
|
|
11
|
+
Vector2,
|
|
12
|
+
} from "@rian8337/osu-base";
|
|
3
13
|
|
|
4
14
|
//#region Classes
|
|
5
15
|
|
|
@@ -38,7 +48,7 @@ declare module "@rian8337/osu-rebalance-difficulty-calculator" {
|
|
|
38
48
|
flashlightStrain: number;
|
|
39
49
|
/**
|
|
40
50
|
* The normalized distance from the "lazy" end position of the previous hitobject to the start position of this hitobject.
|
|
41
|
-
*
|
|
51
|
+
*
|
|
42
52
|
* The "lazy" end position is the position at which the cursor ends up if the previous hitobject is followed with as minimal movement as possible (i.e. on the edge of slider follow circles).
|
|
43
53
|
*/
|
|
44
54
|
lazyJumpDistance: number;
|
|
@@ -854,7 +864,10 @@ declare module "@rian8337/osu-rebalance-difficulty-calculator" {
|
|
|
854
864
|
/**
|
|
855
865
|
* Calculates the amount of misses + sliderbreaks from combo.
|
|
856
866
|
*/
|
|
857
|
-
private calculateEffectiveMissCount(
|
|
867
|
+
private calculateEffectiveMissCount(
|
|
868
|
+
combo: number,
|
|
869
|
+
maxCombo: number
|
|
870
|
+
): number;
|
|
858
871
|
}
|
|
859
872
|
|
|
860
873
|
/**
|