@rian8337/osu-difficulty-calculator 4.0.0-beta.77 → 4.0.0-beta.79

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-difficulty-calculator",
3
- "version": "4.0.0-beta.77",
3
+ "version": "4.0.0-beta.79",
4
4
  "description": "A module for calculating osu!standard beatmap difficulty and performance value with respect to the current 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.77"
36
+ "@rian8337/osu-base": "^4.0.0-beta.78"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "13ad454ea657dbd5821d0857c4da6dc7ab0fe965"
41
+ "gitHead": "f74fd671070428e18592487c6a70a8844c72d0d8"
42
42
  }
@@ -209,6 +209,10 @@ declare abstract class DifficultyHitObject {
209
209
  * The full great window of the hitobject.
210
210
  */
211
211
  readonly fullGreatWindow: number;
212
+ /**
213
+ * Selective bonus for beatmaps with higher circle size.
214
+ */
215
+ abstract get smallCircleBonus(): number;
212
216
  /**
213
217
  * Other hitobjects in the beatmap, including this hitobject.
214
218
  */
@@ -246,9 +250,8 @@ declare abstract class DifficultyHitObject {
246
250
  * Computes the properties of this hitobject.
247
251
  *
248
252
  * @param clockRate The clock rate of the beatmap.
249
- * @param hitObjects The hitobjects in the beatmap.
250
253
  */
251
- computeProperties(clockRate: number, hitObjects: readonly PlaceableHitObject[]): void;
254
+ computeProperties(clockRate: number): void;
252
255
  /**
253
256
  * Gets the difficulty hitobject at a specific index with respect to the current
254
257
  * difficulty hitobject's index.
@@ -286,7 +289,6 @@ declare abstract class DifficultyHitObject {
286
289
  * A value closer to 1 indicates a higher possibility.
287
290
  */
288
291
  get doubletapness(): number;
289
- protected abstract get scalingFactor(): number;
290
292
  protected setDistances(clockRate: number): void;
291
293
  private calculateSliderCursorPosition;
292
294
  private getEndCursorPosition;
@@ -381,7 +383,7 @@ declare abstract class StrainSkill extends Skill {
381
383
  *
382
384
  * The result is scaled by clock rate as it affects the total number of strains.
383
385
  */
384
- countDifficultStrains(): number;
386
+ countTopWeightedStrains(): number;
385
387
  /**
386
388
  * Calculates strain decay for a specified time frame.
387
389
  *
@@ -567,13 +569,9 @@ declare class DroidDifficultyHitObject extends DifficultyHitObject {
567
569
  */
568
570
  flashlightStrainWithoutSliders: number;
569
571
  /**
570
- * The visual strain generated by the hitobject if sliders are considered.
571
- */
572
- visualStrainWithSliders: number;
573
- /**
574
- * The visual strain generated by the hitobject if sliders are not considered.
572
+ * The reading difficulty generated by the hitobject.
575
573
  */
576
- visualStrainWithoutSliders: number;
574
+ readingDifficulty: number;
577
575
  /**
578
576
  * The note density of the hitobject.
579
577
  */
@@ -591,7 +589,7 @@ declare class DroidDifficultyHitObject extends DifficultyHitObject {
591
589
  private readonly radiusBuffThreshold;
592
590
  protected readonly mode = Modes.droid;
593
591
  protected readonly maximumSliderRadius: number;
594
- protected get scalingFactor(): number;
592
+ get smallCircleBonus(): number;
595
593
  /**
596
594
  * Note: You **must** call `computeProperties` at some point due to how TypeScript handles
597
595
  * overridden properties (see [this](https://github.com/microsoft/TypeScript/issues/1617) GitHub issue).
@@ -602,7 +600,6 @@ declare class DroidDifficultyHitObject extends DifficultyHitObject {
602
600
  * @param clockRate The clock rate of the beatmap.
603
601
  */
604
602
  constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number, index: number);
605
- computeProperties(clockRate: number, hitObjects: readonly PlaceableHitObject[]): void;
606
603
  opacityAt(time: number, mods: ModMap): number;
607
604
  previous(backwardsIndex: number): this | null;
608
605
  next(forwardsIndex: number): this | null;
@@ -619,8 +616,6 @@ declare class DroidDifficultyHitObject extends DifficultyHitObject {
619
616
  * @returns Whether the hitobject is considered overlapping.
620
617
  */
621
618
  isOverlapping(considerDistance: boolean): boolean;
622
- private setVisuals;
623
- private applyToOverlappingFactor;
624
619
  }
625
620
 
626
621
  /**
@@ -655,6 +650,7 @@ declare class DroidAim extends DroidSkill {
655
650
  private readonly skillMultiplier;
656
651
  private currentAimStrain;
657
652
  private readonly sliderStrains;
653
+ private maxSliderStrain;
658
654
  readonly withSliders: boolean;
659
655
  constructor(mods: ModMap, withSliders: boolean);
660
656
  /**
@@ -718,9 +714,9 @@ interface IDroidDifficultyAttributes extends IDifficultyAttributes {
718
714
  */
719
715
  rhythmDifficulty: number;
720
716
  /**
721
- * The difficulty corresponding to the visual skill.
717
+ * The difficulty corresponding to the reading skill.
722
718
  */
723
- visualDifficulty: number;
719
+ readingDifficulty: number;
724
720
  /**
725
721
  * The amount of strains that are considered difficult with respect to the tap skill.
726
722
  */
@@ -730,9 +726,9 @@ interface IDroidDifficultyAttributes extends IDifficultyAttributes {
730
726
  */
731
727
  flashlightDifficultStrainCount: number;
732
728
  /**
733
- * The amount of strains that are considered difficult with respect to the visual skill.
729
+ * The amount of notes that are considered difficult with respect to the reading skill.
734
730
  */
735
- visualDifficultStrainCount: number;
731
+ readingDifficultNoteCount: number;
736
732
  /**
737
733
  * The average delta time of speed objects.
738
734
  */
@@ -753,10 +749,10 @@ interface IDroidDifficultyAttributes extends IDifficultyAttributes {
753
749
  declare class DroidDifficultyAttributes extends DifficultyAttributes implements IDroidDifficultyAttributes {
754
750
  tapDifficulty: number;
755
751
  rhythmDifficulty: number;
756
- visualDifficulty: number;
752
+ readingDifficulty: number;
757
753
  tapDifficultStrainCount: number;
758
754
  flashlightDifficultStrainCount: number;
759
- visualDifficultStrainCount: number;
755
+ readingDifficultNoteCount: number;
760
756
  averageSpeedDeltaTime: number;
761
757
  vibroFactor: number;
762
758
  constructor(cacheableAttributes?: CacheableDifficultyAttributes<IDroidDifficultyAttributes>);
@@ -798,12 +794,6 @@ interface IExtendedDroidDifficultyAttributes extends IDroidDifficultyAttributes
798
794
  * Sliders that are considered difficult.
799
795
  */
800
796
  difficultSliders: DifficultSlider[];
801
- /**
802
- * The number of clickable objects weighted by difficulty.
803
- *
804
- * Related to aim difficulty.
805
- */
806
- aimNoteCount: number;
807
797
  /**
808
798
  * Describes how much of flashlight difficulty is contributed to by hitcircles or sliders.
809
799
  *
@@ -812,14 +802,6 @@ interface IExtendedDroidDifficultyAttributes extends IDroidDifficultyAttributes
812
802
  * A value closer to 0 indicates most of flashlight difficulty is contributed by sliders.
813
803
  */
814
804
  flashlightSliderFactor: number;
815
- /**
816
- * Describes how much of visual difficulty is contributed to by hitcircles or sliders.
817
- *
818
- * A value closer to 1 indicates most of visual difficulty is contributed by hitcircles.
819
- *
820
- * A value closer to 0 indicates most of visual difficulty is contributed by sliders.
821
- */
822
- visualSliderFactor: number;
823
805
  }
824
806
 
825
807
  /**
@@ -830,9 +812,7 @@ declare class ExtendedDroidDifficultyAttributes extends DroidDifficultyAttribute
830
812
  mode: "live";
831
813
  possibleThreeFingeredSections: HighStrainSection[];
832
814
  difficultSliders: DifficultSlider[];
833
- aimNoteCount: number;
834
815
  flashlightSliderFactor: number;
835
- visualSliderFactor: number;
836
816
  constructor(cacheableAttributes?: CacheableDifficultyAttributes<IExtendedDroidDifficultyAttributes>);
837
817
  }
838
818
 
@@ -852,13 +832,13 @@ declare class DroidDifficultyCalculator extends DifficultyCalculator<DroidPlayab
852
832
  protected createDifficultyAttributes(beatmap: DroidPlayableBeatmap, skills: Skill[], objects: DroidDifficultyHitObject[]): ExtendedDroidDifficultyAttributes;
853
833
  protected createPlayableBeatmap(beatmap: Beatmap, mods?: ModMap): DroidPlayableBeatmap;
854
834
  protected createDifficultyHitObjects(beatmap: DroidPlayableBeatmap): DroidDifficultyHitObject[];
855
- protected createSkills(beatmap: DroidPlayableBeatmap): DroidSkill[];
835
+ protected createSkills(beatmap: DroidPlayableBeatmap): Skill[];
856
836
  protected createStrainPeakSkills(beatmap: DroidPlayableBeatmap): StrainSkill[];
857
837
  private populateAimAttributes;
858
838
  private populateTapAttributes;
859
839
  private populateRhythmAttributes;
860
840
  private populateFlashlightAttributes;
861
- private populateVisualAttributes;
841
+ private populateReadingAttributes;
862
842
  }
863
843
 
864
844
  /**
@@ -1090,9 +1070,9 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator<IDroidDif
1090
1070
  */
1091
1071
  flashlight: number;
1092
1072
  /**
1093
- * The visual performance value.
1073
+ * The reading performance value.
1094
1074
  */
1095
- visual: number;
1075
+ reading: number;
1096
1076
  /**
1097
1077
  * The penalty used to penalize the tap performance value.
1098
1078
  *
@@ -1119,17 +1099,10 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator<IDroidDif
1119
1099
  * Can be properly obtained by analyzing the replay associated with the score.
1120
1100
  */
1121
1101
  get flashlightSliderCheesePenalty(): number;
1122
- /**
1123
- * The penalty used to penalize the visual performance value.
1124
- *
1125
- * Can be properly obtained by analyzing the replay associated with the score.
1126
- */
1127
- get visualSliderCheesePenalty(): number;
1128
1102
  protected finalMultiplier: number;
1129
1103
  protected readonly mode = Modes.droid;
1130
1104
  private _aimSliderCheesePenalty;
1131
1105
  private _flashlightSliderCheesePenalty;
1132
- private _visualSliderCheesePenalty;
1133
1106
  private _tapPenalty;
1134
1107
  private _deviation;
1135
1108
  private _tapDeviation;
@@ -1157,14 +1130,6 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator<IDroidDif
1157
1130
  * @param value The slider cheese penalty value. Must be between 0 and 1.
1158
1131
  */
1159
1132
  applyFlashlightSliderCheesePenalty(value: number): void;
1160
- /**
1161
- * Applies a visual slider cheese penalty value to this calculator.
1162
- *
1163
- * The visual and total performance value will be recalculated afterwards.
1164
- *
1165
- * @param value The slider cheese penalty value. Must be between 0 and 1.
1166
- */
1167
- applyVisualSliderCheesePenalty(value: number): void;
1168
1133
  protected calculateValues(): void;
1169
1134
  protected calculateTotalValue(): number;
1170
1135
  protected handleOptions(options?: PerformanceCalculationOptions): void;
@@ -1185,9 +1150,9 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator<IDroidDif
1185
1150
  */
1186
1151
  private calculateFlashlightValue;
1187
1152
  /**
1188
- * Calculates the visual performance value of the beatmap.
1153
+ * Calculates the reading performance value of the beatmap.
1189
1154
  */
1190
- private calculateVisualValue;
1155
+ private calculateReadingValue;
1191
1156
  /**
1192
1157
  * The object-based proportional miss penalty.
1193
1158
  */
@@ -1202,7 +1167,7 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator<IDroidDif
1202
1167
  */
1203
1168
  private calculateDeviationBasedLengthScaling;
1204
1169
  /**
1205
- * Estimates the player's tap deviation based on the OD, number of circles and sliders,
1170
+ * Estimates the player's deviation based on the OD, number of circles and sliders,
1206
1171
  * and number of 300s, 100s, 50s, and misses, assuming the player's mean hit error is 0.
1207
1172
  *
1208
1173
  * The estimation is consistent in that two SS scores on the same map
@@ -1223,10 +1188,80 @@ declare class DroidPerformanceCalculator extends PerformanceCalculator<IDroidDif
1223
1188
  * This is fine though, since this method is only used to scale tap pp.
1224
1189
  */
1225
1190
  private calculateTapDeviation;
1191
+ /**
1192
+ * Calculates a multiplier for tap to account for improper tapping based on the deviation and tap difficulty.
1193
+ *
1194
+ * [Graph](https://www.desmos.com/calculator/z5l9ebrwpi)
1195
+ */
1196
+ private calculateTapHighDeviationNerf;
1226
1197
  private getConvertedHitWindow;
1227
1198
  toString(): string;
1228
1199
  }
1229
1200
 
1201
+ /**
1202
+ * Represents the skill required to read every object in the map.
1203
+ */
1204
+ declare class DroidReading extends Skill {
1205
+ private readonly clockRate;
1206
+ private readonly hitObjects;
1207
+ private readonly noteDifficulties;
1208
+ private readonly strainDecayBase;
1209
+ private readonly skillMultiplier;
1210
+ private currentNoteDifficulty;
1211
+ private difficulty;
1212
+ private noteWeightSum;
1213
+ constructor(mods: ModMap, clockRate: number, hitObjects: readonly PlaceableHitObject[]);
1214
+ process(current: DroidDifficultyHitObject): void;
1215
+ difficultyValue(): number;
1216
+ /**
1217
+ * Returns the number of relevant objects weighted against the top note.
1218
+ */
1219
+ countTopWeightedNotes(): number;
1220
+ private strainDecay;
1221
+ }
1222
+
1223
+ /**
1224
+ * An evaluator for calculating osu!droid reading skill.
1225
+ */
1226
+ declare abstract class DroidReadingEvaluator {
1227
+ private static readonly emptyModMap;
1228
+ private static readonly readingWindowSize;
1229
+ private static readonly distanceInfluenceThreshold;
1230
+ private static readonly hiddenMultiplier;
1231
+ private static readonly densityMultiplier;
1232
+ private static readonly densityDifficultyBase;
1233
+ private static readonly preemptBalancingFactor;
1234
+ private static readonly preemptStartingPoint;
1235
+ static evaluateDifficultyOf(current: DroidDifficultyHitObject, clockRate: number, mods: ModMap): number;
1236
+ /**
1237
+ * Retrieves a list of objects that are visible at the point in time the current object needs to be hit.
1238
+ *
1239
+ * @param current The current object.
1240
+ */
1241
+ private static retrievePastVisibleObjects;
1242
+ /**
1243
+ * Calculates the density of objects visible at the point in time the current object needs to be hit.
1244
+ *
1245
+ * @param current The current object.
1246
+ */
1247
+ private static calculateCurrentVisibleObjectsDensity;
1248
+ /**
1249
+ * Returns the time an object spends invisible with the Hidden mod at the current approach rate.
1250
+ *
1251
+ * @param current The current object.
1252
+ */
1253
+ private static getDurationSpentInvisible;
1254
+ /**
1255
+ * Calculates a factor of how often the current object's angle has been repeated in a certain time frame.
1256
+ * It does this by checking the difference in angle between current and past objects and sums them up
1257
+ * based on a range of similarity.
1258
+ *
1259
+ * @param current The current object.
1260
+ */
1261
+ private static getConstantAngleNerfFactor;
1262
+ private static getTimeNerfFactor;
1263
+ }
1264
+
1230
1265
  /**
1231
1266
  * Represents the skill required to properly follow a beatmap's rhythm.
1232
1267
  */
@@ -1275,12 +1310,13 @@ declare class DroidTap extends DroidSkill {
1275
1310
  private currentRhythmMultiplier;
1276
1311
  private readonly skillMultiplier;
1277
1312
  private readonly _objectDeltaTimes;
1313
+ private maxStrain;
1278
1314
  /**
1279
1315
  * The delta time of hitobjects.
1280
1316
  */
1281
1317
  get objectDeltaTimes(): readonly number[];
1282
1318
  readonly considerCheesability: boolean;
1283
- private readonly strainTimeCap?;
1319
+ readonly strainTimeCap?: number;
1284
1320
  constructor(mods: ModMap, considerCheesability: boolean, strainTimeCap?: number);
1285
1321
  /**
1286
1322
  * The amount of notes that are relevant to the difficulty.
@@ -1319,47 +1355,6 @@ declare abstract class DroidTapEvaluator {
1319
1355
  static evaluateDifficultyOf(current: DroidDifficultyHitObject, considerCheesability: boolean, strainTimeCap?: number): number;
1320
1356
  }
1321
1357
 
1322
- /**
1323
- * Represents the skill required to read every object in the map.
1324
- */
1325
- declare class DroidVisual extends DroidSkill {
1326
- protected readonly starsPerDouble = 1.025;
1327
- protected readonly reducedSectionCount = 10;
1328
- protected readonly reducedSectionBaseline = 0.75;
1329
- protected readonly strainDecayBase = 0.1;
1330
- private currentVisualStrain;
1331
- private currentRhythmMultiplier;
1332
- private readonly skillMultiplier;
1333
- readonly withSliders: boolean;
1334
- constructor(mods: ModMap, withSliders: boolean);
1335
- protected strainValueAt(current: DroidDifficultyHitObject): number;
1336
- protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
1337
- protected getObjectStrain(): number;
1338
- protected saveToHitObject(current: DroidDifficultyHitObject): void;
1339
- }
1340
-
1341
- /**
1342
- * An evaluator for calculating osu!droid visual skill.
1343
- */
1344
- declare abstract class DroidVisualEvaluator {
1345
- /**
1346
- * Evaluates the difficulty of reading the current object, based on:
1347
- *
1348
- * - note density of the current object,
1349
- * - overlapping factor of the current object,
1350
- * - the preempt time of the current object,
1351
- * - the visual opacity of the current object,
1352
- * - the velocity of the current object if it's a slider,
1353
- * - past objects' velocity if they are sliders,
1354
- * - and whether the Hidden mod is enabled.
1355
- *
1356
- * @param current The current object.
1357
- * @param mods The mods used.
1358
- * @param withSliders Whether to take slider difficulty into account.
1359
- */
1360
- static evaluateDifficultyOf(current: DroidDifficultyHitObject, mods: ModMap, withSliders: boolean): number;
1361
- }
1362
-
1363
1358
  /**
1364
1359
  * Holds data that can be used to calculate osu!standard performance points.
1365
1360
  */
@@ -1392,9 +1387,8 @@ declare class OsuDifficultyHitObject extends DifficultyHitObject {
1392
1387
  * The flashlight strain generated by this hitobject.
1393
1388
  */
1394
1389
  flashlightStrain: number;
1395
- private readonly radiusBuffThreshold;
1390
+ get smallCircleBonus(): number;
1396
1391
  protected readonly mode = Modes.osu;
1397
- protected get scalingFactor(): number;
1398
1392
  }
1399
1393
 
1400
1394
  /**
@@ -1623,6 +1617,7 @@ declare class OsuSpeed extends OsuSkill {
1623
1617
  private currentSpeedStrain;
1624
1618
  private currentRhythm;
1625
1619
  private readonly skillMultiplier;
1620
+ private maxStrain;
1626
1621
  /**
1627
1622
  * The amount of notes that are relevant to the difficulty.
1628
1623
  */
@@ -1663,4 +1658,4 @@ declare abstract class OsuSpeedEvaluator {
1663
1658
  static evaluateDifficultyOf(current: OsuDifficultyHitObject, mods: ModMap): number;
1664
1659
  }
1665
1660
 
1666
- export { type CacheableDifficultyAttributes, type DifficultSlider, DifficultyAttributes, DifficultyCalculator, DifficultyHitObject, DroidAim, DroidAimEvaluator, DroidDifficultyAttributes, DroidDifficultyCalculator, DroidDifficultyHitObject, DroidFlashlight, DroidFlashlightEvaluator, DroidPerformanceCalculator, DroidRhythm, DroidRhythmEvaluator, DroidTap, DroidTapEvaluator, DroidVisual, DroidVisualEvaluator, ExtendedDroidDifficultyAttributes, type HighStrainSection, type IDifficultyAttributes, type IDroidDifficultyAttributes, type IExtendedDroidDifficultyAttributes, type IOsuDifficultyAttributes, OsuAim, OsuAimEvaluator, OsuDifficultyAttributes, OsuDifficultyCalculator, OsuDifficultyHitObject, OsuFlashlight, OsuFlashlightEvaluator, OsuPerformanceCalculator, OsuRhythmEvaluator, OsuSpeed, OsuSpeedEvaluator, type PerformanceCalculationOptions, PerformanceCalculator, type StrainPeaks };
1661
+ export { type CacheableDifficultyAttributes, type DifficultSlider, DifficultyAttributes, DifficultyCalculator, DifficultyHitObject, DroidAim, DroidAimEvaluator, DroidDifficultyAttributes, DroidDifficultyCalculator, DroidDifficultyHitObject, DroidFlashlight, DroidFlashlightEvaluator, DroidPerformanceCalculator, DroidReading, DroidReadingEvaluator, DroidRhythm, DroidRhythmEvaluator, DroidTap, DroidTapEvaluator, ExtendedDroidDifficultyAttributes, type HighStrainSection, type IDifficultyAttributes, type IDroidDifficultyAttributes, type IExtendedDroidDifficultyAttributes, type IOsuDifficultyAttributes, OsuAim, OsuAimEvaluator, OsuDifficultyAttributes, OsuDifficultyCalculator, OsuDifficultyHitObject, OsuFlashlight, OsuFlashlightEvaluator, OsuPerformanceCalculator, OsuRhythmEvaluator, OsuSpeed, OsuSpeedEvaluator, type PerformanceCalculationOptions, PerformanceCalculator, type StrainPeaks };