@rian8337/osu-rebalance-difficulty-calculator 1.2.3 → 1.2.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.
@@ -28,11 +28,9 @@ class DroidPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalc
28
28
  * The flashlight performance value.
29
29
  */
30
30
  this.flashlight = 0;
31
- this.aggregatedRhythmMultiplier = 0;
32
31
  }
33
32
  calculate(params) {
34
33
  this.handleParams(params, osu_base_1.modes.droid);
35
- this.calculateAverageRhythmMultiplier();
36
34
  this.calculateAimValue();
37
35
  this.calculateTapValue();
38
36
  this.calculateAccuracyValue();
@@ -46,17 +44,6 @@ class DroidPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalc
46
44
  Math.pow(this.flashlight, 1.1), 1 / 1.1) * this.finalMultiplier;
47
45
  return this;
48
46
  }
49
- /**
50
- * Calculates the average rhythm multiplier of the beatmap.
51
- */
52
- calculateAverageRhythmMultiplier() {
53
- // The first object doesn't have any rhythm multiplier, so we begin with the second object
54
- const rhythmMultipliers = this.stars.objects
55
- .map((v) => v.rhythmMultiplier)
56
- .slice(1);
57
- this.aggregatedRhythmMultiplier = Math.max(1, rhythmMultipliers.reduce((total, value) => total + value, 0) /
58
- Math.max(500, rhythmMultipliers.length));
59
- }
60
47
  /**
61
48
  * Calculates the aim performance value of the beatmap.
62
49
  */
@@ -179,7 +166,7 @@ class DroidPerformanceCalculator extends PerformanceCalculator_1.PerformanceCalc
179
166
  // Bonus for many hitcircles - it's harder to keep good accuracy up for longer
180
167
  this.accuracy *= Math.min(1.15, Math.pow(ncircles / 1000, 0.3));
181
168
  // Scale the accuracy value with rhythm complexity.
182
- this.accuracy *= Math.min(1, Math.pow(Math.exp(this.aggregatedRhythmMultiplier - 0.5), 0.85) / 2);
169
+ this.accuracy *= 0.6 + Math.pow(this.stars.rhythm, 2) / 50;
183
170
  if (this.stars.mods.some((m) => m instanceof osu_base_1.ModHidden)) {
184
171
  this.accuracy *= 1.08;
185
172
  }
@@ -49,7 +49,7 @@ class DroidAim extends DroidSkill_1.DroidSkill {
49
49
  let currentVelocity = current.lazyJumpDistance / current.strainTime;
50
50
  // But if the last object is a slider, then we extend the travel velocity through the slider into the current object.
51
51
  if (last.object instanceof osu_base_1.Slider &&
52
- last.object.ticks > 1 &&
52
+ last.object.ticks > 0 &&
53
53
  this.withSliders) {
54
54
  // Calculate the slider velocity from slider head to slider end.
55
55
  const travelVelocity = last.travelDistance / last.travelTime;
@@ -61,7 +61,7 @@ class DroidAim extends DroidSkill_1.DroidSkill {
61
61
  // As above, do the same for the previous hitobject.
62
62
  let prevVelocity = last.lazyJumpDistance / last.strainTime;
63
63
  if (lastLast.object instanceof osu_base_1.Slider &&
64
- lastLast.object.ticks > 1 &&
64
+ lastLast.object.ticks > 0 &&
65
65
  this.withSliders) {
66
66
  const travelVelocity = lastLast.travelDistance / lastLast.travelTime;
67
67
  const movementVelocity = last.minimumJumpDistance / last.minimumJumpTime;
@@ -55,8 +55,8 @@ class DroidRhythm extends DroidSkill_1.DroidSkill {
55
55
  (Math.min(prevDelta, currentDelta) /
56
56
  Math.max(prevDelta, currentDelta))), 2));
57
57
  const windowPenalty = Math.min(1, Math.max(0, Math.abs(prevDelta - currentDelta) -
58
- this.hitWindow.hitWindowFor300() * 0.6) /
59
- (this.hitWindow.hitWindowFor300() * 0.6));
58
+ this.hitWindow.hitWindowFor300() * 0.2) /
59
+ (this.hitWindow.hitWindowFor300() * 0.2));
60
60
  let effectiveRatio = windowPenalty * currentRatio;
61
61
  if (firstDeltaSwitch) {
62
62
  if (prevDelta <= 1.25 * currentDelta &&
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DroidSkill = void 0;
4
+ const osu_base_1 = require("@rian8337/osu-base");
4
5
  const StrainSkill_1 = require("../base/StrainSkill");
5
6
  /**
6
7
  * Used to processes strain values of difficulty hitobjects, keep track of strain levels caused by the processed objects
@@ -8,9 +9,19 @@ const StrainSkill_1 = require("../base/StrainSkill");
8
9
  */
9
10
  class DroidSkill extends StrainSkill_1.StrainSkill {
10
11
  difficultyValue() {
12
+ const sortedStrains = this.strainPeaks
13
+ .slice()
14
+ .sort((a, b) => {
15
+ return b - a;
16
+ });
17
+ // We are reducing the highest strains first to account for extreme difficulty spikes.
18
+ for (let i = 0; i < Math.min(sortedStrains.length, this.reducedSectionCount); ++i) {
19
+ const scale = Math.log10(osu_base_1.Interpolation.lerp(1, 10, osu_base_1.MathUtils.clamp(i / this.reducedSectionCount, 0, 1)));
20
+ sortedStrains[i] *= osu_base_1.Interpolation.lerp(this.reducedSectionBaseline, 1, scale);
21
+ }
11
22
  // Math here preserves the property that two notes of equal difficulty x, we have their summed difficulty = x * starsPerDouble.
12
23
  // This also applies to two sets of notes with equal difficulty.
13
- return Math.pow(this.strainPeaks.reduce((a, v) => a + Math.pow(v, 1 / Math.log2(this.starsPerDouble)), 0), Math.log2(this.starsPerDouble));
24
+ return Math.pow(sortedStrains.reduce((a, v) => a + Math.pow(v, 1 / Math.log2(this.starsPerDouble)), 0), Math.log2(this.starsPerDouble));
14
25
  }
15
26
  }
16
27
  exports.DroidSkill = DroidSkill;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-rebalance-difficulty-calculator",
3
- "version": "1.2.3",
3
+ "version": "1.2.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",
@@ -35,5 +35,5 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "e2d1f9bef01c9b12954a78683c3b8dcddabc7b1d"
38
+ "gitHead": "90937c938a4e4bf022835a43b289d69a19da1efd"
39
39
  }
@@ -233,7 +233,6 @@ declare module "@rian8337/osu-rebalance-difficulty-calculator" {
233
233
  * The flashlight performance value.
234
234
  */
235
235
  flashlight: number;
236
- private averageRhythmMultiplier: number;
237
236
  override calculate(params: {
238
237
  /**
239
238
  * The star rating instance to calculate.
@@ -260,10 +259,6 @@ declare module "@rian8337/osu-rebalance-difficulty-calculator" {
260
259
  */
261
260
  stats?: MapStats;
262
261
  }): this;
263
- /**
264
- * Calculates the average rhythm multiplier of the beatmap.
265
- */
266
- private calculateAverageRhythmMultiplier(): void;
267
262
  /**
268
263
  * Calculates the aim performance value of the beatmap.
269
264
  */