@rian8337/osu-rebalance-difficulty-calculator 1.2.4 → 1.2.7

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.
@@ -146,16 +146,16 @@ class DroidPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalc
146
146
  return;
147
147
  }
148
148
  // Global variables
149
+ const objectCount = this.stars.objects.length;
149
150
  const ncircles = this.stars.mods.some((m) => m instanceof osu_base_1.ModScoreV2)
150
- ? this.stars.objects.length - this.stars.map.spinners
151
+ ? objectCount - this.stars.map.spinners
151
152
  : this.stars.map.circles;
152
153
  if (ncircles === 0) {
153
154
  return;
154
155
  }
155
156
  const realAccuracy = new osu_base_1.Accuracy({
156
157
  ...this.computedAccuracy,
157
- n300: this.computedAccuracy.n300 -
158
- (this.stars.objects.length - ncircles),
158
+ n300: this.computedAccuracy.n300 - (objectCount - ncircles),
159
159
  });
160
160
  // Lots of arbitrary values from testing.
161
161
  // Considering to use derivation from perfect accuracy in a probabilistic manner - assume normal distribution
@@ -166,7 +166,7 @@ class DroidPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalc
166
166
  // Bonus for many hitcircles - it's harder to keep good accuracy up for longer
167
167
  this.accuracy *= Math.min(1.15, Math.pow(ncircles / 1000, 0.3));
168
168
  // Scale the accuracy value with rhythm complexity.
169
- this.accuracy *= 0.6 + Math.pow(this.stars.rhythm, 2) / 50;
169
+ this.accuracy *= 1.5 / (1 + Math.exp(-(this.stars.rhythm - 1) / 2));
170
170
  if (this.stars.mods.some((m) => m instanceof osu_base_1.ModHidden)) {
171
171
  this.accuracy *= 1.08;
172
172
  }
@@ -14,11 +14,14 @@ class DroidRhythm extends DroidSkill_1.DroidSkill {
14
14
  this.reducedSectionCount = 5;
15
15
  this.reducedSectionBaseline = 0.75;
16
16
  this.strainDecayBase = 0.3;
17
- this.starsPerDouble = 2;
18
- this.rhythmMultiplier = 0.75;
17
+ this.starsPerDouble = 1.75;
19
18
  this.historyTimeMax = 5000; // 5 seconds of calculateRhythmBonus max.
20
19
  this.currentRhythm = 1;
21
20
  this.hitWindow = new osu_base_1.OsuHitWindow(overallDifficulty);
21
+ const odScaling = Math.pow(this.hitWindow.overallDifficulty, 2) / 250;
22
+ this.rhythmMultiplier =
23
+ 0.75 +
24
+ (this.hitWindow.overallDifficulty >= 0 ? odScaling : -odScaling);
22
25
  }
23
26
  /**
24
27
  * Calculates a rhythm multiplier for the difficulty of the tap associated with historic data of the current object.
@@ -55,8 +58,8 @@ class DroidRhythm extends DroidSkill_1.DroidSkill {
55
58
  (Math.min(prevDelta, currentDelta) /
56
59
  Math.max(prevDelta, currentDelta))), 2));
57
60
  const windowPenalty = Math.min(1, Math.max(0, Math.abs(prevDelta - currentDelta) -
58
- this.hitWindow.hitWindowFor300() * 0.2) /
59
- (this.hitWindow.hitWindowFor300() * 0.2));
61
+ this.hitWindow.hitWindowFor300() * 0.4) /
62
+ (this.hitWindow.hitWindowFor300() * 0.4));
60
63
  let effectiveRatio = windowPenalty * currentRatio;
61
64
  if (firstDeltaSwitch) {
62
65
  if (prevDelta <= 1.25 * currentDelta &&
@@ -21,7 +21,9 @@ class DroidSkill extends StrainSkill_1.StrainSkill {
21
21
  }
22
22
  // Math here preserves the property that two notes of equal difficulty x, we have their summed difficulty = x * starsPerDouble.
23
23
  // This also applies to two sets of notes with equal difficulty.
24
- return Math.pow(sortedStrains.reduce((a, v) => a + Math.pow(v, 1 / Math.log2(this.starsPerDouble)), 0), Math.log2(this.starsPerDouble));
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));
25
27
  }
26
28
  }
27
29
  exports.DroidSkill = DroidSkill;
@@ -37,8 +37,8 @@ class DroidTap extends DroidSkill_1.DroidSkill {
37
37
  strainTime = osu_base_1.Interpolation.lerp(this.previous[0].strainTime, strainTime, strainTime / greatWindowFull);
38
38
  }
39
39
  // Cap deltatime to the OD 300 hitwindow.
40
- // 0.58 is derived from making sure 260 BPM 1/4 OD5 streams aren't nerfed harshly, whilst 0.92 limits the effect of the cap.
41
- strainTime /= osu_base_1.MathUtils.clamp(strainTime / greatWindowFull / 0.58, 0.92, 1);
40
+ // 0.58 is derived from making sure 260 BPM 1/4 OD5 streams aren't nerfed harshly, whilst 0.91 limits the effect of the cap.
41
+ strainTime /= osu_base_1.MathUtils.clamp(strainTime / greatWindowFull / 0.58, 0.91, 1);
42
42
  let speedBonus = 1;
43
43
  if (strainTime < this.minSpeedBonus) {
44
44
  speedBonus +=
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-rebalance-difficulty-calculator",
3
- "version": "1.2.4",
3
+ "version": "1.2.7",
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": "90937c938a4e4bf022835a43b289d69a19da1efd"
38
+ "gitHead": "18927f60c831515a666c7f7400beaa7573f28b64"
39
39
  }