@rian8337/osu-difficulty-calculator 4.0.0-beta.75 → 4.0.0-beta.77

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 CHANGED
@@ -849,15 +849,18 @@ class DroidAimEvaluator {
849
849
  * Calculates the flow aim strain of a hitobject.
850
850
  */
851
851
  static flowAimStrainOf(current) {
852
- var _a, _b;
852
+ var _a;
853
853
  let speedBonus = 1;
854
854
  if (current.strainTime < this.minSpeedBonus) {
855
855
  speedBonus +=
856
856
  0.75 *
857
857
  Math.pow((this.minSpeedBonus - current.strainTime) / 40, 2);
858
858
  }
859
- const travelDistance = (_b = (_a = current.previous(0)) === null || _a === void 0 ? void 0 : _a.travelDistance) !== null && _b !== void 0 ? _b : 0;
860
- const shortDistancePenalty = Math.pow(Math.min(this.singleSpacingThreshold, travelDistance + current.minimumJumpDistance) / this.singleSpacingThreshold, 3.5);
859
+ const prev = current.previous(0);
860
+ // Punish low spacing as it is easier to aim.
861
+ const travelDistance = (_a = prev === null || prev === void 0 ? void 0 : prev.travelDistance) !== null && _a !== void 0 ? _a : 0;
862
+ const distance = travelDistance + current.minimumJumpDistance;
863
+ const shortDistancePenalty = Math.min(1, Math.pow(distance / this.singleSpacingThreshold, 3.5));
861
864
  return (200 * speedBonus * shortDistancePenalty) / current.strainTime;
862
865
  }
863
866
  static calculateWideAngleBonus(angle) {
@@ -872,7 +875,7 @@ DroidAimEvaluator.acuteAngleMultiplier = 2.6;
872
875
  DroidAimEvaluator.sliderMultiplier = 1.35;
873
876
  DroidAimEvaluator.velocityChangeMultiplier = 0.75;
874
877
  DroidAimEvaluator.wiggleMultiplier = 1.02;
875
- DroidAimEvaluator.singleSpacingThreshold = 100;
878
+ DroidAimEvaluator.singleSpacingThreshold = DroidDifficultyHitObject.normalizedDiameter;
876
879
  // 200 1/4 BPM delta time
877
880
  DroidAimEvaluator.minSpeedBonus = 75;
878
881
 
@@ -1028,7 +1031,7 @@ class DroidAim extends DroidSkill {
1028
1031
  this.reducedSectionCount = 10;
1029
1032
  this.reducedSectionBaseline = 0.75;
1030
1033
  this.starsPerDouble = 1.05;
1031
- this.skillMultiplier = 25.6;
1034
+ this.skillMultiplier = 26.5;
1032
1035
  this.currentAimStrain = 0;
1033
1036
  this.sliderStrains = [];
1034
1037
  this.withSliders = withSliders;
@@ -1230,7 +1233,7 @@ class DroidFlashlight extends DroidSkill {
1230
1233
  this.reducedSectionCount = 0;
1231
1234
  this.reducedSectionBaseline = 1;
1232
1235
  this.starsPerDouble = 1.06;
1233
- this.skillMultiplier = 0.02;
1236
+ this.skillMultiplier = 0.023;
1234
1237
  this.currentFlashlightStrain = 0;
1235
1238
  this.withSliders = withSliders;
1236
1239
  }
@@ -1501,7 +1504,6 @@ class DroidTapEvaluator {
1501
1504
  * - and the strain time cap.
1502
1505
  *
1503
1506
  * @param current The current object.
1504
- * @param greatWindow The great hit window of the current object.
1505
1507
  * @param considerCheesability Whether to consider cheesability.
1506
1508
  * @param strainTimeCap The strain time to cap the object's strain time to.
1507
1509
  */
@@ -1511,7 +1513,6 @@ class DroidTapEvaluator {
1511
1513
  current.isOverlapping(false)) {
1512
1514
  return 0;
1513
1515
  }
1514
- // Nerf doubletappable doubles.
1515
1516
  const doubletapness = considerCheesability
1516
1517
  ? 1 - current.doubletapness
1517
1518
  : 1;
@@ -1646,7 +1647,7 @@ class DroidVisualEvaluator {
1646
1647
  current.index === 0) {
1647
1648
  return 0;
1648
1649
  }
1649
- // Start with base density and give global bonus for Hidden and Traceable.
1650
+ // Start with base density and give global bonus for Hidden.
1650
1651
  // Add density caps for sanity.
1651
1652
  let strain;
1652
1653
  if (mods.has(osuBase.ModHidden)) {
@@ -1737,7 +1738,7 @@ class DroidVisual extends DroidSkill {
1737
1738
  this.strainDecayBase = 0.1;
1738
1739
  this.currentVisualStrain = 0;
1739
1740
  this.currentRhythmMultiplier = 1;
1740
- this.skillMultiplier = 10;
1741
+ this.skillMultiplier = 11.2;
1741
1742
  this.withSliders = withSliders;
1742
1743
  }
1743
1744
  strainValueAt(current) {
@@ -2219,43 +2220,26 @@ class PerformanceCalculator {
2219
2220
  this.computedAccuracy.n100 * n100Multiplier +
2220
2221
  this.computedAccuracy.n50 * n50Multiplier, this.totalHits);
2221
2222
  }
2222
- const { sliderCount, sliderFactor, aimDifficultSliderCount } = this.difficultyAttributes;
2223
- if (sliderCount > 0) {
2224
- if (this.mode === osuBase.Modes.droid) {
2225
- // We assume 15% of sliders in a beatmap are difficult since there's no way to tell from the performance calculator.
2226
- const estimateDifficultSliders = sliderCount * 0.15;
2227
- const estimateSliderEndsDropped = osuBase.MathUtils.clamp(Math.min(this.computedAccuracy.n100 +
2228
- this.computedAccuracy.n50 +
2229
- this.computedAccuracy.nmiss, maxCombo - combo), 0, estimateDifficultSliders);
2230
- this.sliderNerfFactor =
2231
- (1 - sliderFactor) *
2232
- Math.pow(1 -
2233
- estimateSliderEndsDropped /
2234
- estimateDifficultSliders, 3) +
2235
- sliderFactor;
2223
+ const { aimDifficultSliderCount, sliderFactor } = this.difficultyAttributes;
2224
+ if (aimDifficultSliderCount > 0) {
2225
+ let estimateImproperlyFollowedDifficultSliders;
2226
+ if (this.usingClassicSliderAccuracy) {
2227
+ // When the score is considered classic (regardless if it was made on old client or not),
2228
+ // we consider all missing combo to be dropped difficult sliders.
2229
+ estimateImproperlyFollowedDifficultSliders = osuBase.MathUtils.clamp(Math.min(this.totalImperfectHits, maxCombo - combo), 0, aimDifficultSliderCount);
2236
2230
  }
2237
2231
  else {
2238
- let estimateImproperlyFollowedDifficultSliders;
2239
- if (this.usingClassicSliderAccuracy) {
2240
- // When the score is considered classic (regardless if it was made on old client or not),
2241
- // we consider all missing combo to be dropped difficult sliders
2242
- estimateImproperlyFollowedDifficultSliders =
2243
- osuBase.MathUtils.clamp(Math.min(this.totalImperfectHits, maxCombo - combo), 0, aimDifficultSliderCount);
2244
- }
2245
- else {
2246
- // We add tick misses here since they too mean that the player didn't follow the slider
2247
- // properly. However aren't adding misses here because missing slider heads has a harsh
2248
- // penalty by itself and doesn't mean that the rest of the slider wasn't followed properly.
2249
- estimateImproperlyFollowedDifficultSliders =
2250
- osuBase.MathUtils.clamp(this.sliderEndsDropped + this.sliderTicksMissed, 0, aimDifficultSliderCount);
2251
- }
2252
- this.sliderNerfFactor =
2253
- (1 - sliderFactor) *
2254
- Math.pow(1 -
2255
- estimateImproperlyFollowedDifficultSliders /
2256
- aimDifficultSliderCount, 3) +
2257
- sliderFactor;
2232
+ // We add tick misses here since they too mean that the player didn't follow the slider
2233
+ // properly. However aren't adding misses here because missing slider heads has a harsh
2234
+ // penalty by itself and doesn't mean that the rest of the slider wasn't followed properly.
2235
+ estimateImproperlyFollowedDifficultSliders = osuBase.MathUtils.clamp(this.sliderEndsDropped + this.sliderTicksMissed, 0, aimDifficultSliderCount);
2258
2236
  }
2237
+ this.sliderNerfFactor =
2238
+ (1 - sliderFactor) *
2239
+ Math.pow(1 -
2240
+ estimateImproperlyFollowedDifficultSliders /
2241
+ aimDifficultSliderCount, 3) +
2242
+ sliderFactor;
2259
2243
  }
2260
2244
  }
2261
2245
  /**
@@ -2492,7 +2476,7 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
2492
2476
  Math.pow(this.visual, 1.1), 1 / 1.1) * this.finalMultiplier);
2493
2477
  }
2494
2478
  handleOptions(options) {
2495
- var _a, _b, _c, _d, _e;
2479
+ var _a, _b, _c, _d;
2496
2480
  this._tapPenalty = (_a = options === null || options === void 0 ? void 0 : options.tapPenalty) !== null && _a !== void 0 ? _a : 1;
2497
2481
  this._aimSliderCheesePenalty = (_b = options === null || options === void 0 ? void 0 : options.aimSliderCheesePenalty) !== null && _b !== void 0 ? _b : 1;
2498
2482
  this._flashlightSliderCheesePenalty =
@@ -2500,18 +2484,6 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
2500
2484
  this._visualSliderCheesePenalty =
2501
2485
  (_d = options === null || options === void 0 ? void 0 : options.visualSliderCheesePenalty) !== null && _d !== void 0 ? _d : 1;
2502
2486
  super.handleOptions(options);
2503
- const { maxCombo, aimDifficultSliderCount, sliderFactor } = this.difficultyAttributes;
2504
- const combo = (_e = options === null || options === void 0 ? void 0 : options.combo) !== null && _e !== void 0 ? _e : maxCombo - this.computedAccuracy.nmiss;
2505
- if (aimDifficultSliderCount > 0) {
2506
- // Consider all missing combo to be dropped difficult sliders.
2507
- const estimateImproperlyFollowedDifficultSliders = osuBase.MathUtils.clamp(Math.min(this.totalImperfectHits, maxCombo - combo), 0, aimDifficultSliderCount);
2508
- this.sliderNerfFactor =
2509
- (1 - sliderFactor) *
2510
- Math.pow(1 -
2511
- estimateImproperlyFollowedDifficultSliders /
2512
- aimDifficultSliderCount, 3) +
2513
- sliderFactor;
2514
- }
2515
2487
  }
2516
2488
  /**
2517
2489
  * Calculates the aim performance value of the beatmap.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-difficulty-calculator",
3
- "version": "4.0.0-beta.75",
3
+ "version": "4.0.0-beta.77",
4
4
  "description": "A module for calculating osu!standard beatmap difficulty and performance value with respect to the current 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.74"
36
+ "@rian8337/osu-base": "^4.0.0-beta.77"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "1e8a43d98546e5071bebe45b3ca40dd496aa7b21"
41
+ "gitHead": "13ad454ea657dbd5821d0857c4da6dc7ab0fe965"
42
42
  }
@@ -1313,7 +1313,6 @@ declare abstract class DroidTapEvaluator {
1313
1313
  * - and the strain time cap.
1314
1314
  *
1315
1315
  * @param current The current object.
1316
- * @param greatWindow The great hit window of the current object.
1317
1316
  * @param considerCheesability Whether to consider cheesability.
1318
1317
  * @param strainTimeCap The strain time to cap the object's strain time to.
1319
1318
  */