@rian8337/osu-rebalance-difficulty-calculator 3.2.1 → 4.0.0-beta.1
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 +170 -92
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/typings/index.d.ts +86 -55
package/dist/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var osuBase = require('@rian8337/osu-base');
|
|
6
4
|
|
|
7
5
|
/**
|
|
@@ -86,7 +84,7 @@ class DifficultyHitObject {
|
|
|
86
84
|
/**
|
|
87
85
|
* The flashlight strain generated by the hitobject if sliders are considered.
|
|
88
86
|
*/
|
|
89
|
-
|
|
87
|
+
flashlightStrainWithSliders = 0;
|
|
90
88
|
/**
|
|
91
89
|
* The flashlight strain generated by the hitobject if sliders are not considered.
|
|
92
90
|
*/
|
|
@@ -94,7 +92,7 @@ class DifficultyHitObject {
|
|
|
94
92
|
/**
|
|
95
93
|
* The visual strain generated by the hitobject if sliders are considered.
|
|
96
94
|
*/
|
|
97
|
-
|
|
95
|
+
visualStrainWithSliders = 0;
|
|
98
96
|
/**
|
|
99
97
|
* The visual strain generated by the hitobject if sliders are not considered.
|
|
100
98
|
*/
|
|
@@ -1159,9 +1157,9 @@ class DroidFlashlightEvaluator extends FlashlightEvaluator {
|
|
|
1159
1157
|
*
|
|
1160
1158
|
* @param current The current object.
|
|
1161
1159
|
* @param isHiddenMod Whether the Hidden mod is enabled.
|
|
1162
|
-
* @param withSliders Whether to take slider difficulty into account.
|
|
1160
|
+
* @param withSliders Whether to take slider difficulty into account.
|
|
1163
1161
|
*/
|
|
1164
|
-
static evaluateDifficultyOf(current, isHiddenMod, withSliders
|
|
1162
|
+
static evaluateDifficultyOf(current, isHiddenMod, withSliders) {
|
|
1165
1163
|
if (current.object instanceof osuBase.Spinner ||
|
|
1166
1164
|
// Exclude overlapping objects that can be tapped at once.
|
|
1167
1165
|
current.isOverlapping(true)) {
|
|
@@ -1242,7 +1240,7 @@ class DroidFlashlight extends DroidSkill {
|
|
|
1242
1240
|
starsPerDouble = 1.05;
|
|
1243
1241
|
isHidden;
|
|
1244
1242
|
withSliders;
|
|
1245
|
-
constructor(mods, withSliders
|
|
1243
|
+
constructor(mods, withSliders) {
|
|
1246
1244
|
super(mods);
|
|
1247
1245
|
this.isHidden = mods.some((m) => m instanceof osuBase.ModHidden);
|
|
1248
1246
|
this.withSliders = withSliders;
|
|
@@ -1258,7 +1256,7 @@ class DroidFlashlight extends DroidSkill {
|
|
|
1258
1256
|
}
|
|
1259
1257
|
saveToHitObject(current) {
|
|
1260
1258
|
if (this.withSliders) {
|
|
1261
|
-
current.
|
|
1259
|
+
current.flashlightStrainWithSliders = this.currentStrain;
|
|
1262
1260
|
}
|
|
1263
1261
|
else {
|
|
1264
1262
|
current.flashlightStrainWithoutSliders = this.currentStrain;
|
|
@@ -1450,9 +1448,9 @@ class DroidVisualEvaluator {
|
|
|
1450
1448
|
*
|
|
1451
1449
|
* @param current The current object.
|
|
1452
1450
|
* @param isHiddenMod Whether the Hidden mod is enabled.
|
|
1453
|
-
* @param withSliders Whether to take slider difficulty into account.
|
|
1451
|
+
* @param withSliders Whether to take slider difficulty into account.
|
|
1454
1452
|
*/
|
|
1455
|
-
static evaluateDifficultyOf(current, isHiddenMod, withSliders
|
|
1453
|
+
static evaluateDifficultyOf(current, isHiddenMod, withSliders) {
|
|
1456
1454
|
if (current.object instanceof osuBase.Spinner ||
|
|
1457
1455
|
// Exclude overlapping objects that can be tapped at once.
|
|
1458
1456
|
current.isOverlapping(true)) {
|
|
@@ -1571,7 +1569,7 @@ class DroidVisual extends DroidSkill {
|
|
|
1571
1569
|
strainDecayBase = 0.1;
|
|
1572
1570
|
isHidden;
|
|
1573
1571
|
withsliders;
|
|
1574
|
-
constructor(mods, withSliders
|
|
1572
|
+
constructor(mods, withSliders) {
|
|
1575
1573
|
super(mods);
|
|
1576
1574
|
this.isHidden = mods.some((m) => m instanceof osuBase.ModHidden);
|
|
1577
1575
|
this.withsliders = withSliders;
|
|
@@ -1584,7 +1582,7 @@ class DroidVisual extends DroidSkill {
|
|
|
1584
1582
|
}
|
|
1585
1583
|
saveToHitObject(current) {
|
|
1586
1584
|
if (this.withsliders) {
|
|
1587
|
-
current.
|
|
1585
|
+
current.visualStrainWithSliders = this.currentStrain;
|
|
1588
1586
|
}
|
|
1589
1587
|
else {
|
|
1590
1588
|
current.visualStrainWithoutSliders = this.currentStrain;
|
|
@@ -1616,6 +1614,12 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1616
1614
|
* The visual star rating of the beatmap.
|
|
1617
1615
|
*/
|
|
1618
1616
|
visual = 0;
|
|
1617
|
+
/**
|
|
1618
|
+
* The strain threshold to start detecting for possible three-fingered section.
|
|
1619
|
+
*
|
|
1620
|
+
* Increasing this number will result in less sections being flagged.
|
|
1621
|
+
*/
|
|
1622
|
+
static threeFingerStrainThreshold = 175;
|
|
1619
1623
|
attributes = {
|
|
1620
1624
|
tapDifficulty: 0,
|
|
1621
1625
|
rhythmDifficulty: 0,
|
|
@@ -1635,6 +1639,8 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1635
1639
|
spinnerCount: 0,
|
|
1636
1640
|
flashlightSliderFactor: 0,
|
|
1637
1641
|
visualSliderFactor: 0,
|
|
1642
|
+
possibleThreeFingeredSections: [],
|
|
1643
|
+
difficultSliders: [],
|
|
1638
1644
|
};
|
|
1639
1645
|
difficultyMultiplier = 0.18;
|
|
1640
1646
|
mode = osuBase.Modes.droid;
|
|
@@ -1655,6 +1661,7 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1655
1661
|
this.calculateSkills(tapSkill);
|
|
1656
1662
|
if (this.mods.some((m) => m instanceof osuBase.ModRelax)) {
|
|
1657
1663
|
this.tap = this.attributes.tapDifficulty = 0;
|
|
1664
|
+
this.attributes.possibleThreeFingeredSections = [];
|
|
1658
1665
|
}
|
|
1659
1666
|
else {
|
|
1660
1667
|
this.postCalculateTap(tapSkill);
|
|
@@ -1813,11 +1820,37 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1813
1820
|
* Calculates aim-related attributes.
|
|
1814
1821
|
*/
|
|
1815
1822
|
calculateAimAttributes() {
|
|
1816
|
-
const objectStrains =
|
|
1817
|
-
|
|
1823
|
+
const objectStrains = [];
|
|
1824
|
+
let maxStrain = 0;
|
|
1825
|
+
// Take the top 15% most difficult sliders based on velocity.
|
|
1826
|
+
const topDifficultSliders = [];
|
|
1827
|
+
for (let i = 0; i < this.objects.length; ++i) {
|
|
1828
|
+
const object = this.objects[i];
|
|
1829
|
+
objectStrains.push(object.aimStrainWithSliders);
|
|
1830
|
+
maxStrain = Math.max(maxStrain, object.aimStrainWithSliders);
|
|
1831
|
+
const velocity = object.travelDistance / object.travelTime;
|
|
1832
|
+
if (velocity > 0) {
|
|
1833
|
+
topDifficultSliders.push({
|
|
1834
|
+
index: i,
|
|
1835
|
+
velocity: velocity,
|
|
1836
|
+
});
|
|
1837
|
+
topDifficultSliders.sort((a, b) => b.velocity - a.velocity);
|
|
1838
|
+
while (topDifficultSliders.length >
|
|
1839
|
+
Math.ceil(0.15 * this.beatmap.hitObjects.sliders)) {
|
|
1840
|
+
topDifficultSliders.pop();
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1818
1844
|
if (maxStrain) {
|
|
1819
1845
|
this.attributes.aimNoteCount = objectStrains.reduce((total, next) => total + 1 / (1 + Math.exp(-((next / maxStrain) * 12 - 6))), 0);
|
|
1820
1846
|
}
|
|
1847
|
+
const velocitySum = topDifficultSliders.reduce((a, v) => a + v.velocity, 0);
|
|
1848
|
+
for (const slider of topDifficultSliders) {
|
|
1849
|
+
this.attributes.difficultSliders.push({
|
|
1850
|
+
index: slider.index,
|
|
1851
|
+
difficultyRating: slider.velocity / velocitySum,
|
|
1852
|
+
});
|
|
1853
|
+
}
|
|
1821
1854
|
}
|
|
1822
1855
|
/**
|
|
1823
1856
|
* Called after tap skill calculation.
|
|
@@ -1832,12 +1865,92 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1832
1865
|
* Calculates speed-related attributes.
|
|
1833
1866
|
*/
|
|
1834
1867
|
calculateSpeedAttributes() {
|
|
1835
|
-
|
|
1836
|
-
const
|
|
1868
|
+
this.attributes.possibleThreeFingeredSections = [];
|
|
1869
|
+
const tempSections = [];
|
|
1870
|
+
const objectStrains = [];
|
|
1871
|
+
let maxStrain = 0;
|
|
1872
|
+
const maxSectionDeltaTime = 2000;
|
|
1873
|
+
const minSectionObjectCount = 5;
|
|
1874
|
+
let firstObjectIndex = 0;
|
|
1875
|
+
for (let i = 0; i < this.objects.length - 1; ++i) {
|
|
1876
|
+
const current = this.objects[i];
|
|
1877
|
+
const next = this.objects[i + 1];
|
|
1878
|
+
if (i === 0) {
|
|
1879
|
+
objectStrains.push(current.tapStrain);
|
|
1880
|
+
}
|
|
1881
|
+
objectStrains.push(next.tapStrain);
|
|
1882
|
+
maxStrain = Math.max(current.tapStrain, maxStrain);
|
|
1883
|
+
const realDeltaTime = next.object.startTime - current.object.endTime;
|
|
1884
|
+
if (realDeltaTime >= maxSectionDeltaTime) {
|
|
1885
|
+
// Ignore sections that don't meet object count requirement.
|
|
1886
|
+
if (i - firstObjectIndex < minSectionObjectCount) {
|
|
1887
|
+
firstObjectIndex = i + 1;
|
|
1888
|
+
continue;
|
|
1889
|
+
}
|
|
1890
|
+
tempSections.push({
|
|
1891
|
+
firstObjectIndex,
|
|
1892
|
+
lastObjectIndex: i,
|
|
1893
|
+
});
|
|
1894
|
+
firstObjectIndex = i + 1;
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
// Don't forget to manually add the last beatmap section, which would otherwise be ignored.
|
|
1898
|
+
if (this.objects.length - firstObjectIndex > minSectionObjectCount) {
|
|
1899
|
+
tempSections.push({
|
|
1900
|
+
firstObjectIndex,
|
|
1901
|
+
lastObjectIndex: this.objects.length - 1,
|
|
1902
|
+
});
|
|
1903
|
+
}
|
|
1904
|
+
// Refilter with tap strain in mind.
|
|
1905
|
+
const { threeFingerStrainThreshold } = DroidDifficultyCalculator;
|
|
1906
|
+
for (const section of tempSections) {
|
|
1907
|
+
let inSpeedSection = false;
|
|
1908
|
+
let newFirstObjectIndex = section.firstObjectIndex;
|
|
1909
|
+
for (let i = section.firstObjectIndex; i <= section.lastObjectIndex; ++i) {
|
|
1910
|
+
const current = this.objects[i];
|
|
1911
|
+
if (!inSpeedSection &&
|
|
1912
|
+
current.originalTapStrain >= threeFingerStrainThreshold) {
|
|
1913
|
+
inSpeedSection = true;
|
|
1914
|
+
newFirstObjectIndex = i;
|
|
1915
|
+
continue;
|
|
1916
|
+
}
|
|
1917
|
+
if (inSpeedSection &&
|
|
1918
|
+
current.originalTapStrain < threeFingerStrainThreshold) {
|
|
1919
|
+
inSpeedSection = false;
|
|
1920
|
+
this.attributes.possibleThreeFingeredSections.push({
|
|
1921
|
+
firstObjectIndex: newFirstObjectIndex,
|
|
1922
|
+
lastObjectIndex: i,
|
|
1923
|
+
sumStrain: this.calculateThreeFingerSummedStrain(newFirstObjectIndex, i),
|
|
1924
|
+
});
|
|
1925
|
+
}
|
|
1926
|
+
}
|
|
1927
|
+
// Don't forget to manually add the last beatmap section, which would otherwise be ignored.
|
|
1928
|
+
if (inSpeedSection) {
|
|
1929
|
+
this.attributes.possibleThreeFingeredSections.push({
|
|
1930
|
+
firstObjectIndex: newFirstObjectIndex,
|
|
1931
|
+
lastObjectIndex: section.lastObjectIndex,
|
|
1932
|
+
sumStrain: this.calculateThreeFingerSummedStrain(newFirstObjectIndex, section.lastObjectIndex),
|
|
1933
|
+
});
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1837
1936
|
if (maxStrain) {
|
|
1838
1937
|
this.attributes.speedNoteCount = objectStrains.reduce((total, next) => total + 1 / (1 + Math.exp(-((next / maxStrain) * 12 - 6))), 0);
|
|
1839
1938
|
}
|
|
1840
1939
|
}
|
|
1940
|
+
/**
|
|
1941
|
+
* Calculates the sum of strains for possible three-fingered sections.
|
|
1942
|
+
*
|
|
1943
|
+
* @param firstObjectIndex The index of the first object in the section.
|
|
1944
|
+
* @param lastObjectIndex The index of the last object in the section.
|
|
1945
|
+
* @returns The summed strain of the section.
|
|
1946
|
+
*/
|
|
1947
|
+
calculateThreeFingerSummedStrain(firstObjectIndex, lastObjectIndex) {
|
|
1948
|
+
return Math.pow(this.objects
|
|
1949
|
+
.slice(firstObjectIndex, lastObjectIndex)
|
|
1950
|
+
.reduce((a, v) => a +
|
|
1951
|
+
v.originalTapStrain /
|
|
1952
|
+
DroidDifficultyCalculator.threeFingerStrainThreshold, 0), 0.75);
|
|
1953
|
+
}
|
|
1841
1954
|
/**
|
|
1842
1955
|
* Called after rhythm skill calculation.
|
|
1843
1956
|
*
|
|
@@ -2018,6 +2131,7 @@ class PerformanceCalculator {
|
|
|
2018
2131
|
* Calculates the amount of misses + sliderbreaks from combo.
|
|
2019
2132
|
*/
|
|
2020
2133
|
calculateEffectiveMissCount(combo, maxCombo) {
|
|
2134
|
+
// Guess the number of misses + slider breaks from combo.
|
|
2021
2135
|
let comboBasedMissCount = 0;
|
|
2022
2136
|
if (this.difficultyAttributes.sliderCount > 0) {
|
|
2023
2137
|
const fullComboThreshold = maxCombo - 0.1 * this.difficultyAttributes.sliderCount;
|
|
@@ -2076,33 +2190,6 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2076
2190
|
get tapDeviation() {
|
|
2077
2191
|
return this._tapDeviation;
|
|
2078
2192
|
}
|
|
2079
|
-
/**
|
|
2080
|
-
* The "true" deviation ability of the score.
|
|
2081
|
-
*
|
|
2082
|
-
* This is estimated from deviation with respect to the amount of circles of the beatmap. Using
|
|
2083
|
-
* {@link https://en.wikipedia.org/wiki/Hypergeometric_distribution hypergeometric distribution},
|
|
2084
|
-
* the amount of retries required to get a "desired run" in a beatmap is estimated.
|
|
2085
|
-
*
|
|
2086
|
-
* The metric is then used to estimate the "true" deviation ability of the player using the
|
|
2087
|
-
* {@link https://en.wikipedia.org/wiki/Quantile_function inverse cumulative density function} of
|
|
2088
|
-
* {@link https://en.wikipedia.org/wiki/Normal_distribution Gaussian distribution}.
|
|
2089
|
-
*/
|
|
2090
|
-
get deviationAbility() {
|
|
2091
|
-
return this._deviationAbility;
|
|
2092
|
-
}
|
|
2093
|
-
/**
|
|
2094
|
-
* The "true" tap deviation ability of the score.
|
|
2095
|
-
*
|
|
2096
|
-
* This is estimated from deviation with respect to the amount of circles of the beatmap. Using
|
|
2097
|
-
* {@link https://en.wikipedia.org/wiki/Hypergeometric_distribution hypergeometric distribution},
|
|
2098
|
-
* the amount of retries required to get a "desired run" in a beatmap is estimated, which is then
|
|
2099
|
-
* used to estimate the "true" deviation ability of the player using the
|
|
2100
|
-
* {@link https://en.wikipedia.org/wiki/Quantile_function inverse cumulative density function} of
|
|
2101
|
-
* {@link https://en.wikipedia.org/wiki/Normal_distribution Gaussian distribution}.
|
|
2102
|
-
*/
|
|
2103
|
-
get tapDeviationAbility() {
|
|
2104
|
-
return this._tapDeviationAbility;
|
|
2105
|
-
}
|
|
2106
2193
|
/**
|
|
2107
2194
|
* The penalty used to penalize the aim performance value.
|
|
2108
2195
|
*
|
|
@@ -2136,8 +2223,6 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2136
2223
|
_tapPenalty = 1;
|
|
2137
2224
|
_deviation = 0;
|
|
2138
2225
|
_tapDeviation = 0;
|
|
2139
|
-
_deviationAbility = 0;
|
|
2140
|
-
_tapDeviationAbility = 0;
|
|
2141
2226
|
/**
|
|
2142
2227
|
* @param difficultyAttributes The difficulty attributes to calculate.
|
|
2143
2228
|
*/
|
|
@@ -2150,11 +2235,11 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2150
2235
|
*
|
|
2151
2236
|
* The tap and total performance value will be recalculated afterwards.
|
|
2152
2237
|
*
|
|
2153
|
-
* @param value The tap penalty value. Must be greater than
|
|
2238
|
+
* @param value The tap penalty value. Must be greater than or equal to 1.
|
|
2154
2239
|
*/
|
|
2155
2240
|
applyTapPenalty(value) {
|
|
2156
|
-
if (value
|
|
2157
|
-
throw new RangeError("New tap penalty must be greater than
|
|
2241
|
+
if (value < 1) {
|
|
2242
|
+
throw new RangeError("New tap penalty must be greater than or equal to one.");
|
|
2158
2243
|
}
|
|
2159
2244
|
if (value === this._tapPenalty) {
|
|
2160
2245
|
return;
|
|
@@ -2168,17 +2253,20 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2168
2253
|
*
|
|
2169
2254
|
* The aim and total performance value will be recalculated afterwards.
|
|
2170
2255
|
*
|
|
2171
|
-
* @param value The slider cheese penalty value. Must be
|
|
2256
|
+
* @param value The slider cheese penalty value. Must be between than 0 (exclusive) and 1 (inclusive).
|
|
2172
2257
|
*/
|
|
2173
2258
|
applyAimSliderCheesePenalty(value) {
|
|
2174
2259
|
if (value <= 0) {
|
|
2175
2260
|
throw new RangeError("New aim slider cheese penalty must be greater than zero.");
|
|
2176
2261
|
}
|
|
2262
|
+
if (value > 1) {
|
|
2263
|
+
throw new RangeError("New aim slider cheese penalty must be less than or equal to one.");
|
|
2264
|
+
}
|
|
2177
2265
|
if (value === this._aimSliderCheesePenalty) {
|
|
2178
2266
|
return;
|
|
2179
2267
|
}
|
|
2268
|
+
this.aim *= value / this._aimSliderCheesePenalty;
|
|
2180
2269
|
this._aimSliderCheesePenalty = value;
|
|
2181
|
-
this.calculateAimValue();
|
|
2182
2270
|
this.calculateTotalValue();
|
|
2183
2271
|
}
|
|
2184
2272
|
/**
|
|
@@ -2186,17 +2274,20 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2186
2274
|
*
|
|
2187
2275
|
* The flashlight and total performance value will be recalculated afterwards.
|
|
2188
2276
|
*
|
|
2189
|
-
* @param value The slider cheese penalty value. Must be
|
|
2277
|
+
* @param value The slider cheese penalty value. Must be between 0 (exclusive) and 1 (inclusive).
|
|
2190
2278
|
*/
|
|
2191
2279
|
applyFlashlightSliderCheesePenalty(value) {
|
|
2192
2280
|
if (value <= 0) {
|
|
2193
2281
|
throw new RangeError("New flashlight slider cheese penalty must be greater than zero.");
|
|
2194
2282
|
}
|
|
2283
|
+
if (value > 1) {
|
|
2284
|
+
throw new RangeError("New flashlight slider cheese penalty must be less than or equal to one.");
|
|
2285
|
+
}
|
|
2195
2286
|
if (value === this._flashlightSliderCheesePenalty) {
|
|
2196
2287
|
return;
|
|
2197
2288
|
}
|
|
2289
|
+
this.flashlight *= value / this._flashlightSliderCheesePenalty;
|
|
2198
2290
|
this._flashlightSliderCheesePenalty = value;
|
|
2199
|
-
this.calculateFlashlightValue();
|
|
2200
2291
|
this.calculateTotalValue();
|
|
2201
2292
|
}
|
|
2202
2293
|
/**
|
|
@@ -2204,24 +2295,25 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2204
2295
|
*
|
|
2205
2296
|
* The visual and total performance value will be recalculated afterwards.
|
|
2206
2297
|
*
|
|
2207
|
-
* @param value The slider cheese penalty value. Must be
|
|
2298
|
+
* @param value The slider cheese penalty value. Must be between 0 (exclusive) and 1 (inclusive).
|
|
2208
2299
|
*/
|
|
2209
2300
|
applyVisualSliderCheesePenalty(value) {
|
|
2210
2301
|
if (value <= 0) {
|
|
2211
2302
|
throw new RangeError("New visual slider cheese penalty must be greater than zero.");
|
|
2212
2303
|
}
|
|
2304
|
+
if (value > 1) {
|
|
2305
|
+
throw new RangeError("New visual slider cheese penalty must be less than or equal to one.");
|
|
2306
|
+
}
|
|
2213
2307
|
if (value === this._visualSliderCheesePenalty) {
|
|
2214
2308
|
return;
|
|
2215
2309
|
}
|
|
2310
|
+
this.visual *= value / this._visualSliderCheesePenalty;
|
|
2216
2311
|
this._visualSliderCheesePenalty = value;
|
|
2217
|
-
this.calculateVisualValue();
|
|
2218
2312
|
this.calculateTotalValue();
|
|
2219
2313
|
}
|
|
2220
2314
|
calculateValues() {
|
|
2221
2315
|
this._deviation = this.calculateDeviation();
|
|
2222
2316
|
this._tapDeviation = this.calculateTapDeviation();
|
|
2223
|
-
this._deviationAbility = this.calculateDeviationAbility(this._deviation);
|
|
2224
|
-
this._tapDeviationAbility = this.calculateDeviationAbility(this._tapDeviation);
|
|
2225
2317
|
this.calculateAimValue();
|
|
2226
2318
|
this.calculateTapValue();
|
|
2227
2319
|
this.calculateAccuracyValue();
|
|
@@ -2249,8 +2341,7 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2249
2341
|
* Calculates the aim performance value of the beatmap.
|
|
2250
2342
|
*/
|
|
2251
2343
|
calculateAimValue() {
|
|
2252
|
-
this.aim = this.baseValue(Math.pow(this.difficultyAttributes.aimDifficulty
|
|
2253
|
-
this._aimSliderCheesePenalty, 0.8));
|
|
2344
|
+
this.aim = this.baseValue(Math.pow(this.difficultyAttributes.aimDifficulty, 0.8));
|
|
2254
2345
|
if (this.effectiveMissCount > 0) {
|
|
2255
2346
|
// Penalize misses by assessing # of misses relative to the total # of objects.
|
|
2256
2347
|
// Default a 3% reduction for any # of misses.
|
|
@@ -2263,10 +2354,12 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2263
2354
|
this.aim *= this.comboPenalty;
|
|
2264
2355
|
// Scale the aim value with slider factor to nerf very likely dropped sliderends.
|
|
2265
2356
|
this.aim *= this.sliderNerfFactor;
|
|
2357
|
+
// Scale the aim value with slider cheese penalty.
|
|
2358
|
+
this.aim *= this._aimSliderCheesePenalty;
|
|
2266
2359
|
// Scale the aim value with deviation.
|
|
2267
2360
|
this.aim *=
|
|
2268
2361
|
1.05 *
|
|
2269
|
-
Math.pow(osuBase.ErrorFunction.erf(32.0625 / (Math.SQRT2 * this.
|
|
2362
|
+
Math.pow(osuBase.ErrorFunction.erf(32.0625 / (Math.SQRT2 * this._deviation)), 1.5);
|
|
2270
2363
|
}
|
|
2271
2364
|
/**
|
|
2272
2365
|
* Calculates the tap performance value of the beatmap.
|
|
@@ -2286,7 +2379,7 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2286
2379
|
// Scale the tap value with tap deviation.
|
|
2287
2380
|
this.tap *=
|
|
2288
2381
|
1.1 *
|
|
2289
|
-
Math.pow(osuBase.ErrorFunction.erf(25 / (Math.SQRT2 * this.
|
|
2382
|
+
Math.pow(osuBase.ErrorFunction.erf(25 / (Math.SQRT2 * this._tapDeviation)), 1.25);
|
|
2290
2383
|
// Scale the tap value with three-fingered penalty.
|
|
2291
2384
|
this.tap /= this._tapPenalty;
|
|
2292
2385
|
}
|
|
@@ -2301,9 +2394,14 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2301
2394
|
}
|
|
2302
2395
|
this.accuracy =
|
|
2303
2396
|
650 *
|
|
2304
|
-
Math.exp(-0.125 * this.
|
|
2397
|
+
Math.exp(-0.125 * this._deviation) *
|
|
2305
2398
|
// The following function is to give higher reward for deviations lower than 25 (250 UR).
|
|
2306
|
-
(15 / (this.
|
|
2399
|
+
(15 / (this._deviation + 15) + 0.65);
|
|
2400
|
+
// Bonus for many hitcircles - it's harder to keep good accuracy up for longer.
|
|
2401
|
+
const ncircles = this.difficultyAttributes.mods.some((m) => m instanceof osuBase.ModScoreV2)
|
|
2402
|
+
? this.totalHits - this.difficultyAttributes.spinnerCount
|
|
2403
|
+
: this.difficultyAttributes.hitCircleCount;
|
|
2404
|
+
this.accuracy *= Math.min(1.15, Math.sqrt(Math.log(1 + ((Math.E - 1) * ncircles) / 1000)));
|
|
2307
2405
|
// Scale the accuracy value with rhythm complexity.
|
|
2308
2406
|
this.accuracy *=
|
|
2309
2407
|
1.5 /
|
|
@@ -2322,8 +2420,7 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2322
2420
|
return;
|
|
2323
2421
|
}
|
|
2324
2422
|
this.flashlight =
|
|
2325
|
-
Math.pow(this.difficultyAttributes.flashlightDifficulty
|
|
2326
|
-
this._flashlightSliderCheesePenalty, 1.6) * 25;
|
|
2423
|
+
Math.pow(this.difficultyAttributes.flashlightDifficulty, 1.6) * 25;
|
|
2327
2424
|
// Combo scaling
|
|
2328
2425
|
this.flashlight *= this.comboPenalty;
|
|
2329
2426
|
if (this.effectiveMissCount > 0) {
|
|
@@ -2340,16 +2437,17 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2340
2437
|
(this.totalHits > 200
|
|
2341
2438
|
? 0.2 * Math.min(1, (this.totalHits - 200) / 200)
|
|
2342
2439
|
: 0);
|
|
2440
|
+
// Scale the flashlight value with slider cheese penalty.
|
|
2441
|
+
this.flashlight *= this._flashlightSliderCheesePenalty;
|
|
2343
2442
|
// Scale the flashlight value with deviation.
|
|
2344
|
-
this.flashlight *= osuBase.ErrorFunction.erf(50 / (Math.SQRT2 * this.
|
|
2443
|
+
this.flashlight *= osuBase.ErrorFunction.erf(50 / (Math.SQRT2 * this._deviation));
|
|
2345
2444
|
}
|
|
2346
2445
|
/**
|
|
2347
2446
|
* Calculates the visual performance value of the beatmap.
|
|
2348
2447
|
*/
|
|
2349
2448
|
calculateVisualValue() {
|
|
2350
2449
|
this.visual =
|
|
2351
|
-
Math.pow(this.difficultyAttributes.visualDifficulty
|
|
2352
|
-
this._visualSliderCheesePenalty, 1.6) * 22.5;
|
|
2450
|
+
Math.pow(this.difficultyAttributes.visualDifficulty, 1.6) * 22.5;
|
|
2353
2451
|
if (this.effectiveMissCount > 0) {
|
|
2354
2452
|
// Penalize misses by assessing # of misses relative to the total # of objects. Default a 3% reduction for any # of misses.
|
|
2355
2453
|
this.visual *=
|
|
@@ -2363,10 +2461,12 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2363
2461
|
this.visual *= Math.min(1, 1.650668 +
|
|
2364
2462
|
(0.4845796 - 1.650668) /
|
|
2365
2463
|
(1 + Math.pow(this.totalHits / 817.9306, 1.147469)));
|
|
2464
|
+
// Scale the visual value with slider cheese penalty.
|
|
2465
|
+
this.visual *= this._visualSliderCheesePenalty;
|
|
2366
2466
|
// Scale the visual value with deviation.
|
|
2367
2467
|
this.visual *=
|
|
2368
2468
|
1.065 *
|
|
2369
|
-
Math.pow(osuBase.ErrorFunction.erf(30 / (Math.SQRT2 * this.
|
|
2469
|
+
Math.pow(osuBase.ErrorFunction.erf(30 / (Math.SQRT2 * this._deviation)), 1.75);
|
|
2370
2470
|
}
|
|
2371
2471
|
/**
|
|
2372
2472
|
* Estimates the player's tap deviation based on the OD, number of circles and sliders,
|
|
@@ -2435,32 +2535,12 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2435
2535
|
const hitWindow300 = new osuBase.OsuHitWindow(this.difficultyAttributes.overallDifficulty).hitWindowFor300();
|
|
2436
2536
|
const relevantTotalDiff = this.totalHits - this.difficultyAttributes.speedNoteCount;
|
|
2437
2537
|
const relevantCountGreat = Math.max(0, this.computedAccuracy.n300 - relevantTotalDiff);
|
|
2438
|
-
if (relevantCountGreat
|
|
2538
|
+
if (relevantCountGreat === 0) {
|
|
2439
2539
|
return Number.POSITIVE_INFINITY;
|
|
2440
2540
|
}
|
|
2441
2541
|
const greatProbability = relevantCountGreat / (this.difficultyAttributes.speedNoteCount + 1);
|
|
2442
2542
|
return (hitWindow300 / (Math.SQRT2 * osuBase.ErrorFunction.erfInv(greatProbability)));
|
|
2443
2543
|
}
|
|
2444
|
-
/**
|
|
2445
|
-
* Estimates the player's "true UR ability".
|
|
2446
|
-
*
|
|
2447
|
-
* This is done by estimating the expected number of retries required to
|
|
2448
|
-
* get a "desired run" under a hypergeometric distribution, which is then used
|
|
2449
|
-
* to estimate the player's "true UR ability" with beatmap statistics in mind.
|
|
2450
|
-
*
|
|
2451
|
-
* @param deviation The deviation of the score.
|
|
2452
|
-
*/
|
|
2453
|
-
calculateDeviationAbility(deviation) {
|
|
2454
|
-
const accuracyHits = this.difficultyAttributes.mods.some((m) => m instanceof osuBase.ModScoreV2)
|
|
2455
|
-
? this.totalHits - this.difficultyAttributes.spinnerCount
|
|
2456
|
-
: this.difficultyAttributes.hitCircleCount;
|
|
2457
|
-
// It is assumed for a worst case scenario that a player will "retry" a map 25000/n times where n is the circle count.
|
|
2458
|
-
// This is the expected significance level of a score a player will achieve after retrying that amount.
|
|
2459
|
-
// As an example, for a beatmap with 100 circles, the significance level is 0.996015936255, meaning
|
|
2460
|
-
// that we expect a player to realistically "go for" a score that beats out 99.6% of their scores.
|
|
2461
|
-
const expectedRetries = 1 - 1 / (Math.max(1, 25000 / accuracyHits) + 1);
|
|
2462
|
-
return osuBase.NormalDistribution.invCDF(deviation, deviation / Math.sqrt(2 * accuracyHits), expectedRetries);
|
|
2463
|
-
}
|
|
2464
2544
|
toString() {
|
|
2465
2545
|
return (this.total.toFixed(2) +
|
|
2466
2546
|
" pp (" +
|
|
@@ -2854,8 +2934,6 @@ class OsuSpeed extends OsuSkill {
|
|
|
2854
2934
|
decayWeight = 0.9;
|
|
2855
2935
|
currentSpeedStrain = 0;
|
|
2856
2936
|
currentRhythm = 0;
|
|
2857
|
-
// ~200 1/4 BPM streams
|
|
2858
|
-
minSpeedBonus = 75;
|
|
2859
2937
|
greatWindow;
|
|
2860
2938
|
constructor(mods, greatWindow) {
|
|
2861
2939
|
super(mods);
|
|
@@ -2987,7 +3065,7 @@ class OsuFlashlight extends OsuSkill {
|
|
|
2987
3065
|
return this.currentStrain;
|
|
2988
3066
|
}
|
|
2989
3067
|
saveToHitObject(current) {
|
|
2990
|
-
current.
|
|
3068
|
+
current.flashlightStrainWithSliders = this.currentStrain;
|
|
2991
3069
|
}
|
|
2992
3070
|
}
|
|
2993
3071
|
|