@rian8337/osu-rebalance-difficulty-calculator 4.0.0-beta.43 → 4.0.0-beta.45
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 +370 -390
- package/package.json +3 -3
- package/typings/index.d.ts +38 -47
package/dist/index.js
CHANGED
|
@@ -27,6 +27,7 @@ AimEvaluator.wideAngleMultiplier = 1.5;
|
|
|
27
27
|
AimEvaluator.acuteAngleMultiplier = 1.95;
|
|
28
28
|
AimEvaluator.sliderMultiplier = 1.35;
|
|
29
29
|
AimEvaluator.velocityChangeMultiplier = 0.75;
|
|
30
|
+
AimEvaluator.wiggleMultiplier = 1.02;
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* The base of a difficulty calculator.
|
|
@@ -175,6 +176,12 @@ class DifficultyCalculator {
|
|
|
175
176
|
* Represents a hit object with difficulty calculation values.
|
|
176
177
|
*/
|
|
177
178
|
class DifficultyHitObject {
|
|
179
|
+
/**
|
|
180
|
+
* The normalized diameter of the hitobject.
|
|
181
|
+
*/
|
|
182
|
+
static get normalizedDiameter() {
|
|
183
|
+
return this.normalizedRadius * 2;
|
|
184
|
+
}
|
|
178
185
|
/**
|
|
179
186
|
* Note: You **must** call `computeProperties` at some point due to how TypeScript handles
|
|
180
187
|
* overridden properties (see [this](https://github.com/microsoft/TypeScript/issues/1617) GitHub issue).
|
|
@@ -236,9 +243,8 @@ class DifficultyHitObject {
|
|
|
236
243
|
* Calculated as the angle between the circles (current-2, current-1, current).
|
|
237
244
|
*/
|
|
238
245
|
this.angle = null;
|
|
239
|
-
this.
|
|
240
|
-
this.
|
|
241
|
-
this.assumedSliderRadius = this.normalizedRadius * 1.8;
|
|
246
|
+
this.maximumSliderRadius = DifficultyHitObject.normalizedRadius * 2.4;
|
|
247
|
+
this.assumedSliderRadius = DifficultyHitObject.normalizedRadius * 1.8;
|
|
242
248
|
this.object = object;
|
|
243
249
|
this.lastObject = lastObject;
|
|
244
250
|
this.lastLastObject = lastLastObject;
|
|
@@ -442,7 +448,7 @@ class DifficultyHitObject {
|
|
|
442
448
|
.getStackedPosition(this.mode)
|
|
443
449
|
.add(slider.path.positionAt(endTimeMin));
|
|
444
450
|
let currentCursorPosition = slider.getStackedPosition(this.mode);
|
|
445
|
-
const scalingFactor =
|
|
451
|
+
const scalingFactor = DifficultyHitObject.normalizedRadius / slider.radius;
|
|
446
452
|
for (let i = 1; i < slider.nestedHitObjects.length; ++i) {
|
|
447
453
|
const currentMovementObject = slider.nestedHitObjects[i];
|
|
448
454
|
let currentMovement = currentMovementObject
|
|
@@ -464,7 +470,7 @@ class DifficultyHitObject {
|
|
|
464
470
|
}
|
|
465
471
|
else if (currentMovementObject instanceof osuBase.SliderRepeat) {
|
|
466
472
|
// For a slider repeat, assume a tighter movement threshold to better assess repeat sliders.
|
|
467
|
-
requiredMovement =
|
|
473
|
+
requiredMovement = DifficultyHitObject.normalizedRadius;
|
|
468
474
|
}
|
|
469
475
|
if (currentMovementLength > requiredMovement) {
|
|
470
476
|
// This finds the positional delta from the required radius and the current position,
|
|
@@ -491,11 +497,211 @@ class DifficultyHitObject {
|
|
|
491
497
|
return pos;
|
|
492
498
|
}
|
|
493
499
|
}
|
|
500
|
+
/**
|
|
501
|
+
* The normalized radius of the hitobject.
|
|
502
|
+
*/
|
|
503
|
+
DifficultyHitObject.normalizedRadius = 50;
|
|
494
504
|
/**
|
|
495
505
|
* The lowest possible delta time value.
|
|
496
506
|
*/
|
|
497
507
|
DifficultyHitObject.minDeltaTime = 25;
|
|
498
508
|
|
|
509
|
+
/**
|
|
510
|
+
* Represents an osu!droid hit object with difficulty calculation values.
|
|
511
|
+
*/
|
|
512
|
+
class DroidDifficultyHitObject extends DifficultyHitObject {
|
|
513
|
+
get scalingFactor() {
|
|
514
|
+
const radius = this.object.radius;
|
|
515
|
+
// We will scale distances by this factor, so we can assume a uniform CircleSize among beatmaps.
|
|
516
|
+
let scalingFactor = DifficultyHitObject.normalizedRadius / radius;
|
|
517
|
+
// High circle size (small CS) bonus
|
|
518
|
+
if (radius < this.radiusBuffThreshold) {
|
|
519
|
+
scalingFactor *=
|
|
520
|
+
1 + Math.pow((this.radiusBuffThreshold - radius) / 50, 2);
|
|
521
|
+
}
|
|
522
|
+
return scalingFactor;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Note: You **must** call `computeProperties` at some point due to how TypeScript handles
|
|
526
|
+
* overridden properties (see [this](https://github.com/microsoft/TypeScript/issues/1617) GitHub issue).
|
|
527
|
+
*
|
|
528
|
+
* @param object The underlying hitobject.
|
|
529
|
+
* @param lastObject The hitobject before this hitobject.
|
|
530
|
+
* @param lastLastObject The hitobject before the last hitobject.
|
|
531
|
+
* @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
|
|
532
|
+
* @param clockRate The clock rate of the beatmap.
|
|
533
|
+
*/
|
|
534
|
+
constructor(object, lastObject, lastLastObject, difficultyHitObjects, clockRate) {
|
|
535
|
+
super(object, lastObject, lastLastObject, difficultyHitObjects, clockRate);
|
|
536
|
+
/**
|
|
537
|
+
* The tap strain generated by the hitobject.
|
|
538
|
+
*/
|
|
539
|
+
this.tapStrain = 0;
|
|
540
|
+
/**
|
|
541
|
+
* The tap strain generated by the hitobject if `strainTime` isn't modified by
|
|
542
|
+
* OD. This is used in three-finger detection.
|
|
543
|
+
*/
|
|
544
|
+
this.originalTapStrain = 0;
|
|
545
|
+
/**
|
|
546
|
+
* The rhythm strain generated by the hitobject.
|
|
547
|
+
*/
|
|
548
|
+
this.rhythmStrain = 0;
|
|
549
|
+
/**
|
|
550
|
+
* The flashlight strain generated by the hitobject if sliders are considered.
|
|
551
|
+
*/
|
|
552
|
+
this.flashlightStrainWithSliders = 0;
|
|
553
|
+
/**
|
|
554
|
+
* The flashlight strain generated by the hitobject if sliders are not considered.
|
|
555
|
+
*/
|
|
556
|
+
this.flashlightStrainWithoutSliders = 0;
|
|
557
|
+
/**
|
|
558
|
+
* The visual strain generated by the hitobject if sliders are considered.
|
|
559
|
+
*/
|
|
560
|
+
this.visualStrainWithSliders = 0;
|
|
561
|
+
/**
|
|
562
|
+
* The visual strain generated by the hitobject if sliders are not considered.
|
|
563
|
+
*/
|
|
564
|
+
this.visualStrainWithoutSliders = 0;
|
|
565
|
+
/**
|
|
566
|
+
* The note density of the hitobject.
|
|
567
|
+
*/
|
|
568
|
+
this.noteDensity = 1;
|
|
569
|
+
/**
|
|
570
|
+
* The overlapping factor of the hitobject.
|
|
571
|
+
*
|
|
572
|
+
* This is used to scale visual skill.
|
|
573
|
+
*/
|
|
574
|
+
this.overlappingFactor = 0;
|
|
575
|
+
this.radiusBuffThreshold = 70;
|
|
576
|
+
this.mode = osuBase.Modes.droid;
|
|
577
|
+
this.maximumSliderRadius = DifficultyHitObject.normalizedRadius * 2;
|
|
578
|
+
this.timePreempt = object.timePreempt / clockRate;
|
|
579
|
+
}
|
|
580
|
+
computeProperties(clockRate, hitObjects) {
|
|
581
|
+
super.computeProperties(clockRate, hitObjects);
|
|
582
|
+
this.setVisuals(clockRate, hitObjects);
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Determines whether this hitobject is considered overlapping with the hitobject before it.
|
|
586
|
+
*
|
|
587
|
+
* Keep in mind that "overlapping" in this case is overlapping to the point where both hitobjects
|
|
588
|
+
* can be hit with just a single tap in osu!droid.
|
|
589
|
+
*
|
|
590
|
+
* In the case of sliders, it is considered overlapping if all nested hitobjects can be hit with
|
|
591
|
+
* one aim motion.
|
|
592
|
+
*
|
|
593
|
+
* @param considerDistance Whether to consider the distance between both hitobjects.
|
|
594
|
+
* @returns Whether the hitobject is considered overlapping.
|
|
595
|
+
*/
|
|
596
|
+
isOverlapping(considerDistance) {
|
|
597
|
+
if (this.object instanceof osuBase.Spinner) {
|
|
598
|
+
return false;
|
|
599
|
+
}
|
|
600
|
+
const prev = this.previous(0);
|
|
601
|
+
if (!prev || prev.object instanceof osuBase.Spinner) {
|
|
602
|
+
return false;
|
|
603
|
+
}
|
|
604
|
+
if (this.object.startTime !== prev.object.startTime) {
|
|
605
|
+
return false;
|
|
606
|
+
}
|
|
607
|
+
if (!considerDistance) {
|
|
608
|
+
return true;
|
|
609
|
+
}
|
|
610
|
+
const distanceThreshold = 2 * this.object.radius;
|
|
611
|
+
const startPosition = this.object.getStackedPosition(osuBase.Modes.droid);
|
|
612
|
+
const prevStartPosition = prev.object.getStackedPosition(osuBase.Modes.droid);
|
|
613
|
+
// We need to consider two cases:
|
|
614
|
+
//
|
|
615
|
+
// Case 1: Current object is a circle, or previous object is a circle.
|
|
616
|
+
// In this case, we only need to check if their positions are close enough to be tapped together.
|
|
617
|
+
//
|
|
618
|
+
// Case 2: Both objects are sliders.
|
|
619
|
+
// In this case, we need to check if all nested hitobjects can be hit together.
|
|
620
|
+
// To start with, check if the starting positions can be tapped together.
|
|
621
|
+
if (startPosition.getDistance(prevStartPosition) > distanceThreshold) {
|
|
622
|
+
return false;
|
|
623
|
+
}
|
|
624
|
+
if (this.object instanceof osuBase.Circle || prev.object instanceof osuBase.Circle) {
|
|
625
|
+
return true;
|
|
626
|
+
}
|
|
627
|
+
// Check if all nested hitobjects can be hit together.
|
|
628
|
+
for (let i = 1; i < this.object.nestedHitObjects.length; ++i) {
|
|
629
|
+
const position = this.object.nestedHitObjects[i].getStackedPosition(osuBase.Modes.droid);
|
|
630
|
+
const prevPosition = prevStartPosition.add(prev.object.curvePositionAt(i / (this.object.nestedHitObjects.length - 1)));
|
|
631
|
+
if (position.getDistance(prevPosition) > distanceThreshold) {
|
|
632
|
+
return false;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
// Do the same for the previous slider as well.
|
|
636
|
+
for (let i = 1; i < prev.object.nestedHitObjects.length; ++i) {
|
|
637
|
+
const prevPosition = prev.object.nestedHitObjects[i].getStackedPosition(osuBase.Modes.droid);
|
|
638
|
+
const position = startPosition.add(this.object.curvePositionAt(i / (prev.object.nestedHitObjects.length - 1)));
|
|
639
|
+
if (prevPosition.getDistance(position) > distanceThreshold) {
|
|
640
|
+
return false;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
return true;
|
|
644
|
+
}
|
|
645
|
+
setVisuals(clockRate, hitObjects) {
|
|
646
|
+
// We'll have two visible object arrays. The first array contains objects before the current object starts in a reversed order,
|
|
647
|
+
// while the second array contains objects after the current object ends.
|
|
648
|
+
// For overlapping factor, we also need to consider previous visible objects.
|
|
649
|
+
const prevVisibleObjects = [];
|
|
650
|
+
const nextVisibleObjects = [];
|
|
651
|
+
for (let j = this.index + 2; j < hitObjects.length; ++j) {
|
|
652
|
+
const o = hitObjects[j];
|
|
653
|
+
if (o instanceof osuBase.Spinner) {
|
|
654
|
+
continue;
|
|
655
|
+
}
|
|
656
|
+
if (o.startTime / clockRate > this.endTime + this.timePreempt) {
|
|
657
|
+
break;
|
|
658
|
+
}
|
|
659
|
+
nextVisibleObjects.push(o);
|
|
660
|
+
}
|
|
661
|
+
for (let j = 0; j < this.index; ++j) {
|
|
662
|
+
const prev = this.previous(j);
|
|
663
|
+
if (prev.object instanceof osuBase.Spinner) {
|
|
664
|
+
continue;
|
|
665
|
+
}
|
|
666
|
+
if (prev.startTime >= this.startTime) {
|
|
667
|
+
continue;
|
|
668
|
+
}
|
|
669
|
+
if (prev.startTime < this.startTime - this.timePreempt) {
|
|
670
|
+
break;
|
|
671
|
+
}
|
|
672
|
+
prevVisibleObjects.push(prev.object);
|
|
673
|
+
}
|
|
674
|
+
for (const hitObject of prevVisibleObjects) {
|
|
675
|
+
const distance = this.object
|
|
676
|
+
.getStackedPosition(this.mode)
|
|
677
|
+
.getDistance(hitObject.getStackedEndPosition(this.mode));
|
|
678
|
+
const deltaTime = this.startTime - hitObject.endTime / clockRate;
|
|
679
|
+
this.applyToOverlappingFactor(distance, deltaTime);
|
|
680
|
+
}
|
|
681
|
+
for (const hitObject of nextVisibleObjects) {
|
|
682
|
+
const distance = hitObject
|
|
683
|
+
.getStackedPosition(this.mode)
|
|
684
|
+
.getDistance(this.object.getStackedEndPosition(this.mode));
|
|
685
|
+
const deltaTime = hitObject.startTime / clockRate - this.endTime;
|
|
686
|
+
if (deltaTime >= 0) {
|
|
687
|
+
this.noteDensity += 1 - deltaTime / this.timePreempt;
|
|
688
|
+
}
|
|
689
|
+
this.applyToOverlappingFactor(distance, deltaTime);
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
applyToOverlappingFactor(distance, deltaTime) {
|
|
693
|
+
// Penalize objects that are too close to the object in both distance
|
|
694
|
+
// and delta time to prevent stream maps from being overweighted.
|
|
695
|
+
this.overlappingFactor +=
|
|
696
|
+
Math.max(0, 1 - distance / (2.5 * this.object.radius)) *
|
|
697
|
+
(7.5 /
|
|
698
|
+
(1 +
|
|
699
|
+
Math.exp(0.15 *
|
|
700
|
+
(Math.max(deltaTime, DifficultyHitObject.minDeltaTime) -
|
|
701
|
+
75))));
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
|
|
499
705
|
/**
|
|
500
706
|
* An evaluator for calculating osu!droid Aim skill.
|
|
501
707
|
*/
|
|
@@ -531,6 +737,8 @@ class DroidAimEvaluator extends AimEvaluator {
|
|
|
531
737
|
}
|
|
532
738
|
const last = current.previous(0);
|
|
533
739
|
const lastLast = current.previous(1);
|
|
740
|
+
const radius = DroidDifficultyHitObject.normalizedRadius;
|
|
741
|
+
const diameter = DroidDifficultyHitObject.normalizedDiameter;
|
|
534
742
|
// Calculate the velocity to the current hitobject, which starts with a base distance / time assuming the last object is a hitcircle.
|
|
535
743
|
let currentVelocity = current.lazyJumpDistance / current.strainTime;
|
|
536
744
|
// But if the last object is a slider, then we extend the travel velocity through the slider into the current object.
|
|
@@ -557,6 +765,7 @@ class DroidAimEvaluator extends AimEvaluator {
|
|
|
557
765
|
let acuteAngleBonus = 0;
|
|
558
766
|
let sliderBonus = 0;
|
|
559
767
|
let velocityChangeBonus = 0;
|
|
768
|
+
let wiggleBonus = 0;
|
|
560
769
|
// Start strain with regular velocity.
|
|
561
770
|
let strain = currentVelocity;
|
|
562
771
|
if (
|
|
@@ -566,40 +775,40 @@ class DroidAimEvaluator extends AimEvaluator {
|
|
|
566
775
|
current.angle !== null &&
|
|
567
776
|
last.angle !== null &&
|
|
568
777
|
lastLast.angle !== null) {
|
|
778
|
+
const currentAngle = current.angle;
|
|
779
|
+
const lastAngle = last.angle;
|
|
569
780
|
// Rewarding angles, take the smaller velocity as base.
|
|
570
781
|
const angleBonus = Math.min(currentVelocity, prevVelocity);
|
|
571
782
|
wideAngleBonus = this.calculateWideAngleBonus(current.angle);
|
|
572
783
|
acuteAngleBonus = this.calculateAcuteAngleBonus(current.angle);
|
|
573
|
-
//
|
|
574
|
-
if (current.strainTime > 100) {
|
|
575
|
-
acuteAngleBonus = 0;
|
|
576
|
-
}
|
|
577
|
-
else {
|
|
578
|
-
acuteAngleBonus *=
|
|
579
|
-
// Multiply by previous angle, we don't want to buff unless this is a wiggle type pattern.
|
|
580
|
-
this.calculateAcuteAngleBonus(last.angle) *
|
|
581
|
-
// The maximum velocity we buff is equal to 125 / strainTime.
|
|
582
|
-
Math.min(angleBonus, 125 / current.strainTime) *
|
|
583
|
-
// Scale buff from 300 BPM 1/2 to 400 BPM 1/2.
|
|
584
|
-
Math.pow(Math.sin((Math.PI / 2) *
|
|
585
|
-
Math.min(1, (100 - current.strainTime) / 25)), 2) *
|
|
586
|
-
// Buff distance exceeding 50 (radius) up to 100 (diameter).
|
|
587
|
-
Math.pow(Math.sin(((Math.PI / 2) *
|
|
588
|
-
(osuBase.MathUtils.clamp(current.lazyJumpDistance, 50, 100) -
|
|
589
|
-
50)) /
|
|
590
|
-
50), 2);
|
|
591
|
-
}
|
|
592
|
-
// Penalize wide angles if they're repeated, reducing the penalty as last.angle gets more acute.
|
|
784
|
+
// Penalize angle repetition.
|
|
593
785
|
wideAngleBonus *=
|
|
594
|
-
|
|
595
|
-
(
|
|
596
|
-
Math.min(wideAngleBonus, Math.pow(this.calculateWideAngleBonus(last.angle), 3)));
|
|
597
|
-
// Penalize acute angles if they're repeated, reducing the penalty as lastLast.angle gets more obtuse.
|
|
786
|
+
1 -
|
|
787
|
+
Math.min(wideAngleBonus, Math.pow(this.calculateWideAngleBonus(lastAngle), 3));
|
|
598
788
|
acuteAngleBonus *=
|
|
599
|
-
0.
|
|
600
|
-
0.
|
|
789
|
+
0.08 +
|
|
790
|
+
0.92 *
|
|
601
791
|
(1 -
|
|
602
|
-
Math.min(acuteAngleBonus, Math.pow(this.calculateAcuteAngleBonus(
|
|
792
|
+
Math.min(acuteAngleBonus, Math.pow(this.calculateAcuteAngleBonus(lastAngle), 3)));
|
|
793
|
+
// Apply full wide angle bonus for distance more than one diameter
|
|
794
|
+
wideAngleBonus *=
|
|
795
|
+
angleBonus *
|
|
796
|
+
osuBase.MathUtils.smootherstep(current.lazyJumpDistance, 0, diameter);
|
|
797
|
+
// Apply acute angle bonus for BPM above 300 1/2 and distance more than one diameter
|
|
798
|
+
acuteAngleBonus *=
|
|
799
|
+
angleBonus *
|
|
800
|
+
osuBase.MathUtils.smootherstep(osuBase.MathUtils.millisecondsToBPM(current.strainTime, 2), 300, 400) *
|
|
801
|
+
osuBase.MathUtils.smootherstep(current.lazyJumpDistance, diameter, diameter * 2);
|
|
802
|
+
// Apply wiggle bonus for jumps that are [radius, 3*diameter] in distance, with < 110 angle
|
|
803
|
+
// https://www.desmos.com/calculator/dp0v0nvowc
|
|
804
|
+
wiggleBonus =
|
|
805
|
+
angleBonus *
|
|
806
|
+
osuBase.MathUtils.smootherstep(current.lazyJumpDistance, radius, diameter) *
|
|
807
|
+
Math.pow(osuBase.MathUtils.reverseLerp(current.lazyJumpDistance, diameter * 3, diameter), 1.8) *
|
|
808
|
+
osuBase.MathUtils.smootherstep(currentAngle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60)) *
|
|
809
|
+
osuBase.MathUtils.smootherstep(last.lazyJumpDistance, radius, diameter) *
|
|
810
|
+
Math.pow(osuBase.MathUtils.reverseLerp(last.lazyJumpDistance, diameter * 3, diameter), 1.8) *
|
|
811
|
+
osuBase.MathUtils.smootherstep(lastAngle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60));
|
|
603
812
|
}
|
|
604
813
|
if (Math.max(prevVelocity, currentVelocity)) {
|
|
605
814
|
// We want to use the average velocity over the whole object when awarding differences, not the individual jump and slider path velocities.
|
|
@@ -631,6 +840,7 @@ class DroidAimEvaluator extends AimEvaluator {
|
|
|
631
840
|
strain *= 0.5 * (1 + Math.sqrt(flowBonus));
|
|
632
841
|
wideAngleBonus *= 0.5 * (1 + Math.sqrt(flowBonus));
|
|
633
842
|
}
|
|
843
|
+
strain += wiggleBonus * this.wiggleMultiplier;
|
|
634
844
|
// Add in acute angle bonus or wide angle bonus + velocity change bonus, whichever is larger.
|
|
635
845
|
strain += Math.max(acuteAngleBonus * this.acuteAngleMultiplier, wideAngleBonus * this.wideAngleMultiplier +
|
|
636
846
|
velocityChangeBonus * this.velocityChangeMultiplier);
|
|
@@ -657,27 +867,20 @@ class DroidAimEvaluator extends AimEvaluator {
|
|
|
657
867
|
const travelDistance = (_a = prev === null || prev === void 0 ? void 0 : prev.travelDistance) !== null && _a !== void 0 ? _a : 0;
|
|
658
868
|
const distance = travelDistance + current.minimumJumpDistance;
|
|
659
869
|
const shortDistancePenalty = Math.min(1, Math.pow(distance / this.singleSpacingThreshold, 3.5));
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
const angleDiff = Math.abs(current.angle - prev.angle);
|
|
668
|
-
const adjustedAngleDiff = Math.sin(angleDiff / 2) * 180;
|
|
669
|
-
const angularVelocity = adjustedAngleDiff / (0.1 + current.strainTime);
|
|
670
|
-
const angularVelocityBonus = Math.max(0, Math.pow(angularVelocity, 0.4) - 1);
|
|
671
|
-
adjustedDistanceScale = 0.65 + angularVelocityBonus * 0.45;
|
|
672
|
-
}
|
|
673
|
-
return ((200 * speedBonus * shortDistancePenalty * adjustedDistanceScale) /
|
|
674
|
-
current.strainTime);
|
|
870
|
+
return (200 * speedBonus * shortDistancePenalty) / current.strainTime;
|
|
871
|
+
}
|
|
872
|
+
static calculateWideAngleBonus(angle) {
|
|
873
|
+
return osuBase.MathUtils.smoothstep(angle, osuBase.MathUtils.degreesToRadians(40), osuBase.MathUtils.degreesToRadians(140));
|
|
874
|
+
}
|
|
875
|
+
static calculateAcuteAngleBonus(angle) {
|
|
876
|
+
return osuBase.MathUtils.smoothstep(angle, osuBase.MathUtils.degreesToRadians(140), osuBase.MathUtils.degreesToRadians(40));
|
|
675
877
|
}
|
|
676
878
|
}
|
|
677
|
-
DroidAimEvaluator.wideAngleMultiplier = 1.
|
|
678
|
-
DroidAimEvaluator.
|
|
679
|
-
DroidAimEvaluator.
|
|
680
|
-
DroidAimEvaluator.
|
|
879
|
+
DroidAimEvaluator.wideAngleMultiplier = 1.5;
|
|
880
|
+
DroidAimEvaluator.acuteAngleMultiplier = 2.6;
|
|
881
|
+
DroidAimEvaluator.sliderMultiplier = 1.35;
|
|
882
|
+
DroidAimEvaluator.velocityChangeMultiplier = 0.75;
|
|
883
|
+
DroidAimEvaluator.singleSpacingThreshold = DroidDifficultyHitObject.normalizedDiameter;
|
|
681
884
|
// 200 1/4 BPM delta time
|
|
682
885
|
DroidAimEvaluator.minSpeedBonus = 75;
|
|
683
886
|
|
|
@@ -790,41 +993,6 @@ class StrainSkill extends Skill {
|
|
|
790
993
|
* and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
|
|
791
994
|
*/
|
|
792
995
|
class DroidSkill extends StrainSkill {
|
|
793
|
-
constructor() {
|
|
794
|
-
super(...arguments);
|
|
795
|
-
/**
|
|
796
|
-
* The minimum number of strains to judge when computing for retryability.
|
|
797
|
-
*/
|
|
798
|
-
this.minimumRetryabilityStrains = 500;
|
|
799
|
-
}
|
|
800
|
-
/**
|
|
801
|
-
* Computes the retryability of the beatmap based on the strains of the hitobjects.
|
|
802
|
-
*
|
|
803
|
-
* Earlier difficult strains indicate higher retryability.
|
|
804
|
-
*
|
|
805
|
-
* The result is scaled by clock rate as it affects the total number of strains.
|
|
806
|
-
*
|
|
807
|
-
* @returns A number between 0 and 1. A higher value indicates higher retryability.
|
|
808
|
-
*/
|
|
809
|
-
countRetryability() {
|
|
810
|
-
if (this._objectStrains.length === 0) {
|
|
811
|
-
return 0;
|
|
812
|
-
}
|
|
813
|
-
const maxStrain = Math.max(...this._objectStrains);
|
|
814
|
-
if (maxStrain === 0) {
|
|
815
|
-
return 0;
|
|
816
|
-
}
|
|
817
|
-
let weightedStrainSum = 0;
|
|
818
|
-
for (let i = 0; i < this._objectStrains.length; ++i) {
|
|
819
|
-
const strainRatio = this._objectStrains[i] / maxStrain;
|
|
820
|
-
// Give more weight to earlier strains.
|
|
821
|
-
const strainPositionWeight = 1 - Math.pow(i / this._objectStrains.length, 0.75) / 10;
|
|
822
|
-
weightedStrainSum += strainRatio * strainPositionWeight;
|
|
823
|
-
}
|
|
824
|
-
return (1 -
|
|
825
|
-
weightedStrainSum /
|
|
826
|
-
Math.max(this._objectStrains.length, this.minimumRetryabilityStrains));
|
|
827
|
-
}
|
|
828
996
|
process(current) {
|
|
829
997
|
super.process(current);
|
|
830
998
|
this._objectStrains.push(this.getObjectStrain(current));
|
|
@@ -863,15 +1031,34 @@ class DroidAim extends DroidSkill {
|
|
|
863
1031
|
this.reducedSectionCount = 10;
|
|
864
1032
|
this.reducedSectionBaseline = 0.75;
|
|
865
1033
|
this.starsPerDouble = 1.05;
|
|
866
|
-
this.skillMultiplier =
|
|
1034
|
+
this.skillMultiplier = 25.6;
|
|
867
1035
|
this.currentAimStrain = 0;
|
|
1036
|
+
this.sliderStrains = [];
|
|
868
1037
|
this.withSliders = withSliders;
|
|
869
1038
|
}
|
|
1039
|
+
/**
|
|
1040
|
+
* Obtains the amount of sliders that are considered difficult in terms of relative strain.
|
|
1041
|
+
*/
|
|
1042
|
+
countDifficultSliders() {
|
|
1043
|
+
if (this.sliderStrains.length === 0) {
|
|
1044
|
+
return 0;
|
|
1045
|
+
}
|
|
1046
|
+
const sortedStrains = this.sliderStrains.sort((a, b) => b - a);
|
|
1047
|
+
const maxSliderStrain = sortedStrains[0];
|
|
1048
|
+
if (maxSliderStrain === 0) {
|
|
1049
|
+
return 0;
|
|
1050
|
+
}
|
|
1051
|
+
return sortedStrains.reduce((total, strain) => total +
|
|
1052
|
+
1 / (1 + Math.exp(-((strain / maxSliderStrain) * 12 - 6))), 0);
|
|
1053
|
+
}
|
|
870
1054
|
strainValueAt(current) {
|
|
871
1055
|
this.currentAimStrain *= this.strainDecay(current.deltaTime);
|
|
872
1056
|
this.currentAimStrain +=
|
|
873
1057
|
DroidAimEvaluator.evaluateDifficultyOf(current, this.withSliders) *
|
|
874
1058
|
this.skillMultiplier;
|
|
1059
|
+
if (current.object instanceof osuBase.Slider) {
|
|
1060
|
+
this.sliderStrains.push(this.currentAimStrain);
|
|
1061
|
+
}
|
|
875
1062
|
return this.currentAimStrain;
|
|
876
1063
|
}
|
|
877
1064
|
calculateInitialStrain(time, current) {
|
|
@@ -913,15 +1100,13 @@ class DroidTapEvaluator extends SpeedEvaluator {
|
|
|
913
1100
|
* Evaluates the difficulty of tapping the current object, based on:
|
|
914
1101
|
*
|
|
915
1102
|
* - time between pressing the previous and current object,
|
|
916
|
-
* - distance between those objects,
|
|
917
1103
|
* - how easily they can be cheesed,
|
|
918
1104
|
* - and the strain time cap.
|
|
919
1105
|
*
|
|
920
1106
|
* @param current The current object.
|
|
921
1107
|
* @param considerCheesability Whether to consider cheesability.
|
|
922
|
-
* @param strainTimeCap The strain time to cap the object's strain time to.
|
|
923
1108
|
*/
|
|
924
|
-
static evaluateDifficultyOf(current, considerCheesability
|
|
1109
|
+
static evaluateDifficultyOf(current, considerCheesability) {
|
|
925
1110
|
if (current.object instanceof osuBase.Spinner ||
|
|
926
1111
|
// Exclude overlapping objects that can be tapped at once.
|
|
927
1112
|
current.isOverlapping(false)) {
|
|
@@ -930,17 +1115,14 @@ class DroidTapEvaluator extends SpeedEvaluator {
|
|
|
930
1115
|
const doubletapness = considerCheesability
|
|
931
1116
|
? 1 - current.doubletapness
|
|
932
1117
|
: 1;
|
|
933
|
-
const strainTime = strainTimeCap !== undefined
|
|
934
|
-
? // We cap the strain time to 50 here as the chance of vibro is higher in any BPM higher than 300.
|
|
935
|
-
Math.max(50, strainTimeCap, current.strainTime)
|
|
936
|
-
: current.strainTime;
|
|
937
1118
|
let speedBonus = 1;
|
|
938
|
-
if (strainTime < this.minSpeedBonus) {
|
|
1119
|
+
if (current.strainTime < this.minSpeedBonus) {
|
|
939
1120
|
speedBonus +=
|
|
940
1121
|
0.75 *
|
|
941
|
-
Math.pow(osuBase.ErrorFunction.erf((this.minSpeedBonus - strainTime) / 40), 2);
|
|
1122
|
+
Math.pow(osuBase.ErrorFunction.erf((this.minSpeedBonus - current.strainTime) / 40), 2);
|
|
942
1123
|
}
|
|
943
|
-
return (speedBonus * Math.pow(doubletapness, 1.5)) /
|
|
1124
|
+
return ((speedBonus * Math.pow(doubletapness, 1.5) * 1000) /
|
|
1125
|
+
current.strainTime);
|
|
944
1126
|
}
|
|
945
1127
|
}
|
|
946
1128
|
|
|
@@ -948,25 +1130,16 @@ class DroidTapEvaluator extends SpeedEvaluator {
|
|
|
948
1130
|
* Represents the skill required to press keys or tap with regards to keeping up with the speed at which objects need to be hit.
|
|
949
1131
|
*/
|
|
950
1132
|
class DroidTap extends DroidSkill {
|
|
951
|
-
|
|
952
|
-
* The delta time of hitobjects.
|
|
953
|
-
*/
|
|
954
|
-
get objectDeltaTimes() {
|
|
955
|
-
return this._objectDeltaTimes;
|
|
956
|
-
}
|
|
957
|
-
constructor(mods, considerCheesability, strainTimeCap) {
|
|
1133
|
+
constructor(mods, considerCheesability) {
|
|
958
1134
|
super(mods);
|
|
959
1135
|
this.reducedSectionCount = 10;
|
|
960
1136
|
this.reducedSectionBaseline = 0.75;
|
|
961
1137
|
this.strainDecayBase = 0.3;
|
|
962
1138
|
this.starsPerDouble = 1.1;
|
|
963
|
-
this.minimumRetryabilityStrains = 750;
|
|
964
1139
|
this.currentTapStrain = 0;
|
|
965
1140
|
this.currentRhythmMultiplier = 0;
|
|
966
|
-
this.skillMultiplier =
|
|
967
|
-
this._objectDeltaTimes = [];
|
|
1141
|
+
this.skillMultiplier = 1.375;
|
|
968
1142
|
this.considerCheesability = considerCheesability;
|
|
969
|
-
this.strainTimeCap = strainTimeCap;
|
|
970
1143
|
}
|
|
971
1144
|
/**
|
|
972
1145
|
* The amount of notes that are relevant to the difficulty.
|
|
@@ -981,31 +1154,11 @@ class DroidTap extends DroidSkill {
|
|
|
981
1154
|
}
|
|
982
1155
|
return this._objectStrains.reduce((total, next) => total + 1 / (1 + Math.exp(-((next / maxStrain) * 12 - 6))), 0);
|
|
983
1156
|
}
|
|
984
|
-
/**
|
|
985
|
-
* The delta time relevant to the difficulty.
|
|
986
|
-
*/
|
|
987
|
-
relevantDeltaTime() {
|
|
988
|
-
if (this._objectStrains.length === 0) {
|
|
989
|
-
return 0;
|
|
990
|
-
}
|
|
991
|
-
const maxStrain = Math.max(...this._objectStrains);
|
|
992
|
-
if (maxStrain === 0) {
|
|
993
|
-
return 0;
|
|
994
|
-
}
|
|
995
|
-
return (this._objectDeltaTimes.reduce((total, next, index) => total +
|
|
996
|
-
(next * 1) /
|
|
997
|
-
(1 +
|
|
998
|
-
Math.exp(-((this._objectStrains[index] / maxStrain) *
|
|
999
|
-
25 -
|
|
1000
|
-
20))), 0) /
|
|
1001
|
-
this._objectStrains.reduce((total, next) => total + 1 / (1 + Math.exp(-((next / maxStrain) * 25 - 20))), 0));
|
|
1002
|
-
}
|
|
1003
1157
|
strainValueAt(current) {
|
|
1004
1158
|
this.currentTapStrain *= this.strainDecay(current.strainTime);
|
|
1005
1159
|
this.currentTapStrain +=
|
|
1006
|
-
DroidTapEvaluator.evaluateDifficultyOf(current, this.considerCheesability
|
|
1160
|
+
DroidTapEvaluator.evaluateDifficultyOf(current, this.considerCheesability) * this.skillMultiplier;
|
|
1007
1161
|
this.currentRhythmMultiplier = current.rhythmMultiplier;
|
|
1008
|
-
this._objectDeltaTimes.push(current.deltaTime);
|
|
1009
1162
|
return this.currentTapStrain * current.rhythmMultiplier;
|
|
1010
1163
|
}
|
|
1011
1164
|
calculateInitialStrain(time, current) {
|
|
@@ -1021,9 +1174,6 @@ class DroidTap extends DroidSkill {
|
|
|
1021
1174
|
* @param current The hitobject to save to.
|
|
1022
1175
|
*/
|
|
1023
1176
|
saveToHitObject(current) {
|
|
1024
|
-
if (this.strainTimeCap !== undefined) {
|
|
1025
|
-
return;
|
|
1026
|
-
}
|
|
1027
1177
|
const strain = this.currentTapStrain * this.currentRhythmMultiplier;
|
|
1028
1178
|
if (this.considerCheesability) {
|
|
1029
1179
|
current.tapStrain = strain;
|
|
@@ -1078,13 +1228,13 @@ class DroidFlashlightEvaluator extends FlashlightEvaluator {
|
|
|
1078
1228
|
let angleRepeatCount = 0;
|
|
1079
1229
|
for (let i = 0; i < Math.min(current.index, 10); ++i) {
|
|
1080
1230
|
const currentObject = current.previous(i);
|
|
1231
|
+
cumulativeStrainTime += last.strainTime;
|
|
1081
1232
|
if (!(currentObject.object instanceof osuBase.Spinner) &&
|
|
1082
1233
|
// Exclude overlapping objects that can be tapped at once.
|
|
1083
1234
|
!currentObject.isOverlapping(false)) {
|
|
1084
1235
|
const jumpDistance = current.object
|
|
1085
1236
|
.getStackedPosition(osuBase.Modes.droid)
|
|
1086
1237
|
.subtract(currentObject.object.getStackedEndPosition(osuBase.Modes.droid)).length;
|
|
1087
|
-
cumulativeStrainTime += last.strainTime;
|
|
1088
1238
|
// We want to nerf objects that can be easily seen within the Flashlight circle radius.
|
|
1089
1239
|
if (i === 0) {
|
|
1090
1240
|
smallDistNerf = Math.min(1, jumpDistance / 75);
|
|
@@ -1317,7 +1467,7 @@ class DroidRhythmEvaluator {
|
|
|
1317
1467
|
}
|
|
1318
1468
|
// Repeated island (ex: triplet -> triplet).
|
|
1319
1469
|
// Graph: https://www.desmos.com/calculator/pj7an56zwf
|
|
1320
|
-
effectiveRatio *= Math.min(3 / islandCount, Math.pow(1 / islandCount,
|
|
1470
|
+
effectiveRatio *= Math.min(3 / islandCount, Math.pow(1 / islandCount, osuBase.MathUtils.offsetLogistic(island.delta, 58.33, 0.24, 2.75)));
|
|
1321
1471
|
break;
|
|
1322
1472
|
}
|
|
1323
1473
|
if (!islandFound) {
|
|
@@ -1540,202 +1690,6 @@ class DroidVisual extends DroidSkill {
|
|
|
1540
1690
|
}
|
|
1541
1691
|
}
|
|
1542
1692
|
|
|
1543
|
-
/**
|
|
1544
|
-
* Represents an osu!droid hit object with difficulty calculation values.
|
|
1545
|
-
*/
|
|
1546
|
-
class DroidDifficultyHitObject extends DifficultyHitObject {
|
|
1547
|
-
get scalingFactor() {
|
|
1548
|
-
const radius = this.object.radius;
|
|
1549
|
-
// We will scale distances by this factor, so we can assume a uniform CircleSize among beatmaps.
|
|
1550
|
-
let scalingFactor = this.normalizedRadius / radius;
|
|
1551
|
-
// High circle size (small CS) bonus
|
|
1552
|
-
if (radius < this.radiusBuffThreshold) {
|
|
1553
|
-
scalingFactor *=
|
|
1554
|
-
1 + Math.pow((this.radiusBuffThreshold - radius) / 50, 2);
|
|
1555
|
-
}
|
|
1556
|
-
return scalingFactor;
|
|
1557
|
-
}
|
|
1558
|
-
/**
|
|
1559
|
-
* Note: You **must** call `computeProperties` at some point due to how TypeScript handles
|
|
1560
|
-
* overridden properties (see [this](https://github.com/microsoft/TypeScript/issues/1617) GitHub issue).
|
|
1561
|
-
*
|
|
1562
|
-
* @param object The underlying hitobject.
|
|
1563
|
-
* @param lastObject The hitobject before this hitobject.
|
|
1564
|
-
* @param lastLastObject The hitobject before the last hitobject.
|
|
1565
|
-
* @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
|
|
1566
|
-
* @param clockRate The clock rate of the beatmap.
|
|
1567
|
-
*/
|
|
1568
|
-
constructor(object, lastObject, lastLastObject, difficultyHitObjects, clockRate) {
|
|
1569
|
-
super(object, lastObject, lastLastObject, difficultyHitObjects, clockRate);
|
|
1570
|
-
/**
|
|
1571
|
-
* The tap strain generated by the hitobject.
|
|
1572
|
-
*/
|
|
1573
|
-
this.tapStrain = 0;
|
|
1574
|
-
/**
|
|
1575
|
-
* The tap strain generated by the hitobject if `strainTime` isn't modified by
|
|
1576
|
-
* OD. This is used in three-finger detection.
|
|
1577
|
-
*/
|
|
1578
|
-
this.originalTapStrain = 0;
|
|
1579
|
-
/**
|
|
1580
|
-
* The rhythm strain generated by the hitobject.
|
|
1581
|
-
*/
|
|
1582
|
-
this.rhythmStrain = 0;
|
|
1583
|
-
/**
|
|
1584
|
-
* The flashlight strain generated by the hitobject if sliders are considered.
|
|
1585
|
-
*/
|
|
1586
|
-
this.flashlightStrainWithSliders = 0;
|
|
1587
|
-
/**
|
|
1588
|
-
* The flashlight strain generated by the hitobject if sliders are not considered.
|
|
1589
|
-
*/
|
|
1590
|
-
this.flashlightStrainWithoutSliders = 0;
|
|
1591
|
-
/**
|
|
1592
|
-
* The visual strain generated by the hitobject if sliders are considered.
|
|
1593
|
-
*/
|
|
1594
|
-
this.visualStrainWithSliders = 0;
|
|
1595
|
-
/**
|
|
1596
|
-
* The visual strain generated by the hitobject if sliders are not considered.
|
|
1597
|
-
*/
|
|
1598
|
-
this.visualStrainWithoutSliders = 0;
|
|
1599
|
-
/**
|
|
1600
|
-
* The note density of the hitobject.
|
|
1601
|
-
*/
|
|
1602
|
-
this.noteDensity = 1;
|
|
1603
|
-
/**
|
|
1604
|
-
* The overlapping factor of the hitobject.
|
|
1605
|
-
*
|
|
1606
|
-
* This is used to scale visual skill.
|
|
1607
|
-
*/
|
|
1608
|
-
this.overlappingFactor = 0;
|
|
1609
|
-
this.radiusBuffThreshold = 70;
|
|
1610
|
-
this.mode = osuBase.Modes.droid;
|
|
1611
|
-
this.maximumSliderRadius = this.normalizedRadius * 2;
|
|
1612
|
-
this.timePreempt = object.timePreempt / clockRate;
|
|
1613
|
-
}
|
|
1614
|
-
computeProperties(clockRate, hitObjects) {
|
|
1615
|
-
super.computeProperties(clockRate, hitObjects);
|
|
1616
|
-
this.setVisuals(clockRate, hitObjects);
|
|
1617
|
-
}
|
|
1618
|
-
/**
|
|
1619
|
-
* Determines whether this hitobject is considered overlapping with the hitobject before it.
|
|
1620
|
-
*
|
|
1621
|
-
* Keep in mind that "overlapping" in this case is overlapping to the point where both hitobjects
|
|
1622
|
-
* can be hit with just a single tap in osu!droid.
|
|
1623
|
-
*
|
|
1624
|
-
* In the case of sliders, it is considered overlapping if all nested hitobjects can be hit with
|
|
1625
|
-
* one aim motion.
|
|
1626
|
-
*
|
|
1627
|
-
* @param considerDistance Whether to consider the distance between both hitobjects.
|
|
1628
|
-
* @returns Whether the hitobject is considered overlapping.
|
|
1629
|
-
*/
|
|
1630
|
-
isOverlapping(considerDistance) {
|
|
1631
|
-
if (this.object instanceof osuBase.Spinner) {
|
|
1632
|
-
return false;
|
|
1633
|
-
}
|
|
1634
|
-
const prev = this.previous(0);
|
|
1635
|
-
if (!prev || prev.object instanceof osuBase.Spinner) {
|
|
1636
|
-
return false;
|
|
1637
|
-
}
|
|
1638
|
-
if (this.object.startTime !== prev.object.startTime) {
|
|
1639
|
-
return false;
|
|
1640
|
-
}
|
|
1641
|
-
if (!considerDistance) {
|
|
1642
|
-
return true;
|
|
1643
|
-
}
|
|
1644
|
-
const distanceThreshold = 2 * this.object.radius;
|
|
1645
|
-
const startPosition = this.object.getStackedPosition(osuBase.Modes.droid);
|
|
1646
|
-
const prevStartPosition = prev.object.getStackedPosition(osuBase.Modes.droid);
|
|
1647
|
-
// We need to consider two cases:
|
|
1648
|
-
//
|
|
1649
|
-
// Case 1: Current object is a circle, or previous object is a circle.
|
|
1650
|
-
// In this case, we only need to check if their positions are close enough to be tapped together.
|
|
1651
|
-
//
|
|
1652
|
-
// Case 2: Both objects are sliders.
|
|
1653
|
-
// In this case, we need to check if all nested hitobjects can be hit together.
|
|
1654
|
-
// To start with, check if the starting positions can be tapped together.
|
|
1655
|
-
if (startPosition.getDistance(prevStartPosition) > distanceThreshold) {
|
|
1656
|
-
return false;
|
|
1657
|
-
}
|
|
1658
|
-
if (this.object instanceof osuBase.Circle || prev.object instanceof osuBase.Circle) {
|
|
1659
|
-
return true;
|
|
1660
|
-
}
|
|
1661
|
-
// Check if all nested hitobjects can be hit together.
|
|
1662
|
-
for (let i = 1; i < this.object.nestedHitObjects.length; ++i) {
|
|
1663
|
-
const position = this.object.nestedHitObjects[i].getStackedPosition(osuBase.Modes.droid);
|
|
1664
|
-
const prevPosition = prevStartPosition.add(prev.object.curvePositionAt(i / (this.object.nestedHitObjects.length - 1)));
|
|
1665
|
-
if (position.getDistance(prevPosition) > distanceThreshold) {
|
|
1666
|
-
return false;
|
|
1667
|
-
}
|
|
1668
|
-
}
|
|
1669
|
-
// Do the same for the previous slider as well.
|
|
1670
|
-
for (let i = 1; i < prev.object.nestedHitObjects.length; ++i) {
|
|
1671
|
-
const prevPosition = prev.object.nestedHitObjects[i].getStackedPosition(osuBase.Modes.droid);
|
|
1672
|
-
const position = startPosition.add(this.object.curvePositionAt(i / (prev.object.nestedHitObjects.length - 1)));
|
|
1673
|
-
if (prevPosition.getDistance(position) > distanceThreshold) {
|
|
1674
|
-
return false;
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
return true;
|
|
1678
|
-
}
|
|
1679
|
-
setVisuals(clockRate, hitObjects) {
|
|
1680
|
-
// We'll have two visible object arrays. The first array contains objects before the current object starts in a reversed order,
|
|
1681
|
-
// while the second array contains objects after the current object ends.
|
|
1682
|
-
// For overlapping factor, we also need to consider previous visible objects.
|
|
1683
|
-
const prevVisibleObjects = [];
|
|
1684
|
-
const nextVisibleObjects = [];
|
|
1685
|
-
for (let j = this.index + 2; j < hitObjects.length; ++j) {
|
|
1686
|
-
const o = hitObjects[j];
|
|
1687
|
-
if (o instanceof osuBase.Spinner) {
|
|
1688
|
-
continue;
|
|
1689
|
-
}
|
|
1690
|
-
if (o.startTime / clockRate > this.endTime + this.timePreempt) {
|
|
1691
|
-
break;
|
|
1692
|
-
}
|
|
1693
|
-
nextVisibleObjects.push(o);
|
|
1694
|
-
}
|
|
1695
|
-
for (let j = 0; j < this.index; ++j) {
|
|
1696
|
-
const prev = this.previous(j);
|
|
1697
|
-
if (prev.object instanceof osuBase.Spinner) {
|
|
1698
|
-
continue;
|
|
1699
|
-
}
|
|
1700
|
-
if (prev.startTime >= this.startTime) {
|
|
1701
|
-
continue;
|
|
1702
|
-
}
|
|
1703
|
-
if (prev.startTime < this.startTime - this.timePreempt) {
|
|
1704
|
-
break;
|
|
1705
|
-
}
|
|
1706
|
-
prevVisibleObjects.push(prev.object);
|
|
1707
|
-
}
|
|
1708
|
-
for (const hitObject of prevVisibleObjects) {
|
|
1709
|
-
const distance = this.object
|
|
1710
|
-
.getStackedPosition(this.mode)
|
|
1711
|
-
.getDistance(hitObject.getStackedEndPosition(this.mode));
|
|
1712
|
-
const deltaTime = this.startTime - hitObject.endTime / clockRate;
|
|
1713
|
-
this.applyToOverlappingFactor(distance, deltaTime);
|
|
1714
|
-
}
|
|
1715
|
-
for (const hitObject of nextVisibleObjects) {
|
|
1716
|
-
const distance = hitObject
|
|
1717
|
-
.getStackedPosition(this.mode)
|
|
1718
|
-
.getDistance(this.object.getStackedEndPosition(this.mode));
|
|
1719
|
-
const deltaTime = hitObject.startTime / clockRate - this.endTime;
|
|
1720
|
-
if (deltaTime >= 0) {
|
|
1721
|
-
this.noteDensity += 1 - deltaTime / this.timePreempt;
|
|
1722
|
-
}
|
|
1723
|
-
this.applyToOverlappingFactor(distance, deltaTime);
|
|
1724
|
-
}
|
|
1725
|
-
}
|
|
1726
|
-
applyToOverlappingFactor(distance, deltaTime) {
|
|
1727
|
-
// Penalize objects that are too close to the object in both distance
|
|
1728
|
-
// and delta time to prevent stream maps from being overweighted.
|
|
1729
|
-
this.overlappingFactor +=
|
|
1730
|
-
Math.max(0, 1 - distance / (2.5 * this.object.radius)) *
|
|
1731
|
-
(7.5 /
|
|
1732
|
-
(1 +
|
|
1733
|
-
Math.exp(0.15 *
|
|
1734
|
-
(Math.max(deltaTime, DifficultyHitObject.minDeltaTime) -
|
|
1735
|
-
75))));
|
|
1736
|
-
}
|
|
1737
|
-
}
|
|
1738
|
-
|
|
1739
1693
|
/**
|
|
1740
1694
|
* A difficulty calculator for osu!droid gamemode.
|
|
1741
1695
|
*/
|
|
@@ -1744,6 +1698,7 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1744
1698
|
super(...arguments);
|
|
1745
1699
|
this.attributes = {
|
|
1746
1700
|
mode: "rebalance",
|
|
1701
|
+
aimDifficultSliderCount: 0,
|
|
1747
1702
|
tapDifficulty: 0,
|
|
1748
1703
|
rhythmDifficulty: 0,
|
|
1749
1704
|
visualDifficulty: 0,
|
|
@@ -1768,8 +1723,6 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1768
1723
|
visualSliderFactor: 0,
|
|
1769
1724
|
possibleThreeFingeredSections: [],
|
|
1770
1725
|
difficultSliders: [],
|
|
1771
|
-
averageSpeedDeltaTime: 0,
|
|
1772
|
-
vibroFactor: 1,
|
|
1773
1726
|
};
|
|
1774
1727
|
this.difficultyMultiplier = 0.18;
|
|
1775
1728
|
this.mode = osuBase.Modes.droid;
|
|
@@ -1827,9 +1780,7 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1827
1780
|
const tapSkillCheese = new DroidTap(this.mods, true);
|
|
1828
1781
|
const tapSkillNoCheese = new DroidTap(this.mods, false);
|
|
1829
1782
|
this.calculateSkills(tapSkillCheese, tapSkillNoCheese);
|
|
1830
|
-
|
|
1831
|
-
this.calculateSkills(tapSkillVibro);
|
|
1832
|
-
this.postCalculateTap(tapSkillCheese, tapSkillVibro);
|
|
1783
|
+
this.postCalculateTap(tapSkillCheese);
|
|
1833
1784
|
}
|
|
1834
1785
|
/**
|
|
1835
1786
|
* Calculates the rhythm star rating of the beatmap and stores it in this instance.
|
|
@@ -1895,10 +1846,8 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1895
1846
|
const flashlightSkillWithoutSliders = skills[6];
|
|
1896
1847
|
const visualSkill = skills[7];
|
|
1897
1848
|
const visualSkillWithoutSliders = skills[8];
|
|
1898
|
-
const tapSkillVibro = new DroidTap(this.mods, true, tapSkillCheese.relevantDeltaTime());
|
|
1899
|
-
this.calculateSkills(tapSkillVibro);
|
|
1900
1849
|
this.postCalculateAim(aimSkill, aimSkillWithoutSliders);
|
|
1901
|
-
this.postCalculateTap(tapSkillCheese
|
|
1850
|
+
this.postCalculateTap(tapSkillCheese);
|
|
1902
1851
|
this.postCalculateRhythm(rhythmSkill);
|
|
1903
1852
|
this.postCalculateFlashlight(flashlightSkill, flashlightSkillWithoutSliders);
|
|
1904
1853
|
this.postCalculateVisual(visualSkill, visualSkillWithoutSliders);
|
|
@@ -1958,14 +1907,12 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1958
1907
|
postCalculateAim(aimSkill, aimSkillWithoutSliders) {
|
|
1959
1908
|
this.strainPeaks.aimWithSliders = aimSkill.strainPeaks;
|
|
1960
1909
|
this.strainPeaks.aimWithoutSliders = aimSkillWithoutSliders.strainPeaks;
|
|
1961
|
-
const retryabilityScaling = this.calculateRetryabilityScaling(aimSkill.countRetryability());
|
|
1962
1910
|
this.attributes.aimDifficulty = this.mods.some((m) => m instanceof osuBase.ModAutopilot)
|
|
1963
1911
|
? 0
|
|
1964
|
-
: this.starValue(aimSkill.difficultyValue())
|
|
1912
|
+
: this.starValue(aimSkill.difficultyValue());
|
|
1965
1913
|
if (this.aim) {
|
|
1966
1914
|
this.attributes.sliderFactor =
|
|
1967
|
-
|
|
1968
|
-
retryabilityScaling) /
|
|
1915
|
+
this.starValue(aimSkillWithoutSliders.difficultyValue()) /
|
|
1969
1916
|
this.aim;
|
|
1970
1917
|
}
|
|
1971
1918
|
if (this.mods.some((m) => m instanceof osuBase.ModRelax)) {
|
|
@@ -1973,6 +1920,8 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
1973
1920
|
}
|
|
1974
1921
|
this.attributes.aimDifficultStrainCount =
|
|
1975
1922
|
aimSkill.countDifficultStrains();
|
|
1923
|
+
this.attributes.aimDifficultSliderCount =
|
|
1924
|
+
aimSkill.countDifficultSliders();
|
|
1976
1925
|
this.calculateAimAttributes();
|
|
1977
1926
|
}
|
|
1978
1927
|
/**
|
|
@@ -2013,24 +1962,13 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
2013
1962
|
* Called after tap skill calculation.
|
|
2014
1963
|
*
|
|
2015
1964
|
* @param tapSkillCheese The tap skill that considers cheesing.
|
|
2016
|
-
* @param tapSkillVibro The tap skill that considers vibro.
|
|
2017
1965
|
*/
|
|
2018
|
-
postCalculateTap(tapSkillCheese
|
|
1966
|
+
postCalculateTap(tapSkillCheese) {
|
|
2019
1967
|
this.strainPeaks.speed = tapSkillCheese.strainPeaks;
|
|
2020
|
-
const retryabilityScaling = this.calculateRetryabilityScaling(tapSkillCheese.countRetryability());
|
|
2021
1968
|
this.attributes.tapDifficulty = this.mods.some((m) => m instanceof osuBase.ModRelax)
|
|
2022
1969
|
? 0
|
|
2023
|
-
: this.starValue(tapSkillCheese.difficultyValue())
|
|
2024
|
-
retryabilityScaling;
|
|
2025
|
-
if (this.tap) {
|
|
2026
|
-
this.attributes.vibroFactor =
|
|
2027
|
-
(this.starValue(tapSkillVibro.difficultyValue()) *
|
|
2028
|
-
retryabilityScaling) /
|
|
2029
|
-
this.tap;
|
|
2030
|
-
}
|
|
1970
|
+
: this.starValue(tapSkillCheese.difficultyValue());
|
|
2031
1971
|
this.attributes.speedNoteCount = tapSkillCheese.relevantNoteCount();
|
|
2032
|
-
this.attributes.averageSpeedDeltaTime =
|
|
2033
|
-
tapSkillCheese.relevantDeltaTime();
|
|
2034
1972
|
this.attributes.tapDifficultStrainCount =
|
|
2035
1973
|
tapSkillCheese.countDifficultStrains();
|
|
2036
1974
|
this.calculateTapAttributes();
|
|
@@ -2110,6 +2048,9 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
|
|
|
2110
2048
|
if (this.mods.some((m) => m instanceof osuBase.ModRelax)) {
|
|
2111
2049
|
this.attributes.flashlightDifficulty *= 0.7;
|
|
2112
2050
|
}
|
|
2051
|
+
else if (this.mods.some((m) => m instanceof osuBase.ModAutopilot)) {
|
|
2052
|
+
this.attributes.flashlightDifficulty *= 0.4;
|
|
2053
|
+
}
|
|
2113
2054
|
this.attributes.flashlightDifficultStrainCount =
|
|
2114
2055
|
flashlightSkill.countDifficultStrains();
|
|
2115
2056
|
}
|
|
@@ -2204,6 +2145,14 @@ class PerformanceCalculator {
|
|
|
2204
2145
|
this.computedAccuracy.n100 +
|
|
2205
2146
|
this.computedAccuracy.n50);
|
|
2206
2147
|
}
|
|
2148
|
+
/**
|
|
2149
|
+
* The total of imperfect hits (100s, 50s, misses).
|
|
2150
|
+
*/
|
|
2151
|
+
get totalImperfectHits() {
|
|
2152
|
+
return (this.computedAccuracy.n100 +
|
|
2153
|
+
this.computedAccuracy.n50 +
|
|
2154
|
+
this.computedAccuracy.nmiss);
|
|
2155
|
+
}
|
|
2207
2156
|
/**
|
|
2208
2157
|
* Calculates the base performance value of a star rating.
|
|
2209
2158
|
*/
|
|
@@ -2271,9 +2220,7 @@ class PerformanceCalculator {
|
|
|
2271
2220
|
if (this.difficultyAttributes.sliderCount > 0) {
|
|
2272
2221
|
// We assume 15% of sliders in a beatmap are difficult since there's no way to tell from the performance calculator.
|
|
2273
2222
|
const estimateDifficultSliders = this.difficultyAttributes.sliderCount * 0.15;
|
|
2274
|
-
const estimateSliderEndsDropped = osuBase.MathUtils.clamp(Math.min(this.
|
|
2275
|
-
this.computedAccuracy.n50 +
|
|
2276
|
-
this.computedAccuracy.nmiss, maxCombo - combo), 0, estimateDifficultSliders);
|
|
2223
|
+
const estimateSliderEndsDropped = osuBase.MathUtils.clamp(Math.min(this.totalImperfectHits, maxCombo - combo), 0, estimateDifficultSliders);
|
|
2277
2224
|
this.sliderNerfFactor =
|
|
2278
2225
|
(1 - this.difficultyAttributes.sliderFactor) *
|
|
2279
2226
|
Math.pow(1 -
|
|
@@ -2308,9 +2255,7 @@ class PerformanceCalculator {
|
|
|
2308
2255
|
const fullComboThreshold = maxCombo - 0.1 * this.difficultyAttributes.sliderCount;
|
|
2309
2256
|
if (combo < fullComboThreshold) {
|
|
2310
2257
|
// Clamp miss count to maximum amount of possible breaks.
|
|
2311
|
-
comboBasedMissCount = Math.min(fullComboThreshold / Math.max(1, combo), this.
|
|
2312
|
-
this.computedAccuracy.n50 +
|
|
2313
|
-
this.computedAccuracy.nmiss);
|
|
2258
|
+
comboBasedMissCount = Math.min(fullComboThreshold / Math.max(1, combo), this.totalImperfectHits);
|
|
2314
2259
|
}
|
|
2315
2260
|
}
|
|
2316
2261
|
return Math.max(this.computedAccuracy.nmiss, comboBasedMissCount);
|
|
@@ -2503,7 +2448,7 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2503
2448
|
Math.pow(this.visual, 1.1), 1 / 1.1) * this.finalMultiplier);
|
|
2504
2449
|
}
|
|
2505
2450
|
handleOptions(options) {
|
|
2506
|
-
var _a, _b, _c, _d;
|
|
2451
|
+
var _a, _b, _c, _d, _e;
|
|
2507
2452
|
this._tapPenalty = (_a = options === null || options === void 0 ? void 0 : options.tapPenalty) !== null && _a !== void 0 ? _a : 1;
|
|
2508
2453
|
this._aimSliderCheesePenalty = (_b = options === null || options === void 0 ? void 0 : options.aimSliderCheesePenalty) !== null && _b !== void 0 ? _b : 1;
|
|
2509
2454
|
this._flashlightSliderCheesePenalty =
|
|
@@ -2511,6 +2456,18 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2511
2456
|
this._visualSliderCheesePenalty =
|
|
2512
2457
|
(_d = options === null || options === void 0 ? void 0 : options.visualSliderCheesePenalty) !== null && _d !== void 0 ? _d : 1;
|
|
2513
2458
|
super.handleOptions(options);
|
|
2459
|
+
const { maxCombo, aimDifficultSliderCount, sliderFactor } = this.difficultyAttributes;
|
|
2460
|
+
const combo = (_e = options === null || options === void 0 ? void 0 : options.combo) !== null && _e !== void 0 ? _e : maxCombo - this.computedAccuracy.nmiss;
|
|
2461
|
+
if (aimDifficultSliderCount > 0) {
|
|
2462
|
+
// Consider all missing combo to be dropped difficult sliders.
|
|
2463
|
+
const estimateImproperlyFollowedDifficultSliders = osuBase.MathUtils.clamp(Math.min(this.totalImperfectHits, maxCombo - combo), 0, aimDifficultSliderCount);
|
|
2464
|
+
this.sliderNerfFactor =
|
|
2465
|
+
(1 - sliderFactor) *
|
|
2466
|
+
Math.pow(1 -
|
|
2467
|
+
estimateImproperlyFollowedDifficultSliders /
|
|
2468
|
+
aimDifficultSliderCount, 3) +
|
|
2469
|
+
sliderFactor;
|
|
2470
|
+
}
|
|
2514
2471
|
}
|
|
2515
2472
|
/**
|
|
2516
2473
|
* Calculates the aim performance value of the beatmap.
|
|
@@ -2542,32 +2499,12 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2542
2499
|
// Consider notes that are difficult to tap with respect to other notes, but
|
|
2543
2500
|
// also cap the note count to prevent buffing filler patterns.
|
|
2544
2501
|
tapValue *= this.calculateDeviationBasedLengthScaling(Math.min(this.difficultyAttributes.speedNoteCount, this.totalHits / 1.45));
|
|
2545
|
-
// Normalize the deviation to 300 BPM.
|
|
2546
|
-
const normalizedDeviation = this.tapDeviation *
|
|
2547
|
-
Math.max(1, 50 / this.difficultyAttributes.averageSpeedDeltaTime);
|
|
2548
|
-
// We expect the player to get 7500/x deviation when doubletapping x BPM.
|
|
2549
|
-
// Using this expectation, we penalize scores with deviation above 25.
|
|
2550
|
-
const averageBPM = 60000 / 4 / this.difficultyAttributes.averageSpeedDeltaTime;
|
|
2551
|
-
const adjustedDeviation = normalizedDeviation *
|
|
2552
|
-
(1 +
|
|
2553
|
-
1 /
|
|
2554
|
-
(1 +
|
|
2555
|
-
Math.exp(-(normalizedDeviation - 7500 / averageBPM) /
|
|
2556
|
-
((2 * 300) / averageBPM))));
|
|
2557
2502
|
// Scale the tap value with tap deviation.
|
|
2558
2503
|
tapValue *=
|
|
2559
2504
|
1.05 *
|
|
2560
|
-
Math.pow(osuBase.ErrorFunction.erf(20 / (Math.SQRT2 *
|
|
2561
|
-
//
|
|
2562
|
-
|
|
2563
|
-
// it can be assumed that the player taps invariant to rhythm.
|
|
2564
|
-
// We harshen the punishment for such scenario.
|
|
2565
|
-
tapValue *=
|
|
2566
|
-
(1 - Math.pow(this.difficultyAttributes.vibroFactor, 6)) /
|
|
2567
|
-
(1 +
|
|
2568
|
-
Math.exp((this._tapDeviation - 7500 / averageBPM) /
|
|
2569
|
-
((2 * 300) / averageBPM))) +
|
|
2570
|
-
Math.pow(this.difficultyAttributes.vibroFactor, 6);
|
|
2505
|
+
Math.pow(osuBase.ErrorFunction.erf(20 / (Math.SQRT2 * this.tapDeviation)), 0.6);
|
|
2506
|
+
// Scale the tap value with high deviation nerf.
|
|
2507
|
+
tapValue *= this.calculateTapHighDeviationNerf();
|
|
2571
2508
|
// Scale the tap value with three-fingered penalty.
|
|
2572
2509
|
tapValue /= this._tapPenalty;
|
|
2573
2510
|
// OD 8 SS stays the same.
|
|
@@ -2825,6 +2762,32 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
|
|
|
2825
2762
|
}
|
|
2826
2763
|
return Number.POSITIVE_INFINITY;
|
|
2827
2764
|
}
|
|
2765
|
+
/**
|
|
2766
|
+
* Calculates multiplier for tap to account for improper tapping based on the deviation and tap difficulty.
|
|
2767
|
+
*
|
|
2768
|
+
* https://www.desmos.com/calculator/dmogdhzofn
|
|
2769
|
+
*/
|
|
2770
|
+
calculateTapHighDeviationNerf() {
|
|
2771
|
+
if (this.tapDeviation === Number.POSITIVE_INFINITY) {
|
|
2772
|
+
return 0;
|
|
2773
|
+
}
|
|
2774
|
+
const tapValue = this.baseValue(this.difficultyAttributes.tapDifficulty);
|
|
2775
|
+
// Decide a point where the PP value achieved compared to the tap deviation is assumed to be
|
|
2776
|
+
// tapped improperly. Any PP above this point is considered "excess" tap difficulty.
|
|
2777
|
+
// This is used to cause PP above the cutoff to scale logarithmically towards the original
|
|
2778
|
+
// tap value, thus nerfing the value.
|
|
2779
|
+
const excessTapDifficultyCutoff = 100 + 220 * Math.pow(22 / this.tapDeviation, 6.5);
|
|
2780
|
+
if (tapValue <= excessTapDifficultyCutoff) {
|
|
2781
|
+
return 1;
|
|
2782
|
+
}
|
|
2783
|
+
const scale = 50;
|
|
2784
|
+
const adjustedTapValue = scale *
|
|
2785
|
+
(Math.log((tapValue - excessTapDifficultyCutoff) / scale + 1) +
|
|
2786
|
+
excessTapDifficultyCutoff / scale);
|
|
2787
|
+
// 200 UR and less are considered tapped correctly to ensure that normal scores will be punished as little as possible
|
|
2788
|
+
const lerp = 1 - osuBase.MathUtils.clamp((this.tapDeviation - 20) / (24 - 20), 0, 1);
|
|
2789
|
+
return osuBase.Interpolation.lerp(adjustedTapValue, tapValue, lerp) / tapValue;
|
|
2790
|
+
}
|
|
2828
2791
|
getConvertedHitWindow() {
|
|
2829
2792
|
const hitWindow300 = new osuBase.OsuHitWindow(this.difficultyAttributes.overallDifficulty).greatWindow;
|
|
2830
2793
|
if (this.difficultyAttributes.mods.some((m) => m instanceof osuBase.ModPrecise)) {
|
|
@@ -3055,8 +3018,9 @@ class OsuSpeedEvaluator extends SpeedEvaluator {
|
|
|
3055
3018
|
* - and how easily they can be cheesed.
|
|
3056
3019
|
*
|
|
3057
3020
|
* @param current The current object.
|
|
3021
|
+
* @param mods The mods applied.
|
|
3058
3022
|
*/
|
|
3059
|
-
static evaluateDifficultyOf(current) {
|
|
3023
|
+
static evaluateDifficultyOf(current, mods) {
|
|
3060
3024
|
var _a;
|
|
3061
3025
|
if (current.object instanceof osuBase.Spinner) {
|
|
3062
3026
|
return 0;
|
|
@@ -3079,8 +3043,11 @@ class OsuSpeedEvaluator extends SpeedEvaluator {
|
|
|
3079
3043
|
// Cap distance at spacing threshold
|
|
3080
3044
|
const distance = Math.min(this.SINGLE_SPACING_THRESHOLD, travelDistance + current.minimumJumpDistance);
|
|
3081
3045
|
// Max distance bonus is 1 * `distance_multiplier` at single_spacing_threshold
|
|
3082
|
-
|
|
3046
|
+
let distanceBonus = Math.pow(distance / this.SINGLE_SPACING_THRESHOLD, 3.95) *
|
|
3083
3047
|
this.DISTANCE_MULTIPLIER;
|
|
3048
|
+
if (mods.some((m) => m instanceof osuBase.ModAutopilot)) {
|
|
3049
|
+
distanceBonus = 0;
|
|
3050
|
+
}
|
|
3084
3051
|
// Base difficulty with all bonuses
|
|
3085
3052
|
const difficulty = ((1 + speedBonus + distanceBonus) * 1000) / strainTime;
|
|
3086
3053
|
// Apply penalty if there's doubletappable doubles
|
|
@@ -3263,7 +3230,7 @@ class OsuSpeed extends OsuSkill {
|
|
|
3263
3230
|
strainValueAt(current) {
|
|
3264
3231
|
this.currentSpeedStrain *= this.strainDecay(current.strainTime);
|
|
3265
3232
|
this.currentSpeedStrain +=
|
|
3266
|
-
OsuSpeedEvaluator.evaluateDifficultyOf(current) *
|
|
3233
|
+
OsuSpeedEvaluator.evaluateDifficultyOf(current, this.mods) *
|
|
3267
3234
|
this.skillMultiplier;
|
|
3268
3235
|
this.currentRhythm = OsuRhythmEvaluator.evaluateDifficultyOf(current);
|
|
3269
3236
|
const strain = this.currentSpeedStrain * this.currentRhythm;
|
|
@@ -3420,7 +3387,7 @@ class OsuDifficultyHitObject extends DifficultyHitObject {
|
|
|
3420
3387
|
get scalingFactor() {
|
|
3421
3388
|
const radius = this.object.radius;
|
|
3422
3389
|
// We will scale distances by this factor, so we can assume a uniform CircleSize among beatmaps.
|
|
3423
|
-
let scalingFactor =
|
|
3390
|
+
let scalingFactor = DifficultyHitObject.normalizedRadius / radius;
|
|
3424
3391
|
// High circle size (small CS) bonus
|
|
3425
3392
|
if (radius < this.radiusBuffThreshold) {
|
|
3426
3393
|
scalingFactor *=
|
|
@@ -3604,6 +3571,9 @@ class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
|
3604
3571
|
if (this.mods.some((m) => m instanceof osuBase.ModRelax)) {
|
|
3605
3572
|
this.attributes.aimDifficulty *= 0.9;
|
|
3606
3573
|
}
|
|
3574
|
+
else if (this.mods.some((m) => m instanceof osuBase.ModAutopilot)) {
|
|
3575
|
+
this.attributes.aimDifficulty = 0;
|
|
3576
|
+
}
|
|
3607
3577
|
this.attributes.aimDifficultStrainCount =
|
|
3608
3578
|
aimSkill.countDifficultStrains();
|
|
3609
3579
|
}
|
|
@@ -3615,6 +3585,9 @@ class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
|
3615
3585
|
postCalculateSpeed(speedSkill) {
|
|
3616
3586
|
this.strainPeaks.speed = speedSkill.strainPeaks;
|
|
3617
3587
|
this.attributes.speedDifficulty = this.starValue(speedSkill.difficultyValue());
|
|
3588
|
+
if (this.mods.some((m) => m instanceof osuBase.ModAutopilot)) {
|
|
3589
|
+
this.attributes.speedDifficulty *= 0.5;
|
|
3590
|
+
}
|
|
3618
3591
|
this.attributes.speedDifficultStrainCount =
|
|
3619
3592
|
speedSkill.countDifficultStrains();
|
|
3620
3593
|
}
|
|
@@ -3642,6 +3615,9 @@ class OsuDifficultyCalculator extends DifficultyCalculator {
|
|
|
3642
3615
|
if (this.mods.some((m) => m instanceof osuBase.ModRelax)) {
|
|
3643
3616
|
this.attributes.flashlightDifficulty *= 0.7;
|
|
3644
3617
|
}
|
|
3618
|
+
else if (this.mods.some((m) => m instanceof osuBase.ModAutopilot)) {
|
|
3619
|
+
this.attributes.flashlightDifficulty *= 0.4;
|
|
3620
|
+
}
|
|
3645
3621
|
}
|
|
3646
3622
|
}
|
|
3647
3623
|
|
|
@@ -3695,6 +3671,9 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
3695
3671
|
* Calculates the aim performance value of the beatmap.
|
|
3696
3672
|
*/
|
|
3697
3673
|
calculateAimValue() {
|
|
3674
|
+
if (this.difficultyAttributes.mods.some((m) => m instanceof osuBase.ModAutopilot)) {
|
|
3675
|
+
return 0;
|
|
3676
|
+
}
|
|
3698
3677
|
let aimValue = this.baseValue(this.difficultyAttributes.aimDifficulty);
|
|
3699
3678
|
// Longer maps are worth more
|
|
3700
3679
|
let lengthBonus = 0.95 + 0.4 * Math.min(1, this.totalHits / 2000);
|
|
@@ -3754,7 +3733,8 @@ class OsuPerformanceCalculator extends PerformanceCalculator {
|
|
|
3754
3733
|
speedValue *= this.calculateStrainBasedMissPenalty(this.difficultyAttributes.speedDifficultStrainCount);
|
|
3755
3734
|
// AR scaling
|
|
3756
3735
|
const calculatedAR = this.difficultyAttributes.approachRate;
|
|
3757
|
-
if (calculatedAR > 10.33
|
|
3736
|
+
if (calculatedAR > 10.33 &&
|
|
3737
|
+
!this.difficultyAttributes.mods.some((m) => m instanceof osuBase.ModAutopilot)) {
|
|
3758
3738
|
// Buff for longer maps with high AR.
|
|
3759
3739
|
speedValue *= 1 + 0.3 * (calculatedAR - 10.33) * lengthBonus;
|
|
3760
3740
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rian8337/osu-rebalance-difficulty-calculator",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.45",
|
|
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.
|
|
36
|
+
"@rian8337/osu-base": "^4.0.0-beta.44"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "de7b995e670f1703fcd134209d16fbc1c6788eb9"
|
|
42
42
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ declare abstract class AimEvaluator {
|
|
|
10
10
|
protected static readonly acuteAngleMultiplier: number;
|
|
11
11
|
protected static readonly sliderMultiplier: number;
|
|
12
12
|
protected static readonly velocityChangeMultiplier: number;
|
|
13
|
+
protected static readonly wiggleMultiplier: number;
|
|
13
14
|
/**
|
|
14
15
|
* Calculates the bonus of wide angles.
|
|
15
16
|
*/
|
|
@@ -197,8 +198,15 @@ declare abstract class DifficultyHitObject {
|
|
|
197
198
|
* Other hitobjects in the beatmap, including this hitobject.
|
|
198
199
|
*/
|
|
199
200
|
protected readonly hitObjects: readonly DifficultyHitObject[];
|
|
201
|
+
/**
|
|
202
|
+
* The normalized radius of the hitobject.
|
|
203
|
+
*/
|
|
204
|
+
static readonly normalizedRadius: number;
|
|
205
|
+
/**
|
|
206
|
+
* The normalized diameter of the hitobject.
|
|
207
|
+
*/
|
|
208
|
+
static get normalizedDiameter(): number;
|
|
200
209
|
protected abstract readonly mode: Modes;
|
|
201
|
-
protected readonly normalizedRadius = 50;
|
|
202
210
|
protected readonly maximumSliderRadius: number;
|
|
203
211
|
protected readonly assumedSliderRadius: number;
|
|
204
212
|
/**
|
|
@@ -543,20 +551,6 @@ declare abstract class DroidSkill extends StrainSkill {
|
|
|
543
551
|
* The bonus multiplier that is given for a sequence of notes of equal difficulty.
|
|
544
552
|
*/
|
|
545
553
|
protected abstract readonly starsPerDouble: number;
|
|
546
|
-
/**
|
|
547
|
-
* The minimum number of strains to judge when computing for retryability.
|
|
548
|
-
*/
|
|
549
|
-
protected readonly minimumRetryabilityStrains: number;
|
|
550
|
-
/**
|
|
551
|
-
* Computes the retryability of the beatmap based on the strains of the hitobjects.
|
|
552
|
-
*
|
|
553
|
-
* Earlier difficult strains indicate higher retryability.
|
|
554
|
-
*
|
|
555
|
-
* The result is scaled by clock rate as it affects the total number of strains.
|
|
556
|
-
*
|
|
557
|
-
* @returns A number between 0 and 1. A higher value indicates higher retryability.
|
|
558
|
-
*/
|
|
559
|
-
countRetryability(): number;
|
|
560
554
|
process(current: DifficultyHitObject): void;
|
|
561
555
|
difficultyValue(): number;
|
|
562
556
|
/**
|
|
@@ -660,7 +654,12 @@ declare class DroidAim extends DroidSkill {
|
|
|
660
654
|
private readonly skillMultiplier;
|
|
661
655
|
private readonly withSliders;
|
|
662
656
|
private currentAimStrain;
|
|
657
|
+
private readonly sliderStrains;
|
|
663
658
|
constructor(mods: Mod[], withSliders: boolean);
|
|
659
|
+
/**
|
|
660
|
+
* Obtains the amount of sliders that are considered difficult in terms of relative strain.
|
|
661
|
+
*/
|
|
662
|
+
countDifficultSliders(): number;
|
|
664
663
|
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
665
664
|
protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
|
|
666
665
|
protected getObjectStrain(): number;
|
|
@@ -674,9 +673,10 @@ declare class DroidAim extends DroidSkill {
|
|
|
674
673
|
* An evaluator for calculating osu!droid Aim skill.
|
|
675
674
|
*/
|
|
676
675
|
declare abstract class DroidAimEvaluator extends AimEvaluator {
|
|
677
|
-
protected static readonly wideAngleMultiplier = 1.
|
|
678
|
-
protected static readonly
|
|
679
|
-
protected static readonly
|
|
676
|
+
protected static readonly wideAngleMultiplier = 1.5;
|
|
677
|
+
protected static readonly acuteAngleMultiplier = 2.6;
|
|
678
|
+
protected static readonly sliderMultiplier = 1.35;
|
|
679
|
+
protected static readonly velocityChangeMultiplier = 0.75;
|
|
680
680
|
private static readonly singleSpacingThreshold;
|
|
681
681
|
private static readonly minSpeedBonus;
|
|
682
682
|
/**
|
|
@@ -699,12 +699,18 @@ declare abstract class DroidAimEvaluator extends AimEvaluator {
|
|
|
699
699
|
* Calculates the flow aim strain of a hitobject.
|
|
700
700
|
*/
|
|
701
701
|
private static flowAimStrainOf;
|
|
702
|
+
protected static calculateWideAngleBonus(angle: number): number;
|
|
703
|
+
protected static calculateAcuteAngleBonus(angle: number): number;
|
|
702
704
|
}
|
|
703
705
|
|
|
704
706
|
/**
|
|
705
707
|
* Holds data that can be used to calculate osu!droid performance points.
|
|
706
708
|
*/
|
|
707
709
|
interface DroidDifficultyAttributes extends DifficultyAttributes {
|
|
710
|
+
/**
|
|
711
|
+
* The number of sliders weighted by difficulty.
|
|
712
|
+
*/
|
|
713
|
+
aimDifficultSliderCount: number;
|
|
708
714
|
/**
|
|
709
715
|
* The difficulty corresponding to the tap skill.
|
|
710
716
|
*/
|
|
@@ -729,18 +735,6 @@ interface DroidDifficultyAttributes extends DifficultyAttributes {
|
|
|
729
735
|
* The amount of strains that are considered difficult with respect to the visual skill.
|
|
730
736
|
*/
|
|
731
737
|
visualDifficultStrainCount: number;
|
|
732
|
-
/**
|
|
733
|
-
* The average delta time of speed objects.
|
|
734
|
-
*/
|
|
735
|
-
averageSpeedDeltaTime: number;
|
|
736
|
-
/**
|
|
737
|
-
* Describes how much of tap difficulty is contributed by notes that are "vibroable".
|
|
738
|
-
*
|
|
739
|
-
* A value closer to 1 indicates most of tap difficulty is contributed by notes that are not "vibroable".
|
|
740
|
-
*
|
|
741
|
-
* A value closer to 0 indicates most of tap difficulty is contributed by notes that are "vibroable".
|
|
742
|
-
*/
|
|
743
|
-
vibroFactor: number;
|
|
744
738
|
}
|
|
745
739
|
|
|
746
740
|
/**
|
|
@@ -888,7 +882,6 @@ declare class DroidDifficultyCalculator extends DifficultyCalculator<DroidDiffic
|
|
|
888
882
|
* Called after tap skill calculation.
|
|
889
883
|
*
|
|
890
884
|
* @param tapSkillCheese The tap skill that considers cheesing.
|
|
891
|
-
* @param tapSkillVibro The tap skill that considers vibro.
|
|
892
885
|
*/
|
|
893
886
|
private postCalculateTap;
|
|
894
887
|
/**
|
|
@@ -1071,6 +1064,10 @@ declare abstract class PerformanceCalculator<T extends DifficultyAttributes> {
|
|
|
1071
1064
|
* The total hits that were successfully done.
|
|
1072
1065
|
*/
|
|
1073
1066
|
protected get totalSuccessfulHits(): number;
|
|
1067
|
+
/**
|
|
1068
|
+
* The total of imperfect hits (100s, 50s, misses).
|
|
1069
|
+
*/
|
|
1070
|
+
protected get totalImperfectHits(): number;
|
|
1074
1071
|
/**
|
|
1075
1072
|
* Calculates the base performance value of a star rating.
|
|
1076
1073
|
*/
|
|
@@ -1256,6 +1253,12 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator<DroidDiff
|
|
|
1256
1253
|
* This is fine though, since this method is only used to scale tap pp.
|
|
1257
1254
|
*/
|
|
1258
1255
|
private calculateTapDeviation;
|
|
1256
|
+
/**
|
|
1257
|
+
* Calculates multiplier for tap to account for improper tapping based on the deviation and tap difficulty.
|
|
1258
|
+
*
|
|
1259
|
+
* https://www.desmos.com/calculator/dmogdhzofn
|
|
1260
|
+
*/
|
|
1261
|
+
private calculateTapHighDeviationNerf;
|
|
1259
1262
|
private getConvertedHitWindow;
|
|
1260
1263
|
toString(): string;
|
|
1261
1264
|
}
|
|
@@ -1301,26 +1304,15 @@ declare class DroidTap extends DroidSkill {
|
|
|
1301
1304
|
protected readonly reducedSectionBaseline = 0.75;
|
|
1302
1305
|
protected readonly strainDecayBase = 0.3;
|
|
1303
1306
|
protected readonly starsPerDouble = 1.1;
|
|
1304
|
-
protected readonly minimumRetryabilityStrains = 750;
|
|
1305
1307
|
private currentTapStrain;
|
|
1306
1308
|
private currentRhythmMultiplier;
|
|
1307
1309
|
private readonly skillMultiplier;
|
|
1308
1310
|
private readonly considerCheesability;
|
|
1309
|
-
|
|
1310
|
-
private readonly _objectDeltaTimes;
|
|
1311
|
-
/**
|
|
1312
|
-
* The delta time of hitobjects.
|
|
1313
|
-
*/
|
|
1314
|
-
get objectDeltaTimes(): readonly number[];
|
|
1315
|
-
constructor(mods: Mod[], considerCheesability: boolean, strainTimeCap?: number);
|
|
1311
|
+
constructor(mods: Mod[], considerCheesability: boolean);
|
|
1316
1312
|
/**
|
|
1317
1313
|
* The amount of notes that are relevant to the difficulty.
|
|
1318
1314
|
*/
|
|
1319
1315
|
relevantNoteCount(): number;
|
|
1320
|
-
/**
|
|
1321
|
-
* The delta time relevant to the difficulty.
|
|
1322
|
-
*/
|
|
1323
|
-
relevantDeltaTime(): number;
|
|
1324
1316
|
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
1325
1317
|
protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
|
|
1326
1318
|
protected getObjectStrain(): number;
|
|
@@ -1347,15 +1339,13 @@ declare abstract class DroidTapEvaluator extends SpeedEvaluator {
|
|
|
1347
1339
|
* Evaluates the difficulty of tapping the current object, based on:
|
|
1348
1340
|
*
|
|
1349
1341
|
* - time between pressing the previous and current object,
|
|
1350
|
-
* - distance between those objects,
|
|
1351
1342
|
* - how easily they can be cheesed,
|
|
1352
1343
|
* - and the strain time cap.
|
|
1353
1344
|
*
|
|
1354
1345
|
* @param current The current object.
|
|
1355
1346
|
* @param considerCheesability Whether to consider cheesability.
|
|
1356
|
-
* @param strainTimeCap The strain time to cap the object's strain time to.
|
|
1357
1347
|
*/
|
|
1358
|
-
static evaluateDifficultyOf(current: DroidDifficultyHitObject, considerCheesability: boolean
|
|
1348
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject, considerCheesability: boolean): number;
|
|
1359
1349
|
}
|
|
1360
1350
|
|
|
1361
1351
|
/**
|
|
@@ -1690,8 +1680,9 @@ declare abstract class OsuSpeedEvaluator extends SpeedEvaluator {
|
|
|
1690
1680
|
* - and how easily they can be cheesed.
|
|
1691
1681
|
*
|
|
1692
1682
|
* @param current The current object.
|
|
1683
|
+
* @param mods The mods applied.
|
|
1693
1684
|
*/
|
|
1694
|
-
static evaluateDifficultyOf(current: OsuDifficultyHitObject): number;
|
|
1685
|
+
static evaluateDifficultyOf(current: OsuDifficultyHitObject, mods: Mod[]): number;
|
|
1695
1686
|
}
|
|
1696
1687
|
|
|
1697
1688
|
export { AimEvaluator, type CacheableDifficultyAttributes, type DifficultSlider, type DifficultyAttributes, type DifficultyCalculationOptions, DifficultyCalculator, DifficultyHitObject, DroidAim, DroidAimEvaluator, type DroidDifficultyAttributes, type DroidDifficultyCalculationOptions, DroidDifficultyCalculator, DroidDifficultyHitObject, DroidFlashlight, DroidFlashlightEvaluator, DroidPerformanceCalculator, DroidRhythm, DroidRhythmEvaluator, DroidTap, DroidTapEvaluator, DroidVisual, DroidVisualEvaluator, type ExtendedDroidDifficultyAttributes, FlashlightEvaluator, type HighStrainSection, OsuAim, OsuAimEvaluator, type OsuDifficultyAttributes, OsuDifficultyCalculator, OsuDifficultyHitObject, OsuFlashlight, OsuFlashlightEvaluator, OsuPerformanceCalculator, OsuRhythmEvaluator, OsuSpeed, OsuSpeedEvaluator, type PerformanceCalculationOptions, PerformanceCalculator, SpeedEvaluator, type StrainPeaks };
|