@rian8337/osu-rebalance-difficulty-calculator 1.4.11-alpha.0 → 1.4.12-alpha.2

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.
@@ -103,6 +103,10 @@ class DifficultyHitObject {
103
103
  * This is used to scale visual skill.
104
104
  */
105
105
  this.overlappingFactor = 0;
106
+ /**
107
+ * Adjusted velocity of the hitobject, taking speed multiplier into account.
108
+ */
109
+ this.velocity = 0;
106
110
  this.object = object;
107
111
  }
108
112
  }
@@ -43,6 +43,8 @@ class DifficultyHitObjectCreator {
43
43
  const object = new DifficultyHitObject_1.DifficultyHitObject(params.objects[i]);
44
44
  object.object.scale = scale;
45
45
  if (object.object instanceof osu_base_1.Slider) {
46
+ object.velocity =
47
+ object.object.velocity * params.speedMultiplier;
46
48
  object.object.nestedHitObjects.forEach((h) => {
47
49
  h.scale = scale;
48
50
  });
@@ -38,17 +38,16 @@ class DroidVisual extends DroidSkill_1.DroidSkill {
38
38
  }
39
39
  // Give bonus for AR higher than 10.33.
40
40
  if (this.preempt < 400) {
41
- strain += Math.pow(400 - this.preempt, 1.3) / 125;
41
+ strain += Math.pow(400 - this.preempt, 1.3) / 135;
42
42
  }
43
43
  if (current.object instanceof osu_base_1.Slider) {
44
- const currentVelocity = current.travelDistance / current.travelTime;
45
44
  const scalingFactor = 50 / current.object.radius;
46
45
  // Reward sliders based on velocity.
47
- strain += Math.min(
48
- // Avoid overbuffing extremely fast sliders.
49
- Math.min(15, currentVelocity * 3) *
50
- // Scale with distance travelled to avoid overbuffing fast sliders with short distance.
51
- Math.min(1, current.travelDistance / scalingFactor / 100));
46
+ strain +=
47
+ // Avoid overbuffing extremely fast sliders.
48
+ Math.min(15, current.velocity * 3) *
49
+ // Scale with distance travelled to avoid overbuffing fast sliders with short distance.
50
+ Math.min(1, current.travelDistance / scalingFactor / 100);
52
51
  let cumulativeStrainTime = 0;
53
52
  // Reward for velocity changes based on last few sliders.
54
53
  for (let i = 0; i < this.previous.length; ++i) {
@@ -57,14 +56,13 @@ class DroidVisual extends DroidSkill_1.DroidSkill {
57
56
  if (!(last.object instanceof osu_base_1.Slider)) {
58
57
  continue;
59
58
  }
60
- const prevVelocity = last.travelDistance / last.travelTime;
61
- strain += Math.min(
62
- // Avoid overbuffing extremely fast velocity changes.
63
- Math.min(15, 2.5 * Math.abs(currentVelocity - prevVelocity)) *
64
- // Scale with distance travelled to avoid overbuffing fast sliders with short distance.
65
- Math.min(1, last.travelDistance / scalingFactor / 100) *
66
- // Scale with cumulative strain time to avoid overbuffing past sliders.
67
- Math.min(1, 300 / cumulativeStrainTime));
59
+ strain +=
60
+ // Avoid overbuffing extremely fast velocity changes.
61
+ Math.min(15, 2.5 * Math.abs(current.velocity - last.velocity)) *
62
+ // Scale with distance travelled to avoid overbuffing fast sliders with short distance.
63
+ Math.min(1, last.travelDistance / scalingFactor / 100) *
64
+ // Scale with cumulative strain time to avoid overbuffing past sliders.
65
+ Math.min(1, 300 / cumulativeStrainTime);
68
66
  }
69
67
  }
70
68
  return strain;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-rebalance-difficulty-calculator",
3
- "version": "1.4.11-alpha.0",
3
+ "version": "1.4.12-alpha.2",
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": "00bf75cdcd669cebe53d04eec274f119202881cd"
38
+ "gitHead": "9e03096bfdc8a36d6227b1c3723afba845ba92d7"
39
39
  }
@@ -115,6 +115,10 @@ declare module "@rian8337/osu-rebalance-difficulty-calculator" {
115
115
  * This is used to scale visual skill.
116
116
  */
117
117
  overlappingFactor: number;
118
+ /**
119
+ * Adjusted velocity of the hitobject, taking speed multiplier into account.
120
+ */
121
+ velocity: number;
118
122
  /**
119
123
  * @param object The underlying hitobject.
120
124
  */