@rian8337/osu-rebalance-difficulty-calculator 4.0.0-beta.97 → 4.0.0-beta.98

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
@@ -1868,7 +1868,7 @@ class DroidReading extends HarmonicSkill {
1868
1868
  current.readingDifficulty = difficulty;
1869
1869
  }
1870
1870
  calculateAdjustedDifficulty(current) {
1871
- let difficulty = DroidReadingEvaluator.evaluateDifficultyOf(current, this.mods);
1871
+ let difficulty = Math.pow(DroidReadingEvaluator.evaluateDifficultyOf(current, this.mods), 0.89);
1872
1872
  if (this.mods.has(osuBase.ModRelax)) {
1873
1873
  difficulty *= 0.4;
1874
1874
  }
@@ -1923,11 +1923,16 @@ class DroidTapEvaluator {
1923
1923
  current.isOverlapping(false)) {
1924
1924
  return 0;
1925
1925
  }
1926
- let { strainTime } = current;
1927
- // Nerf doubletappable doubles.
1928
1926
  const doubletapness = considerCheesability
1929
1927
  ? 1 - current.getDoubletapness(current.next(0))
1930
1928
  : 1;
1929
+ let difficulty = osuBase.MathUtils.millisecondsToBPM(current.strainTime);
1930
+ difficulty *= this.calculateSpeedBonus(current);
1931
+ // Apply penalty if there's doubletappable doubles
1932
+ return difficulty * doubletapness;
1933
+ }
1934
+ static calculateSpeedBonus(current) {
1935
+ let { strainTime } = current;
1931
1936
  // Cap deltatime to the OD 300 hitwindow.
1932
1937
  // 0.63 is derived from making sure 200 BPM 1/4 OD8 streams aren't nerfed harshly, whilst 0.92 limits the effect of the cap.
1933
1938
  strainTime /= osuBase.MathUtils.clamp(strainTime / current.hitWindowFor(osuBase.HitResult.Great) / 0.63, 0.92, 1);
@@ -1941,14 +1946,7 @@ class DroidTapEvaluator {
1941
1946
  strainTime) /
1942
1947
  40), 2);
1943
1948
  }
1944
- // Base difficulty with all bonuses
1945
- let difficulty = ((1 + speedBonus) * 1000) / strainTime;
1946
- difficulty *= this.highBpmBonus(current.strainTime);
1947
- // Apply penalty if there's doubletappable doubles
1948
- return difficulty * doubletapness;
1949
- }
1950
- static highBpmBonus(ms) {
1951
- return 1 / (1 - Math.pow(0.3, ms / 1000));
1949
+ return (1 + speedBonus) / strainTime;
1952
1950
  }
1953
1951
  }
1954
1952
  // ~200 1/4 BPM streams
@@ -1961,7 +1959,7 @@ class DroidTap extends HarmonicSkill {
1961
1959
  constructor(mods, considerCheesability) {
1962
1960
  super(mods);
1963
1961
  this.harmonicScale = 20;
1964
- this.skillMultiplier = 1.16;
1962
+ this.skillMultiplier = 66.2;
1965
1963
  this.strainDecayBase = 0.3;
1966
1964
  this.currentTapDifficulty = 0;
1967
1965
  this.currentRhythmMultiplier = 0;
@@ -2204,7 +2202,8 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
2204
2202
  * Calculates the tap performance value of the beatmap.
2205
2203
  */
2206
2204
  calculateTapValue() {
2207
- let tapValue = DroidTap.difficultyToPerformance(this.difficultyAttributes.tapDifficulty);
2205
+ const tapDifficulty = this.difficultyAttributes.tapDifficulty * this.calculateTapHighDeviationNerf();
2206
+ let tapValue = DroidTap.difficultyToPerformance(tapDifficulty);
2208
2207
  if (this._effectiveMissCount > 0) {
2209
2208
  const tapEstimatedSliderBreaks = this.calculateEstimatedSliderBreaks(this.difficultyAttributes.tapTopWeightedSliderFactor);
2210
2209
  const relevantMissCount = Math.min(this._effectiveMissCount + tapEstimatedSliderBreaks, this.totalImperfectHits + this.sliderTicksMissed);
@@ -2216,12 +2215,11 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
2216
2215
  tapValue *= Math.min(1, this.calculateDeviationBasedLengthScaling(Math.min(this.difficultyAttributes.speedNoteCount, this.totalHits / 1.45)));
2217
2216
  // An effective hit window is created based on the tap SR. The higher the tap difficulty, the shorter the hit window.
2218
2217
  // For example, a tap SR of 4 leads to an effective hit window of 35ms.
2219
- const effectiveHitWindow = 35 * Math.pow(4 / this.difficultyAttributes.tapDifficulty, 1.8);
2218
+ const effectiveHitWindow = 35 * Math.pow(4 / tapDifficulty, 1.8);
2220
2219
  // Find the proportion of 300s on speed notes assuming the hit window was the effective hit window.
2221
2220
  const effectiveAccuracy = osuBase.ErrorFunction.erf(effectiveHitWindow / this._tapDeviation);
2222
2221
  // Scale the tap value with normalized accuracy.
2223
2222
  tapValue *= Math.pow(effectiveAccuracy, 2);
2224
- tapValue *= this.calculateTapHighDeviationNerf();
2225
2223
  // Scale the tap value with three-fingered penalty.
2226
2224
  tapValue /= this._tapPenalty;
2227
2225
  return tapValue;
@@ -2452,21 +2450,21 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
2452
2450
  if (this.tapDeviation == Number.POSITIVE_INFINITY) {
2453
2451
  return 0;
2454
2452
  }
2455
- const tapValue = DroidTap.difficultyToPerformance(this.difficultyAttributes.tapDifficulty);
2456
- // Decide a point where the PP value achieved compared to the tap deviation is assumed to be tapped
2457
- // improperly. Any PP above this point is considered "excess" tap difficulty. This is used to cause
2453
+ const { tapDifficulty } = this.difficultyAttributes;
2454
+ // Decide a point where the difficulty value achieved compared to the tap deviation is assumed to be tapped
2455
+ // improperly. Any difficulty above this point is considered "excess" tap difficulty. This is used to cause
2458
2456
  // PP above the cutoff to scale logarithmically towards the original tap value thus nerfing the value.
2459
- const excessTapDifficultyCutoff = 100 + 250 * Math.pow(25 / this.tapDeviation, 6.5);
2460
- if (tapValue <= excessTapDifficultyCutoff) {
2457
+ const excessTapDifficultyCutoff = 2.9 + 1.45 * Math.pow(25 / this.tapDeviation, 5);
2458
+ if (tapDifficulty <= excessTapDifficultyCutoff) {
2461
2459
  return 1;
2462
2460
  }
2463
- const scale = 50;
2464
- const adjustedTapValue = scale *
2465
- (Math.log((tapValue - excessTapDifficultyCutoff) / scale + 1) +
2461
+ const scale = 0.45;
2462
+ const adjustedTapDifficulty = scale *
2463
+ (Math.log((tapDifficulty - excessTapDifficultyCutoff) / scale + 1) +
2466
2464
  excessTapDifficultyCutoff / scale);
2467
2465
  // 250 UR and less are considered tapped correctly to ensure that normal scores will be punished as little as possible.
2468
2466
  const t = 1 - osuBase.Interpolation.reverseLerp(this.tapDeviation, 25, 30);
2469
- return osuBase.Interpolation.lerp(adjustedTapValue, tapValue, t) / tapValue;
2467
+ return osuBase.Interpolation.lerp(adjustedTapDifficulty, tapDifficulty, t) / tapDifficulty;
2470
2468
  }
2471
2469
  getHitWindow() {
2472
2470
  const { overallDifficulty } = this.difficultyAttributes;
@@ -3059,7 +3057,7 @@ class DroidDifficultyHitObject extends DifficultyHitObject {
3059
3057
  return this.normalizedRadius * 2;
3060
3058
  }
3061
3059
  get smallCircleBonus() {
3062
- return 1 + Math.pow(Math.max(0, 65 - this.object.radius) / 40, 2);
3060
+ return 1 + Math.pow(Math.max(0, 62.5 - this.object.radius) / 30, 1.5);
3063
3061
  }
3064
3062
  opacityAt(time, mods) {
3065
3063
  // Traceable hides the primary piece of a hit circle (that is, its body), so consider it as fully invisible.
@@ -4638,9 +4636,14 @@ class OsuSpeedEvaluator {
4638
4636
  if (current.object instanceof osuBase.Spinner) {
4639
4637
  return 0;
4640
4638
  }
4641
- let strainTime = current.strainTime;
4642
- // Nerf doubletappable doubles.
4643
4639
  const doubletapness = 1 - current.getDoubletapness(current.next(0));
4640
+ let difficulty = osuBase.MathUtils.millisecondsToBPM(current.strainTime);
4641
+ difficulty *= this.calculateSpeedBonus(current);
4642
+ // Apply penalty if there's doubletappable doubles
4643
+ return difficulty * doubletapness;
4644
+ }
4645
+ static calculateSpeedBonus(current) {
4646
+ let { strainTime } = current;
4644
4647
  // Cap deltatime to the OD 300 hitwindow.
4645
4648
  // 0.93 is derived from making sure 260 BPM 1/4 OD8 streams aren't nerfed harshly, whilst 0.92 limits the effect of the cap.
4646
4649
  strainTime /= osuBase.MathUtils.clamp(strainTime / current.hitWindowFor(osuBase.HitResult.Great) / 0.93, 0.92, 1);
@@ -4654,14 +4657,7 @@ class OsuSpeedEvaluator {
4654
4657
  strainTime) /
4655
4658
  40, 2);
4656
4659
  }
4657
- // Base difficulty with all bonuses
4658
- let difficulty = ((1 + speedBonus) * 1000) / strainTime;
4659
- difficulty *= this.highBpmBonus(current.strainTime);
4660
- // Apply penalty if there's doubletappable doubles
4661
- return difficulty * doubletapness;
4662
- }
4663
- static highBpmBonus(ms) {
4664
- return 1 / (1 - Math.pow(0.3, ms / 1000));
4660
+ return (1 + speedBonus) / strainTime;
4665
4661
  }
4666
4662
  }
4667
4663
  // ~200 1/4 BPM streams
@@ -4965,7 +4961,7 @@ class OsuSpeed extends HarmonicSkill {
4965
4961
  this.harmonicScale = 20;
4966
4962
  this.currentDifficulty = 0;
4967
4963
  this.currentRhythm = 0;
4968
- this.skillMultiplier = 1.16;
4964
+ this.skillMultiplier = 66.2;
4969
4965
  this.strainDecayBase = 0.3;
4970
4966
  this.sliderDifficulties = [];
4971
4967
  this.maxDifficulty = 0;
@@ -5183,7 +5179,8 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
5183
5179
  this.speedDeviation === Number.POSITIVE_INFINITY) {
5184
5180
  return 0;
5185
5181
  }
5186
- let speedValue = OsuSpeed.difficultyToPerformance(this.difficultyAttributes.speedDifficulty);
5182
+ const speedDifficulty = this.difficultyAttributes.speedDifficulty * this.calculateSpeedHighDeviationNerf();
5183
+ let speedValue = OsuSpeed.difficultyToPerformance(speedDifficulty);
5187
5184
  if (this._effectiveMissCount > 0) {
5188
5185
  const speedEstimatedSliderBreaks = this.calculateEstimatedSliderBreaks(this.difficultyAttributes.speedTopWeightedSliderFactor);
5189
5186
  const relevantMissCount = Math.min(this._effectiveMissCount + speedEstimatedSliderBreaks, this.totalImperfectHits + this.sliderTicksMissed);
@@ -5193,10 +5190,9 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
5193
5190
  // Increasing the speed value by object count for Blinds is not ideal, so the minimum buff is given.
5194
5191
  speedValue *= 1.12;
5195
5192
  }
5196
- speedValue *= this.calculateSpeedHighDeviationNerf();
5197
5193
  // An effective hit window is created based on the speed SR. The higher the speed difficulty, the shorter the hit window.
5198
5194
  // For example, a speed SR of 4 leads to an effective hit window of 20ms, which is OD 10.
5199
- const effectiveHitWindow = 20 * Math.pow(4 / this.difficultyAttributes.speedDifficulty, 0.35);
5195
+ const effectiveHitWindow = 20 * Math.pow(4 / speedDifficulty, 0.35);
5200
5196
  // Find the proportion of 300s on speed notes assuming the hit window was the effective hit window.
5201
5197
  const effectiveAccuracy = osuBase.ErrorFunction.erf(effectiveHitWindow / this.speedDeviation);
5202
5198
  // Scale speed value by normalized accuracy.
@@ -5368,21 +5364,22 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
5368
5364
  if (this.speedDeviation == Number.POSITIVE_INFINITY) {
5369
5365
  return 0;
5370
5366
  }
5371
- const speedValue = OsuSpeed.difficultyToPerformance(this.difficultyAttributes.speedDifficulty);
5372
- // Decide a point where the PP value achieved compared to the speed deviation is assumed to be tapped
5373
- // improperly. Any PP above this point is considered "excess" speed difficulty. This is used to cause
5374
- // PP above the cutoff to scale logarithmically towards the original speed value thus nerfing the value.
5375
- const excessSpeedDifficultyCutoff = 100 + 220 * Math.pow(22 / this.speedDeviation, 6.5);
5376
- if (speedValue <= excessSpeedDifficultyCutoff) {
5367
+ const { speedDifficulty } = this.difficultyAttributes;
5368
+ // Decides a point where the difficulty played compared to the speed deviation is assumed to be tapped improperly.
5369
+ // Any difficulty above this point is considered "excess" speed difficulty.
5370
+ // This is used to cause difficulty above the cutoff to scale logarithmically towards the original speed value thus
5371
+ // nerfing the value.
5372
+ const excessSpeedDifficultyCutoff = 2.9 + 1.45 * Math.pow(22 / this.speedDeviation, 5);
5373
+ if (speedDifficulty <= excessSpeedDifficultyCutoff) {
5377
5374
  return 1;
5378
5375
  }
5379
- const scale = 50;
5380
- const adjustedSpeedValue = scale *
5381
- (Math.log((speedValue - excessSpeedDifficultyCutoff) / scale + 1) +
5376
+ const scale = 0.45;
5377
+ const adjustedSpeedDifficulty = scale *
5378
+ (Math.log((speedDifficulty - excessSpeedDifficultyCutoff) / scale + 1) +
5382
5379
  excessSpeedDifficultyCutoff / scale);
5383
5380
  // 220 UR and less are considered tapped correctly to ensure that normal scores will be punished as little as possible
5384
5381
  const t = 1 - osuBase.Interpolation.reverseLerp(this.speedDeviation, 22, 27);
5385
- return (osuBase.Interpolation.lerp(adjustedSpeedValue, speedValue, t) / speedValue);
5382
+ return (osuBase.Interpolation.lerp(adjustedSpeedDifficulty, speedDifficulty, t) / speedDifficulty);
5386
5383
  }
5387
5384
  calculateEstimatedSliderBreaks(topWeightedSliderFactor) {
5388
5385
  const nonMissMistakes = this.computedAccuracy.n100 + this.computedAccuracy.n50;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-rebalance-difficulty-calculator",
3
- "version": "4.0.0-beta.97",
3
+ "version": "4.0.0-beta.98",
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",
@@ -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.97"
36
+ "@rian8337/osu-base": "4.0.0-beta.98"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "0d77ee41c1b0eca8e46c118e942417483c4a9452"
41
+ "gitHead": "0d1f9256f0caee5123379cf5a8b3c92d1dcfa7bf"
42
42
  }
@@ -1199,7 +1199,7 @@ declare abstract class DroidTapEvaluator {
1199
1199
  * @param considerCheesability Whether to consider cheesability.
1200
1200
  */
1201
1201
  static evaluateDifficultyOf(current: DroidDifficultyHitObject, considerCheesability: boolean): number;
1202
- private static highBpmBonus;
1202
+ private static calculateSpeedBonus;
1203
1203
  }
1204
1204
 
1205
1205
  /**
@@ -1390,7 +1390,7 @@ declare abstract class OsuSpeedEvaluator {
1390
1390
  * @param current The current object.
1391
1391
  */
1392
1392
  static evaluateDifficultyOf(current: OsuDifficultyHitObject): number;
1393
- private static highBpmBonus;
1393
+ private static calculateSpeedBonus;
1394
1394
  }
1395
1395
 
1396
1396
  /**