@rian8337/osu-difficulty-calculator 4.0.0-beta.102 → 4.0.0-beta.104
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/README.md +10 -10
- package/dist/index.cjs +3945 -0
- package/dist/index.d.cts +2038 -0
- package/dist/index.d.mts +2038 -0
- package/dist/index.mjs +3909 -0
- package/package.json +28 -12
- package/dist/index.js +0 -5727
- package/typings/index.d.ts +0 -2098
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,2038 @@
|
|
|
1
|
+
import { Accuracy, Beatmap, DroidPlayableBeatmap, HitResult, HitWindow, Mod, ModMap, Modes, OsuPlayableBeatmap, PlaceableHitObject, PlayableBeatmap, SerializedMod, Vector2 } from "@rian8337/osu-base";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a hit object with difficulty calculation values.
|
|
4
|
+
*/
|
|
5
|
+
export declare abstract class DifficultyHitObject {
|
|
6
|
+
/**
|
|
7
|
+
* The underlying hitobject.
|
|
8
|
+
*/
|
|
9
|
+
readonly object: PlaceableHitObject;
|
|
10
|
+
/**
|
|
11
|
+
* The index of this hitobject in the list of all hitobjects.
|
|
12
|
+
*
|
|
13
|
+
* This is one less than the actual index of the hitobject in the beatmap.
|
|
14
|
+
*/
|
|
15
|
+
readonly index: number;
|
|
16
|
+
/**
|
|
17
|
+
* The aim strain generated by the hitobject if sliders are considered.
|
|
18
|
+
*/
|
|
19
|
+
aimStrainWithSliders: number;
|
|
20
|
+
/**
|
|
21
|
+
* The aim strain generated by the hitobject if sliders are not considered.
|
|
22
|
+
*/
|
|
23
|
+
aimStrainWithoutSliders: number;
|
|
24
|
+
/**
|
|
25
|
+
* The flashlight strain generated by the hitobject.
|
|
26
|
+
*/
|
|
27
|
+
flashlightStrain: number;
|
|
28
|
+
/**
|
|
29
|
+
* The reading difficulty generated by the hitobject.
|
|
30
|
+
*/
|
|
31
|
+
readingDifficulty: number;
|
|
32
|
+
/**
|
|
33
|
+
* The rhythm multiplier generated by the hitobject. This is used to alter tap strain.
|
|
34
|
+
*/
|
|
35
|
+
rhythmMultiplier: number;
|
|
36
|
+
/**
|
|
37
|
+
* The normalized distance from the start position of the previous hitobject to the start position of this hitobject.
|
|
38
|
+
*/
|
|
39
|
+
jumpDistance: number;
|
|
40
|
+
/**
|
|
41
|
+
* The normalized distance from the "lazy" end position of the previous hitobject to the start position of this hitobject.
|
|
42
|
+
*
|
|
43
|
+
* The "lazy" end position is the position at which the cursor ends up if the previous hitobject is followed with as minimal movement as possible (i.e. on the edge of slider follow circles).
|
|
44
|
+
*/
|
|
45
|
+
lazyJumpDistance: number;
|
|
46
|
+
/**
|
|
47
|
+
* The normalized shortest distance to consider for a jump between the previous hitobject and this hitobject.
|
|
48
|
+
*
|
|
49
|
+
* This is bounded from above by `lazyJumpDistance`, and is smaller than the former if a more natural path is able to be taken through the previous hitobject.
|
|
50
|
+
*
|
|
51
|
+
* Suppose a linear slider - circle pattern. Following the slider lazily (see: `lazyJumpDistance`) will result in underestimating the true end position of the slider as being closer towards the start position.
|
|
52
|
+
* As a result, `lazyJumpDistance` overestimates the jump distance because the player is able to take a more natural path by following through the slider to its end,
|
|
53
|
+
* such that the jump is felt as only starting from the slider's true end position.
|
|
54
|
+
*
|
|
55
|
+
* Now consider a slider - circle pattern where the circle is stacked along the path inside the slider.
|
|
56
|
+
* In this case, the lazy end position correctly estimates the true end position of the slider and provides the more natural movement path.
|
|
57
|
+
*/
|
|
58
|
+
minimumJumpDistance: number;
|
|
59
|
+
/**
|
|
60
|
+
* The time taken to travel through `minimumJumpDistance`, with a minimum value of 25ms.
|
|
61
|
+
*/
|
|
62
|
+
minimumJumpTime: number;
|
|
63
|
+
/**
|
|
64
|
+
* The normalized distance between the start and end position of this hitobject.
|
|
65
|
+
*/
|
|
66
|
+
travelDistance: number;
|
|
67
|
+
/**
|
|
68
|
+
* The time taken to travel through `travelDistance`, with a minimum value of 25ms for sliders.
|
|
69
|
+
*/
|
|
70
|
+
travelTime: number;
|
|
71
|
+
/**
|
|
72
|
+
* The position of the cursor at the point of completion of this hitobject if it was hit
|
|
73
|
+
* with as few movements as possible.
|
|
74
|
+
*/
|
|
75
|
+
lazyEndPosition?: Vector2;
|
|
76
|
+
/**
|
|
77
|
+
* The distance travelled by the cursor upon completion of this hitobject if it was hit
|
|
78
|
+
* with as few movements as possible.
|
|
79
|
+
*/
|
|
80
|
+
lazyTravelDistance: number;
|
|
81
|
+
/**
|
|
82
|
+
* The time taken by the cursor upon completion of this hitobject if it was hit with
|
|
83
|
+
* as few movements as possible.
|
|
84
|
+
*/
|
|
85
|
+
lazyTravelTime: number;
|
|
86
|
+
/**
|
|
87
|
+
* Angle the player has to take to hit this hitobject.
|
|
88
|
+
*
|
|
89
|
+
* Calculated as the angle between the circles (current-2, current-1, current).
|
|
90
|
+
*/
|
|
91
|
+
angleSigned: number | null;
|
|
92
|
+
/**
|
|
93
|
+
* Unsigned angle the player has to take to hit this hitobject.
|
|
94
|
+
*
|
|
95
|
+
* Calculated as the angle between the circles (current-2, current-1, current).
|
|
96
|
+
*/
|
|
97
|
+
get angle(): number | null;
|
|
98
|
+
/**
|
|
99
|
+
* Angle of the vector created between current and current-1 normalized to consider
|
|
100
|
+
* symmetrical vectors in any axis to be the same angle.
|
|
101
|
+
*/
|
|
102
|
+
normalizedVectorAngle: number | null;
|
|
103
|
+
/**
|
|
104
|
+
* The amount of milliseconds elapsed between this hitobject and the last hitobject.
|
|
105
|
+
*/
|
|
106
|
+
readonly deltaTime: number;
|
|
107
|
+
/**
|
|
108
|
+
* The amount of milliseconds elapsed since the start time of the previous hitobject, with a minimum of 25ms.
|
|
109
|
+
*/
|
|
110
|
+
readonly strainTime: number;
|
|
111
|
+
/**
|
|
112
|
+
* The amount of milliseconds elapsed between the last {@link DifficultyHitObject}'s {@link endTime} and
|
|
113
|
+
* this {@link DifficultyHitObject}'s {@link startTime} capped to a minimum of {@link minDeltaTime}ms.
|
|
114
|
+
*/
|
|
115
|
+
readonly lastObjectEndDeltaTime: number;
|
|
116
|
+
/**
|
|
117
|
+
* Adjusted start time of the hitobject, taking speed multiplier into account.
|
|
118
|
+
*/
|
|
119
|
+
readonly startTime: number;
|
|
120
|
+
/**
|
|
121
|
+
* Adjusted end time of the hitobject, taking speed multiplier into account.
|
|
122
|
+
*/
|
|
123
|
+
readonly endTime: number;
|
|
124
|
+
/**
|
|
125
|
+
* Adjusted preempt time of the hitobject, taking speed multiplier into account.
|
|
126
|
+
*/
|
|
127
|
+
readonly timePreempt: number;
|
|
128
|
+
/**
|
|
129
|
+
* The beatmap clock rate.
|
|
130
|
+
*/
|
|
131
|
+
readonly clockRate: number;
|
|
132
|
+
/**
|
|
133
|
+
* Selective bonus for beatmaps with higher circle size.
|
|
134
|
+
*/
|
|
135
|
+
abstract get smallCircleBonus(): number;
|
|
136
|
+
/**
|
|
137
|
+
* This {@link DifficultyHitObject}'s immediate overall difficulty value calculated from the raw hitwindow.
|
|
138
|
+
*/
|
|
139
|
+
get overallDifficulty(): number;
|
|
140
|
+
/**
|
|
141
|
+
* Other hitobjects in the beatmap, including this hitobject.
|
|
142
|
+
*/
|
|
143
|
+
protected readonly hitObjects: readonly DifficultyHitObject[];
|
|
144
|
+
/**
|
|
145
|
+
* The normalized radius of the hitobject.
|
|
146
|
+
*/
|
|
147
|
+
abstract readonly normalizedRadius: number;
|
|
148
|
+
/**
|
|
149
|
+
* The normalized diameter of the hitobject.
|
|
150
|
+
*/
|
|
151
|
+
get normalizedDiameter(): number;
|
|
152
|
+
protected abstract readonly mode: Modes;
|
|
153
|
+
protected get maximumSliderRadius(): number;
|
|
154
|
+
protected get assumedSliderRadius(): number;
|
|
155
|
+
/**
|
|
156
|
+
* The lowest possible delta time value.
|
|
157
|
+
*/
|
|
158
|
+
static readonly minDeltaTime = 25;
|
|
159
|
+
private readonly lastObject;
|
|
160
|
+
private readonly lastDifficultyObject;
|
|
161
|
+
private readonly lastLastDifficultyObject;
|
|
162
|
+
/**
|
|
163
|
+
* Note: You **must** call `computeProperties` at some point due to how TypeScript handles
|
|
164
|
+
* overridden properties (see [this](https://github.com/microsoft/TypeScript/issues/1617) GitHub issue).
|
|
165
|
+
*
|
|
166
|
+
* @param object The underlying hitobject.
|
|
167
|
+
* @param lastObject The hitobject before this hitobject.
|
|
168
|
+
* @param difficultyHitObjects All difficulty hitobjects in the processed beatmap.
|
|
169
|
+
* @param clockRate The clock rate of the beatmap.
|
|
170
|
+
* @param index The index of this hitobject in the list of all hitobjects.
|
|
171
|
+
*/
|
|
172
|
+
constructor(object: PlaceableHitObject, lastObject: PlaceableHitObject | null, difficultyHitObjects: readonly DifficultyHitObject[], clockRate: number, index: number);
|
|
173
|
+
/**
|
|
174
|
+
* Computes the properties of this hitobject.
|
|
175
|
+
*
|
|
176
|
+
* @param clockRate The clock rate of the beatmap.
|
|
177
|
+
*/
|
|
178
|
+
computeProperties(clockRate: number): void;
|
|
179
|
+
/**
|
|
180
|
+
* Gets the difficulty hitobject at a specific index with respect to the current
|
|
181
|
+
* difficulty hitobject's index.
|
|
182
|
+
*
|
|
183
|
+
* Will return `null` if the index is out of range.
|
|
184
|
+
*
|
|
185
|
+
* @param backwardsIndex The index to move backwards for.
|
|
186
|
+
* @returns The difficulty hitobject at the index with respect to the current
|
|
187
|
+
* difficulty hitobject's index, `null` if the index is out of range.
|
|
188
|
+
*/
|
|
189
|
+
previous(backwardsIndex: number): this | null;
|
|
190
|
+
/**
|
|
191
|
+
* Gets the difficulty hitobject at a specific index with respect to the current
|
|
192
|
+
* difficulty hitobject's index.
|
|
193
|
+
*
|
|
194
|
+
* Will return `null` if the index is out of range.
|
|
195
|
+
*
|
|
196
|
+
* @param forwardsIndex The index to move forwards for.
|
|
197
|
+
* @returns The difficulty hitobject at the index with respect to the current
|
|
198
|
+
* difficulty hitobject's index, `null` if the index is out of range.
|
|
199
|
+
*/
|
|
200
|
+
next(forwardsIndex: number): this | null;
|
|
201
|
+
/**
|
|
202
|
+
* Calculates the opacity of the hitobject at a given time.
|
|
203
|
+
*
|
|
204
|
+
* @param time The time to calculate the hitobject's opacity at.
|
|
205
|
+
* @param mods The mods used. Defaults to No Mod.
|
|
206
|
+
* @returns The opacity of the hitobject at the given time.
|
|
207
|
+
*/
|
|
208
|
+
opacityAt(time: number, mods?: ModMap): number;
|
|
209
|
+
/**
|
|
210
|
+
* How possible is it to doubletap this object together with the next one and get perfect
|
|
211
|
+
* judgement in range from 0 to 1.
|
|
212
|
+
*
|
|
213
|
+
* A value closer to 1 indicates a higher possibility.
|
|
214
|
+
*/
|
|
215
|
+
getDoubletapness(nextObj: this | null): number;
|
|
216
|
+
/**
|
|
217
|
+
* Retrieves the full rate-adjusted hit window for a {@link HitResult}.
|
|
218
|
+
*/
|
|
219
|
+
hitWindowFor(result: HitResult): number;
|
|
220
|
+
/**
|
|
221
|
+
* The {@link HitWindow} for this {@link DifficultyHitObject}.
|
|
222
|
+
*/
|
|
223
|
+
protected get rawHitWindow(): HitWindow;
|
|
224
|
+
private setDistances;
|
|
225
|
+
private calculateAngle;
|
|
226
|
+
private calculateSliderAngle;
|
|
227
|
+
private calculateSliderCursorPosition;
|
|
228
|
+
private getEndCursorPosition;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Holds data that can be used to calculate performance points.
|
|
232
|
+
*/
|
|
233
|
+
export interface IDifficultyAttributes {
|
|
234
|
+
/**
|
|
235
|
+
* The mods which were applied to the beatmap.
|
|
236
|
+
*/
|
|
237
|
+
mods: ModMap;
|
|
238
|
+
/**
|
|
239
|
+
* The combined star rating of all skills.
|
|
240
|
+
*/
|
|
241
|
+
starRating: number;
|
|
242
|
+
/**
|
|
243
|
+
* The maximum achievable combo.
|
|
244
|
+
*/
|
|
245
|
+
maxCombo: number;
|
|
246
|
+
/**
|
|
247
|
+
* The difficulty corresponding to the aim skill.
|
|
248
|
+
*/
|
|
249
|
+
aimDifficulty: number;
|
|
250
|
+
/**
|
|
251
|
+
* The difficulty corresponding to the flashlight skill.
|
|
252
|
+
*/
|
|
253
|
+
flashlightDifficulty: number;
|
|
254
|
+
/**
|
|
255
|
+
* The difficulty corresponding to the reading skill.
|
|
256
|
+
*/
|
|
257
|
+
readingDifficulty: number;
|
|
258
|
+
/**
|
|
259
|
+
* The number of clickable objects weighted by difficulty.
|
|
260
|
+
*
|
|
261
|
+
* Related to speed/tap difficulty.
|
|
262
|
+
*/
|
|
263
|
+
speedNoteCount: number;
|
|
264
|
+
/**
|
|
265
|
+
* Describes how much of aim difficulty is contributed to by hitcircles or sliders.
|
|
266
|
+
*
|
|
267
|
+
* A value closer to 1 indicates most of aim difficulty is contributed by hitcircles.
|
|
268
|
+
*
|
|
269
|
+
* A value closer to 0 indicates most of aim difficulty is contributed by sliders.
|
|
270
|
+
*/
|
|
271
|
+
sliderFactor: number;
|
|
272
|
+
/**
|
|
273
|
+
* The overall clock rate that was applied to the beatmap.
|
|
274
|
+
*/
|
|
275
|
+
clockRate: number;
|
|
276
|
+
/**
|
|
277
|
+
* The perceived overall difficulty **exclusive** of rate-adjusting mods (DT/HT/etc).
|
|
278
|
+
*
|
|
279
|
+
* Rate-adjusting mods don't directly affect the overall difficulty value, but have a perceived effect as a result of adjusting audio timing.
|
|
280
|
+
*/
|
|
281
|
+
overallDifficulty: number;
|
|
282
|
+
/**
|
|
283
|
+
* The number of hitcircles in the beatmap.
|
|
284
|
+
*/
|
|
285
|
+
hitCircleCount: number;
|
|
286
|
+
/**
|
|
287
|
+
* The number of sliders in the beatmap.
|
|
288
|
+
*/
|
|
289
|
+
sliderCount: number;
|
|
290
|
+
/**
|
|
291
|
+
* The number of spinners in the beatmap.
|
|
292
|
+
*/
|
|
293
|
+
spinnerCount: number;
|
|
294
|
+
/**
|
|
295
|
+
* The number of sliders weighted by difficulty.
|
|
296
|
+
*/
|
|
297
|
+
aimDifficultSliderCount: number;
|
|
298
|
+
/**
|
|
299
|
+
* The amount of strains that are considered difficult with respect to the aim skill.
|
|
300
|
+
*/
|
|
301
|
+
aimDifficultStrainCount: number;
|
|
302
|
+
/**
|
|
303
|
+
* Describes how much of {@link aimDifficultStrainCount} is contributed to by circles or sliders.
|
|
304
|
+
*
|
|
305
|
+
* A value closer to 0 indicates most of {@link aimDifficultStrainCount} is contributed by circles.
|
|
306
|
+
*
|
|
307
|
+
* A value closer to infinity indicates most of {@link aimDifficultStrainCount} is contributed by sliders.
|
|
308
|
+
*/
|
|
309
|
+
aimTopWeightedSliderFactor: number;
|
|
310
|
+
/**
|
|
311
|
+
* The amount of notes that are considered difficult with respect to the reading skill.
|
|
312
|
+
*/
|
|
313
|
+
readingDifficultNoteCount: number;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Represents difficulty attributes that can be cached.
|
|
317
|
+
*/
|
|
318
|
+
export type CacheableDifficultyAttributes<T extends IDifficultyAttributes> = Omit<T, "mods" | "toCacheableAttributes"> & {
|
|
319
|
+
/**
|
|
320
|
+
* The mods which were applied to the beatmap.
|
|
321
|
+
*/
|
|
322
|
+
mods: SerializedMod[];
|
|
323
|
+
};
|
|
324
|
+
/**
|
|
325
|
+
* Holds data that can be used to calculate performance points.
|
|
326
|
+
*/
|
|
327
|
+
export declare abstract class DifficultyAttributes implements IDifficultyAttributes {
|
|
328
|
+
mods: ModMap;
|
|
329
|
+
starRating: number;
|
|
330
|
+
maxCombo: number;
|
|
331
|
+
aimDifficulty: number;
|
|
332
|
+
flashlightDifficulty: number;
|
|
333
|
+
readingDifficulty: number;
|
|
334
|
+
speedNoteCount: number;
|
|
335
|
+
sliderFactor: number;
|
|
336
|
+
clockRate: number;
|
|
337
|
+
overallDifficulty: number;
|
|
338
|
+
hitCircleCount: number;
|
|
339
|
+
sliderCount: number;
|
|
340
|
+
spinnerCount: number;
|
|
341
|
+
aimDifficultSliderCount: number;
|
|
342
|
+
aimDifficultStrainCount: number;
|
|
343
|
+
aimTopWeightedSliderFactor: number;
|
|
344
|
+
readingDifficultNoteCount: number;
|
|
345
|
+
constructor(cacheableAttributes?: CacheableDifficultyAttributes<IDifficultyAttributes>);
|
|
346
|
+
/**
|
|
347
|
+
* Converts this `DifficultyAttributes` instance to an attribute structure that can be cached.
|
|
348
|
+
*
|
|
349
|
+
* @returns The cacheable attributes.
|
|
350
|
+
*/
|
|
351
|
+
toCacheableAttributes(): CacheableDifficultyAttributes<this>;
|
|
352
|
+
/**
|
|
353
|
+
* Returns a string representation of the difficulty attributes.
|
|
354
|
+
*/
|
|
355
|
+
toString(): string;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Represents a strain peak at a specific point in time.
|
|
359
|
+
*/
|
|
360
|
+
export interface TimedStrainPeak {
|
|
361
|
+
/**
|
|
362
|
+
* The time at which this peak occurs, in milliseconds.
|
|
363
|
+
*/
|
|
364
|
+
readonly time: number;
|
|
365
|
+
/**
|
|
366
|
+
* The strain value of this peak.
|
|
367
|
+
*/
|
|
368
|
+
readonly value: number;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Represents the strain peaks of various calculated difficulties.
|
|
372
|
+
*/
|
|
373
|
+
export interface StrainPeaks {
|
|
374
|
+
/**
|
|
375
|
+
* The strain peaks of aim difficulty if sliders are considered.
|
|
376
|
+
*/
|
|
377
|
+
aimWithSliders: readonly TimedStrainPeak[];
|
|
378
|
+
/**
|
|
379
|
+
* The strain peaks of aim difficulty if sliders are not considered.
|
|
380
|
+
*/
|
|
381
|
+
aimWithoutSliders: readonly TimedStrainPeak[];
|
|
382
|
+
/**
|
|
383
|
+
* The strain peaks of speed difficulty.
|
|
384
|
+
*/
|
|
385
|
+
speed: readonly TimedStrainPeak[];
|
|
386
|
+
/**
|
|
387
|
+
* The strain peaks of flashlight difficulty.
|
|
388
|
+
*/
|
|
389
|
+
flashlight: readonly TimedStrainPeak[];
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* An interface for `Skill`s that have peak difficulties.
|
|
393
|
+
*/
|
|
394
|
+
interface IHasPeakDifficulty {
|
|
395
|
+
/**
|
|
396
|
+
* The peak difficulties calculated by this `Skill`, in chronological order.
|
|
397
|
+
*/
|
|
398
|
+
get peaks(): readonly TimedStrainPeak[];
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* A bare minimal abstract skill for fully custom skill implementations.
|
|
402
|
+
*/
|
|
403
|
+
declare abstract class Skill {
|
|
404
|
+
/**
|
|
405
|
+
* The mods that this skill processes.
|
|
406
|
+
*/
|
|
407
|
+
protected readonly mods: ModMap;
|
|
408
|
+
private _objectDifficulties;
|
|
409
|
+
/**
|
|
410
|
+
* The difficulties of {@link DifficultyHitObject}s, populated by {@link Skill.process}.
|
|
411
|
+
*/
|
|
412
|
+
protected get objectDifficulties(): readonly number[];
|
|
413
|
+
constructor(mods: ModMap);
|
|
414
|
+
/**
|
|
415
|
+
* Calculates the strain value of a hitobject and stores the value in it.
|
|
416
|
+
* This value is affected by previously processed objects.
|
|
417
|
+
*
|
|
418
|
+
* @param current The hitobject to process.
|
|
419
|
+
*/
|
|
420
|
+
process(current: DifficultyHitObject): void;
|
|
421
|
+
/**
|
|
422
|
+
* Returns the calculated difficulty value representing all hitobjects that have been processed up to this point.
|
|
423
|
+
*/
|
|
424
|
+
abstract difficultyValue(): number;
|
|
425
|
+
/**
|
|
426
|
+
* Saves the calculated difficulty to a {@link DifficultyHitObject}.
|
|
427
|
+
*
|
|
428
|
+
* @param current The {@link DifficultyHitObject} to save the difficulty to.
|
|
429
|
+
* @param difficulty The difficulty to save.
|
|
430
|
+
*/
|
|
431
|
+
protected saveToHitObject(current: DifficultyHitObject, difficulty: number): void;
|
|
432
|
+
/**
|
|
433
|
+
* Calculates the difficulty value of a hitobject and stores the value in it.
|
|
434
|
+
*
|
|
435
|
+
* @param current The hitobject to process.
|
|
436
|
+
*/
|
|
437
|
+
protected abstract processInternal(current: DifficultyHitObject): number;
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Wraps a `DifficultyAttributes` object and adds a time value for which the attribute is valid.
|
|
441
|
+
*
|
|
442
|
+
* Output by `DifficultyCalculator.calculateTimed` methods.
|
|
443
|
+
*/
|
|
444
|
+
export interface TimedDifficultyAttributes<TAttributes extends DifficultyAttributes> {
|
|
445
|
+
/**
|
|
446
|
+
* The non-clock-adjusted time value at which the attributes take effect.
|
|
447
|
+
*/
|
|
448
|
+
readonly time: number;
|
|
449
|
+
/**
|
|
450
|
+
* The attributes.
|
|
451
|
+
*/
|
|
452
|
+
readonly attributes: TAttributes;
|
|
453
|
+
/**
|
|
454
|
+
* The number of sliders in the beatmap up to this point.
|
|
455
|
+
*/
|
|
456
|
+
readonly sliderCount: number;
|
|
457
|
+
/**
|
|
458
|
+
* The number of slider ticks in the beatmap up to this point.
|
|
459
|
+
*/
|
|
460
|
+
readonly sliderTickCount: number;
|
|
461
|
+
/**
|
|
462
|
+
* The number of slider repeats in the beatmap up to this point.
|
|
463
|
+
*/
|
|
464
|
+
readonly sliderRepeatCount: number;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* The base of a difficulty calculator.
|
|
468
|
+
*/
|
|
469
|
+
export declare abstract class DifficultyCalculator<TBeatmap extends PlayableBeatmap, THitObject extends DifficultyHitObject, TAttributes extends DifficultyAttributes> {
|
|
470
|
+
/**
|
|
471
|
+
* `Mod`s that adjust the difficulty of a beatmap.
|
|
472
|
+
*/
|
|
473
|
+
protected readonly difficultyAdjustmentMods: (typeof Mod)[];
|
|
474
|
+
/**
|
|
475
|
+
* Retains `Mod`s that adjust a beatmap's difficulty from the specified mods.
|
|
476
|
+
*
|
|
477
|
+
* @param mods The mods to retain the difficulty adjustment mods from.
|
|
478
|
+
* @returns The retained difficulty adjustment mods.
|
|
479
|
+
*/
|
|
480
|
+
abstract retainDifficultyAdjustmentMods(mods: Mod[]): Mod[];
|
|
481
|
+
/**
|
|
482
|
+
* Calculates the difficulty of a `Beatmap` with specific `Mod`s.
|
|
483
|
+
*
|
|
484
|
+
* @param beatmap The `Beatmap` whose difficulty is to be calculated.
|
|
485
|
+
* @param mods The `Mod`s to apply to the beatmap. Defaults to No Mod.
|
|
486
|
+
* @returns A `DifficultyAttributes` object describing the difficulty of the `Beatmap`.
|
|
487
|
+
*/
|
|
488
|
+
calculate(beatmap: Beatmap, mods?: ModMap): TAttributes;
|
|
489
|
+
/**
|
|
490
|
+
* Obtains the strain peaks of a `PlayableBeatmap`.
|
|
491
|
+
*
|
|
492
|
+
* @param beatmap The `PlayableBeatmap` whose strain peaks are to be calculated.
|
|
493
|
+
* @returns The strain peaks of the `PlayableBeatmap`.
|
|
494
|
+
*/
|
|
495
|
+
calculateStrainPeaks(beatmap: TBeatmap): StrainPeaks;
|
|
496
|
+
/**
|
|
497
|
+
* Obtains the strain peaks of a `Beatmap` with specific `Mod`s.
|
|
498
|
+
*
|
|
499
|
+
* @param beatmap The `Beatmap` whose strain peaks are to be calculated.
|
|
500
|
+
* @param mods The `Mod`s to apply to the beatmap. Defaults to No Mod.
|
|
501
|
+
* @returns The strain peaks of the `Beatmap`.
|
|
502
|
+
*/
|
|
503
|
+
calculateStrainPeaks(beatmap: Beatmap, mods?: ModMap): StrainPeaks;
|
|
504
|
+
/**
|
|
505
|
+
* Calculates the difficulty of a `Beatmap` with specific `Mod`s and returns a set of
|
|
506
|
+
* `TimedDifficultyAttributes` representing the difficulty at every relevant time value in the `Beatmap`.
|
|
507
|
+
*
|
|
508
|
+
* @param beatmap The `Beatmap` whose difficulty is to be calculated.
|
|
509
|
+
* @param mods The `Mod`s to apply to the `Beatmap`.
|
|
510
|
+
* @return The set of `TimedDifficultyAttributes`.
|
|
511
|
+
*/
|
|
512
|
+
calculateTimed(beatmap: Beatmap, mods?: ModMap): TimedDifficultyAttributes<TAttributes>[];
|
|
513
|
+
/**
|
|
514
|
+
* Creates the `Skill`s to calculate the difficulty of a `PlayableBeatmap`.
|
|
515
|
+
*
|
|
516
|
+
* @param beatmap The `PlayableBeatmap` whose difficulty will be calculated.
|
|
517
|
+
* @returns The `Skill`s.
|
|
518
|
+
*/
|
|
519
|
+
protected abstract createSkills(beatmap: TBeatmap): Skill[];
|
|
520
|
+
/**
|
|
521
|
+
* Creates the `Skill`s to obtain the strain peaks of a `PlayableBeatmap`.
|
|
522
|
+
*
|
|
523
|
+
* @param beatmap The `PlayableBeatmap` whose strain peaks will be calculated.
|
|
524
|
+
* @returns The `Skill`s.
|
|
525
|
+
*/
|
|
526
|
+
protected abstract createStrainPeakSkills(beatmap: TBeatmap): (Skill & IHasPeakDifficulty)[];
|
|
527
|
+
/**
|
|
528
|
+
* Creates difficulty hitobjects for this calculator.
|
|
529
|
+
*
|
|
530
|
+
* @param beatmap The beatmap to generate difficulty hitobjects from.
|
|
531
|
+
* @returns The generated difficulty hitobjects.
|
|
532
|
+
*/
|
|
533
|
+
protected abstract createDifficultyHitObjects(beatmap: TBeatmap): THitObject[];
|
|
534
|
+
/**
|
|
535
|
+
* Creates a `DifficultyAttributes` object to describe a `PlayableBeatmap`'s difficulty.
|
|
536
|
+
*
|
|
537
|
+
* @param beatmap The `Beatmap` whose difficulty was calculated.
|
|
538
|
+
* @param playableBeatmap The `PlayableBeatmap` whose difficulty was calculated.
|
|
539
|
+
* @param skills The `Skill`s which processed the `PlayableBeatmap`.
|
|
540
|
+
* @param objects The `DifficultyHitObject`s which were processed.
|
|
541
|
+
* @returns The `DifficultyAttributes` object.
|
|
542
|
+
*/
|
|
543
|
+
protected abstract createDifficultyAttributes(beatmap: Beatmap, playableBeatmap: PlayableBeatmap, skills: Skill[], objects: THitObject[]): TAttributes;
|
|
544
|
+
/**
|
|
545
|
+
* Constructs a `PlayableBeatmap` from a `Beatmap` with specific `Mod`s.
|
|
546
|
+
*
|
|
547
|
+
* @param beatmap The `Beatmap` to create a `PlayableBeatmap` from.
|
|
548
|
+
* @param mods The `Mod`s to apply to the `Beatmap`.
|
|
549
|
+
* @returns The `PlayableBeatmap`.
|
|
550
|
+
*/
|
|
551
|
+
protected abstract createPlayableBeatmap(beatmap: Beatmap, mods?: ModMap): TBeatmap;
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Represents options for performance calculation.
|
|
555
|
+
*/
|
|
556
|
+
export interface PerformanceCalculationOptions {
|
|
557
|
+
/**
|
|
558
|
+
* The maximum combo achieved in the score.
|
|
559
|
+
*/
|
|
560
|
+
combo?: number;
|
|
561
|
+
/**
|
|
562
|
+
* The accuracy achieved in the score.
|
|
563
|
+
*/
|
|
564
|
+
accPercent?: Accuracy | number;
|
|
565
|
+
/**
|
|
566
|
+
* The amount of misses achieved in the score.
|
|
567
|
+
*
|
|
568
|
+
* If {@link accPercent} is provided as an {@link Accuracy} object, this value will be ignored.
|
|
569
|
+
*/
|
|
570
|
+
miss?: number;
|
|
571
|
+
/**
|
|
572
|
+
* The amount of slider ends dropped in the score.
|
|
573
|
+
*/
|
|
574
|
+
sliderEndsDropped?: number;
|
|
575
|
+
/**
|
|
576
|
+
* The amount of slider ticks missed in the score.
|
|
577
|
+
*/
|
|
578
|
+
sliderTicksMissed?: number;
|
|
579
|
+
/**
|
|
580
|
+
* The tap penalty to apply for penalized scores. Only used when using `DroidPerformanceCalculator`.
|
|
581
|
+
*/
|
|
582
|
+
tapPenalty?: number;
|
|
583
|
+
/**
|
|
584
|
+
* The aim slider cheese penalty to apply for penalized scores. Only used when using `DroidPerformanceCalculator`.
|
|
585
|
+
*/
|
|
586
|
+
sliderCheesePenalty?: number;
|
|
587
|
+
/**
|
|
588
|
+
* The total score achieved in the score.
|
|
589
|
+
*/
|
|
590
|
+
totalScore?: number;
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* Represents the calculated performance of a score.
|
|
594
|
+
*/
|
|
595
|
+
export interface IPerformanceAttributes {
|
|
596
|
+
/**
|
|
597
|
+
* Calculated score performance points.
|
|
598
|
+
*/
|
|
599
|
+
total: number;
|
|
600
|
+
/**
|
|
601
|
+
* The amount of misses, including slider breaks.
|
|
602
|
+
*/
|
|
603
|
+
effectiveMissCount: number;
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* The base class of performance calculators.
|
|
607
|
+
*/
|
|
608
|
+
export declare abstract class PerformanceCalculator<TDifficultyAttributes extends IDifficultyAttributes, TPerformanceAttributes extends IPerformanceAttributes> {
|
|
609
|
+
/**
|
|
610
|
+
* The calculated accuracy.
|
|
611
|
+
*/
|
|
612
|
+
computedAccuracy: Accuracy;
|
|
613
|
+
/**
|
|
614
|
+
* The calculated maximum combo.
|
|
615
|
+
*/
|
|
616
|
+
combo: number;
|
|
617
|
+
/**
|
|
618
|
+
* The difficulty attributes that is being calculated.
|
|
619
|
+
*/
|
|
620
|
+
readonly difficultyAttributes: TDifficultyAttributes | CacheableDifficultyAttributes<TDifficultyAttributes>;
|
|
621
|
+
/**
|
|
622
|
+
* The mods that were used.
|
|
623
|
+
*/
|
|
624
|
+
protected readonly mods: ModMap;
|
|
625
|
+
private _sliderEndsDropped;
|
|
626
|
+
/**
|
|
627
|
+
* The amount of slider ends dropped in the score.
|
|
628
|
+
*/
|
|
629
|
+
protected get sliderEndsDropped(): number;
|
|
630
|
+
private _sliderTicksMissed;
|
|
631
|
+
/**
|
|
632
|
+
* The amount of slider ticks missed in the score.
|
|
633
|
+
*
|
|
634
|
+
* This is used to calculate the slider accuracy.
|
|
635
|
+
*/
|
|
636
|
+
protected get sliderTicksMissed(): number;
|
|
637
|
+
private _usingClassicSliderAccuracy;
|
|
638
|
+
/**
|
|
639
|
+
* Whether this score uses classic slider accuracy.
|
|
640
|
+
*/
|
|
641
|
+
protected get usingClassicSliderAccuracy(): boolean;
|
|
642
|
+
/**
|
|
643
|
+
* @param difficultyAttributes The difficulty attributes to calculate.
|
|
644
|
+
*/
|
|
645
|
+
constructor(difficultyAttributes: TDifficultyAttributes | CacheableDifficultyAttributes<TDifficultyAttributes>);
|
|
646
|
+
/**
|
|
647
|
+
* Calculates the performance points of the beatmap.
|
|
648
|
+
*
|
|
649
|
+
* @param options Options for performance calculation.
|
|
650
|
+
* @returns The attributes representing the performance.
|
|
651
|
+
*/
|
|
652
|
+
calculate(options?: PerformanceCalculationOptions): TPerformanceAttributes;
|
|
653
|
+
/**
|
|
654
|
+
* Creates the performance attributes for this calculator.
|
|
655
|
+
*
|
|
656
|
+
* @returns The performance attributes.
|
|
657
|
+
*/
|
|
658
|
+
protected abstract createPerformanceAttributes(): TPerformanceAttributes;
|
|
659
|
+
/**
|
|
660
|
+
* The total hits that can be done in the beatmap.
|
|
661
|
+
*/
|
|
662
|
+
protected get totalHits(): number;
|
|
663
|
+
/**
|
|
664
|
+
* The total hits that were successfully done.
|
|
665
|
+
*/
|
|
666
|
+
protected get totalSuccessfulHits(): number;
|
|
667
|
+
/**
|
|
668
|
+
* The total of imperfect hits (100s, 50s, misses).
|
|
669
|
+
*/
|
|
670
|
+
protected get totalImperfectHits(): number;
|
|
671
|
+
/**
|
|
672
|
+
* Processes given options for usage in performance calculation.
|
|
673
|
+
*
|
|
674
|
+
* @param options Options for performance calculation.
|
|
675
|
+
*/
|
|
676
|
+
protected handleOptions(options?: PerformanceCalculationOptions): void;
|
|
677
|
+
/**
|
|
678
|
+
* Determines whether an attribute is a cacheable attribute.
|
|
679
|
+
*
|
|
680
|
+
* @param attributes The attributes to check.
|
|
681
|
+
* @returns Whether the attributes are cacheable.
|
|
682
|
+
*/
|
|
683
|
+
private isCacheableAttribute;
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Represents an osu!droid hit object with difficulty calculation values.
|
|
687
|
+
*/
|
|
688
|
+
export declare class DroidDifficultyHitObject extends DifficultyHitObject {
|
|
689
|
+
/**
|
|
690
|
+
* The tap difficulty generated by the hitobject.
|
|
691
|
+
*/
|
|
692
|
+
tapDifficulty: number;
|
|
693
|
+
/**
|
|
694
|
+
* The tap difficulty generated by the hitobject if `strainTime` isn't modified by
|
|
695
|
+
* OD. This is used in three-finger detection.
|
|
696
|
+
*/
|
|
697
|
+
originalTapDifficulty: number;
|
|
698
|
+
/**
|
|
699
|
+
* The rhythm difficulty generated by the hitobject.
|
|
700
|
+
*/
|
|
701
|
+
rhythmDifficulty: number;
|
|
702
|
+
readonly normalizedRadius = 50;
|
|
703
|
+
protected readonly mode = Modes.Droid;
|
|
704
|
+
protected get maximumSliderRadius(): number;
|
|
705
|
+
get smallCircleBonus(): number;
|
|
706
|
+
opacityAt(time: number, mods?: ModMap): number;
|
|
707
|
+
previous(backwardsIndex: number): this | null;
|
|
708
|
+
next(forwardsIndex: number): this | null;
|
|
709
|
+
/**
|
|
710
|
+
* Determines whether this hitobject is considered overlapping with the hitobject before it.
|
|
711
|
+
*
|
|
712
|
+
* Keep in mind that "overlapping" in this case is overlapping to the point where both hitobjects
|
|
713
|
+
* can be hit with just a single tap in osu!droid.
|
|
714
|
+
*
|
|
715
|
+
* In the case of sliders, it is considered overlapping if all nested hitobjects can be hit with
|
|
716
|
+
* one aim motion.
|
|
717
|
+
*
|
|
718
|
+
* @param considerDistance Whether to consider the distance between both hitobjects.
|
|
719
|
+
* @returns Whether the hitobject is considered overlapping.
|
|
720
|
+
*/
|
|
721
|
+
isOverlapping(considerDistance: boolean): boolean;
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Represents a slider that is considered difficult.
|
|
725
|
+
*
|
|
726
|
+
* This structure is a part of difficulty attributes and can be cached.
|
|
727
|
+
*/
|
|
728
|
+
export interface DifficultSlider {
|
|
729
|
+
/**
|
|
730
|
+
* The index of the slider in the beatmap.
|
|
731
|
+
*/
|
|
732
|
+
readonly index: number;
|
|
733
|
+
/**
|
|
734
|
+
* The difficulty rating of this slider compared to other sliders, based on the velocity of the slider.
|
|
735
|
+
*
|
|
736
|
+
* A value closer to 1 indicates that this slider is more difficult compared to most sliders.
|
|
737
|
+
*
|
|
738
|
+
* A value closer to 0 indicates that this slider is easier compared to most sliders.
|
|
739
|
+
*/
|
|
740
|
+
readonly difficultyRating: number;
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* Holds data that can be used to calculate osu!droid performance points.
|
|
744
|
+
*/
|
|
745
|
+
export interface IDroidDifficultyAttributes extends IDifficultyAttributes {
|
|
746
|
+
/**
|
|
747
|
+
* The difficulty corresponding to the tap skill.
|
|
748
|
+
*/
|
|
749
|
+
tapDifficulty: number;
|
|
750
|
+
/**
|
|
751
|
+
* The difficulty corresponding to the rhythm skill.
|
|
752
|
+
*/
|
|
753
|
+
rhythmDifficulty: number;
|
|
754
|
+
/**
|
|
755
|
+
* The amount of strains that are considered difficult with respect to the tap skill.
|
|
756
|
+
*/
|
|
757
|
+
tapDifficultStrainCount: number;
|
|
758
|
+
/**
|
|
759
|
+
* Describes how much of {@link tapDifficultStrainCount} is contributed to by circles or sliders.
|
|
760
|
+
*
|
|
761
|
+
* A value closer to 0 indicates most of {@link tapDifficultStrainCount} is contributed by circles.
|
|
762
|
+
*
|
|
763
|
+
* A value closer to infinity indicates most of {@link tapDifficultStrainCount} is contributed by sliders.
|
|
764
|
+
*/
|
|
765
|
+
tapTopWeightedSliderFactor: number;
|
|
766
|
+
/**
|
|
767
|
+
* The maximum score obtainable on the beatmap.
|
|
768
|
+
*/
|
|
769
|
+
maximumScore: number;
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Holds data that can be used to calculate osu!droid performance points.
|
|
773
|
+
*/
|
|
774
|
+
export declare class DroidDifficultyAttributes extends DifficultyAttributes implements IDroidDifficultyAttributes {
|
|
775
|
+
tapDifficulty: number;
|
|
776
|
+
tapTopWeightedSliderFactor: number;
|
|
777
|
+
rhythmDifficulty: number;
|
|
778
|
+
tapDifficultStrainCount: number;
|
|
779
|
+
maximumScore: number;
|
|
780
|
+
constructor(cacheableAttributes?: CacheableDifficultyAttributes<IDroidDifficultyAttributes>);
|
|
781
|
+
toString(): string;
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* Represents a beatmap section at which the strains of objects are considerably high.
|
|
785
|
+
*/
|
|
786
|
+
export interface HighStrainSection {
|
|
787
|
+
/**
|
|
788
|
+
* The index of the first object in this section with respect to the full beatmap.
|
|
789
|
+
*/
|
|
790
|
+
readonly firstObjectIndex: number;
|
|
791
|
+
/**
|
|
792
|
+
* The index of the last object in this section with respect to the full beatmap.
|
|
793
|
+
*/
|
|
794
|
+
readonly lastObjectIndex: number;
|
|
795
|
+
/**
|
|
796
|
+
* The summed strain of this section.
|
|
797
|
+
*/
|
|
798
|
+
readonly sumStrain: number;
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* Holds data that can be used to calculate osu!droid performance points as well
|
|
802
|
+
* as doing some analysis using the replay of a score.
|
|
803
|
+
*/
|
|
804
|
+
export interface IExtendedDroidDifficultyAttributes extends IDroidDifficultyAttributes {
|
|
805
|
+
/**
|
|
806
|
+
* The mode of the difficulty calculation.
|
|
807
|
+
*/
|
|
808
|
+
mode: "live";
|
|
809
|
+
/**
|
|
810
|
+
* Possible sections at which the player can use three fingers on.
|
|
811
|
+
*/
|
|
812
|
+
possibleThreeFingeredSections: HighStrainSection[];
|
|
813
|
+
/**
|
|
814
|
+
* Sliders that are considered difficult.
|
|
815
|
+
*/
|
|
816
|
+
difficultSliders: DifficultSlider[];
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* Holds data that can be used to calculate osu!droid performance points as well
|
|
820
|
+
* as doing some analysis using the replay of a score.
|
|
821
|
+
*/
|
|
822
|
+
export declare class ExtendedDroidDifficultyAttributes extends DroidDifficultyAttributes implements IExtendedDroidDifficultyAttributes {
|
|
823
|
+
mode: "live";
|
|
824
|
+
possibleThreeFingeredSections: HighStrainSection[];
|
|
825
|
+
difficultSliders: DifficultSlider[];
|
|
826
|
+
constructor(cacheableAttributes?: CacheableDifficultyAttributes<IExtendedDroidDifficultyAttributes>);
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* A difficulty calculator for osu!droid gamemode.
|
|
830
|
+
*/
|
|
831
|
+
export declare class DroidDifficultyCalculator extends DifficultyCalculator<DroidPlayableBeatmap, DroidDifficultyHitObject, ExtendedDroidDifficultyAttributes> {
|
|
832
|
+
constructor();
|
|
833
|
+
retainDifficultyAdjustmentMods(mods: Mod[]): Mod[];
|
|
834
|
+
protected createDifficultyAttributes(beatmap: Beatmap, playableBeatmap: PlayableBeatmap, skills: Skill[], objects: DroidDifficultyHitObject[]): ExtendedDroidDifficultyAttributes;
|
|
835
|
+
protected createPlayableBeatmap(beatmap: Beatmap, mods?: ModMap): DroidPlayableBeatmap;
|
|
836
|
+
protected createDifficultyHitObjects(beatmap: DroidPlayableBeatmap): DroidDifficultyHitObject[];
|
|
837
|
+
protected createSkills(beatmap: DroidPlayableBeatmap): Skill[];
|
|
838
|
+
protected createStrainPeakSkills(beatmap: DroidPlayableBeatmap): (Skill & IHasPeakDifficulty)[];
|
|
839
|
+
private populateAimAttributes;
|
|
840
|
+
private populateTapAttributes;
|
|
841
|
+
private populateRhythmAttributes;
|
|
842
|
+
private populateFlashlightAttributes;
|
|
843
|
+
private populateReadingAttributes;
|
|
844
|
+
private calculateAimDifficultyRating;
|
|
845
|
+
private calculateDifficultyRating;
|
|
846
|
+
static sumCognitionDifficulty(reading: number, flashlight: number): number;
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Represents the calculated performance of a score in osu!droid.
|
|
850
|
+
*/
|
|
851
|
+
export interface IDroidPerformanceAttributes extends IPerformanceAttributes {
|
|
852
|
+
/**
|
|
853
|
+
* The aim performance points.
|
|
854
|
+
*/
|
|
855
|
+
aim: number;
|
|
856
|
+
/**
|
|
857
|
+
* The tap performance points.
|
|
858
|
+
*/
|
|
859
|
+
tap: number;
|
|
860
|
+
/**
|
|
861
|
+
* The accuracy performance points.
|
|
862
|
+
*/
|
|
863
|
+
accuracy: number;
|
|
864
|
+
/**
|
|
865
|
+
* The flashlight performance points.
|
|
866
|
+
*/
|
|
867
|
+
flashlight: number;
|
|
868
|
+
/**
|
|
869
|
+
* The reading performance points.
|
|
870
|
+
*/
|
|
871
|
+
reading: number;
|
|
872
|
+
/**
|
|
873
|
+
* The penalty used to penalize the tap performance points.
|
|
874
|
+
*/
|
|
875
|
+
tapPenalty: number;
|
|
876
|
+
/**
|
|
877
|
+
* The estimated deviation of the score.
|
|
878
|
+
*/
|
|
879
|
+
deviation: number;
|
|
880
|
+
/**
|
|
881
|
+
* The estimated tap deviation of the score.
|
|
882
|
+
*/
|
|
883
|
+
tapDeviation: number;
|
|
884
|
+
/**
|
|
885
|
+
* The penalty used to penalize the aim performance points.
|
|
886
|
+
*/
|
|
887
|
+
sliderCheesePenalty: number;
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* A performance points calculator that calculates performance points for osu!droid gamemode.
|
|
891
|
+
*/
|
|
892
|
+
export declare class DroidPerformanceCalculator extends PerformanceCalculator<IDroidDifficultyAttributes, IDroidPerformanceAttributes> {
|
|
893
|
+
/**
|
|
894
|
+
* The total score achieved in the score.
|
|
895
|
+
*/
|
|
896
|
+
get totalScore(): number | null;
|
|
897
|
+
static readonly finalMultiplier = 1.24;
|
|
898
|
+
static readonly normExponent = 1.1;
|
|
899
|
+
private _sliderCheesePenalty;
|
|
900
|
+
private _tapPenalty;
|
|
901
|
+
private _effectiveMissCount;
|
|
902
|
+
private _deviation;
|
|
903
|
+
private _tapDeviation;
|
|
904
|
+
private _totalScore;
|
|
905
|
+
protected createPerformanceAttributes(): IDroidPerformanceAttributes;
|
|
906
|
+
protected handleOptions(options?: PerformanceCalculationOptions): void;
|
|
907
|
+
/**
|
|
908
|
+
* Calculates the aim performance value of the beatmap.
|
|
909
|
+
*/
|
|
910
|
+
private calculateAimValue;
|
|
911
|
+
/**
|
|
912
|
+
* Calculates the tap performance value of the beatmap.
|
|
913
|
+
*/
|
|
914
|
+
private calculateTapValue;
|
|
915
|
+
/**
|
|
916
|
+
* Calculates the accuracy performance value of the beatmap.
|
|
917
|
+
*/
|
|
918
|
+
private calculateAccuracyValue;
|
|
919
|
+
/**
|
|
920
|
+
* Calculates the flashlight performance value of the beatmap.
|
|
921
|
+
*/
|
|
922
|
+
private calculateFlashlightValue;
|
|
923
|
+
/**
|
|
924
|
+
* Calculates the reading performance value of the beatmap.
|
|
925
|
+
*/
|
|
926
|
+
private calculateReadingValue;
|
|
927
|
+
/**
|
|
928
|
+
* Calculates a strain-based miss penalty.
|
|
929
|
+
*
|
|
930
|
+
* Strain-based miss penalty assumes that a player will miss on the hardest parts of a map,
|
|
931
|
+
* so we use the amount of relatively difficult sections to adjust miss penalty
|
|
932
|
+
* to make it more punishing on maps with lower amount of hard sections.
|
|
933
|
+
*/
|
|
934
|
+
private calculateStrainBasedMissPenalty;
|
|
935
|
+
/**
|
|
936
|
+
* The object-based proportional miss penalty.
|
|
937
|
+
*/
|
|
938
|
+
private get proportionalMissPenalty();
|
|
939
|
+
/**
|
|
940
|
+
* Calculates the object-based length scaling based on the deviation of a player for a full
|
|
941
|
+
* combo in this beatmap, taking retries into account.
|
|
942
|
+
*
|
|
943
|
+
* @param objectCount The amount of objects to be considered. Defaults to the amount of
|
|
944
|
+
* objects in this beatmap.
|
|
945
|
+
* @param punishForMemorization Whether to punish the deviation for memorization. Defaults to `false`.
|
|
946
|
+
*/
|
|
947
|
+
private calculateDeviationBasedLengthScaling;
|
|
948
|
+
/**
|
|
949
|
+
* Estimates the player's deviation based on the OD, number of circles and sliders,
|
|
950
|
+
* and number of 300s, 100s, 50s, and misses, assuming the player's mean hit error is 0.
|
|
951
|
+
*
|
|
952
|
+
* The estimation is consistent in that two SS scores on the same map
|
|
953
|
+
* with the same settings will always return the same deviation.
|
|
954
|
+
*
|
|
955
|
+
* Sliders are treated as circles with a 50 hit window.
|
|
956
|
+
*
|
|
957
|
+
* Misses are ignored because they are usually due to misaiming, and 50s
|
|
958
|
+
* are grouped with 100s since they are usually due to misreading.
|
|
959
|
+
*
|
|
960
|
+
* Inaccuracies are capped to the number of circles in the map.
|
|
961
|
+
*/
|
|
962
|
+
private calculateAimDeviation;
|
|
963
|
+
/**
|
|
964
|
+
* Does the same as {@link calculateAimDeviation}, but only for notes and inaccuracies that are relevant to tap difficulty.
|
|
965
|
+
*
|
|
966
|
+
* Treats all difficult speed notes as circles, so this method can sometimes return a lower deviation than {@link calculateAimDeviation}.
|
|
967
|
+
* This is fine though, since this method is only used to scale tap pp.
|
|
968
|
+
*/
|
|
969
|
+
private calculateTapDeviation;
|
|
970
|
+
/**
|
|
971
|
+
* Estimates the player's tap deviation based on the OD, given number of greats, oks, mehs and misses,
|
|
972
|
+
* assuming the player's mean hit error is 0. The estimation is consistent in that two SS scores on the
|
|
973
|
+
* same map with the same settings will always return the same deviation.
|
|
974
|
+
*
|
|
975
|
+
* Misses are ignored because they are usually due to misaiming.
|
|
976
|
+
*
|
|
977
|
+
* Greats and oks are assumed to follow a normal distribution, whereas mehs are assumed to follow a uniform distribution.
|
|
978
|
+
*/
|
|
979
|
+
private calculateDeviation;
|
|
980
|
+
/**
|
|
981
|
+
* Calculates a multiplier for tap to account for improper tapping based on the deviation and tap difficulty.
|
|
982
|
+
*
|
|
983
|
+
* [Graph](https://www.desmos.com/calculator/z5l9ebrwpi)
|
|
984
|
+
*/
|
|
985
|
+
private calculateTapHighDeviationNerf;
|
|
986
|
+
private getHitWindow;
|
|
987
|
+
private calculateEstimatedSliderBreaks;
|
|
988
|
+
private calculateMaximumComboBasedMissCount;
|
|
989
|
+
/**
|
|
990
|
+
* Calculates the amount of misses + sliderbreaks from combo.
|
|
991
|
+
*/
|
|
992
|
+
private calculateComboBasedEstimatedMissCount;
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* An evaluator for calculating osu!droid agility aim difficulty.
|
|
996
|
+
*/
|
|
997
|
+
export declare abstract class DroidAgilityEvaluator {
|
|
998
|
+
/**
|
|
999
|
+
* Evaluates the difficulty of fast aiming the current object.
|
|
1000
|
+
*
|
|
1001
|
+
* @param current The current object.
|
|
1002
|
+
*/
|
|
1003
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject): number;
|
|
1004
|
+
private static highBpmBonus;
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* An evaluator for calculating osu!droid Flashlight skill.
|
|
1008
|
+
*/
|
|
1009
|
+
export declare abstract class DroidFlashlightEvaluator {
|
|
1010
|
+
private static readonly maxOpacityBonus;
|
|
1011
|
+
private static readonly hiddenBonus;
|
|
1012
|
+
private static readonly traceableCircleBonus;
|
|
1013
|
+
private static readonly traceableObjectBonus;
|
|
1014
|
+
private static readonly minVelocity;
|
|
1015
|
+
private static readonly sliderMultiplier;
|
|
1016
|
+
private static readonly minAngleMultiplier;
|
|
1017
|
+
/**
|
|
1018
|
+
* Evaluates the difficulty of memorizing and hitting the current object, based on:
|
|
1019
|
+
*
|
|
1020
|
+
* - distance between a number of previous objects and the current object,
|
|
1021
|
+
* - the visual opacity of the current object,
|
|
1022
|
+
* - the angle made by the current object,
|
|
1023
|
+
* - length and speed of the current object (for sliders),
|
|
1024
|
+
* - and whether Hidden mod is enabled.
|
|
1025
|
+
*
|
|
1026
|
+
* @param current The current object.
|
|
1027
|
+
* @param mods The mods used.
|
|
1028
|
+
*/
|
|
1029
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject, mods: ModMap): number;
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* An evaluator for calculating osu!droid flow aim difficulty.
|
|
1033
|
+
*/
|
|
1034
|
+
export declare abstract class DroidFlowAimEvaluator {
|
|
1035
|
+
private static readonly velocityChangeMultiplier;
|
|
1036
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject, withSliders: boolean): number;
|
|
1037
|
+
private static calculateOverlapFactor;
|
|
1038
|
+
}
|
|
1039
|
+
/**
|
|
1040
|
+
* Evaluator for reading difficulty in osu!droid.
|
|
1041
|
+
*/
|
|
1042
|
+
export declare abstract class DroidReadingEvaluator {
|
|
1043
|
+
private static readonly readingWindowSize;
|
|
1044
|
+
private static readonly hiddenMultiplier;
|
|
1045
|
+
private static readonly traceableMultiplier;
|
|
1046
|
+
private static readonly densityMultiplier;
|
|
1047
|
+
private static readonly densityDifficultyBase;
|
|
1048
|
+
private static readonly preemptBalancingFactor;
|
|
1049
|
+
private static readonly preemptStartingPoint;
|
|
1050
|
+
private static readonly minimumAngleRelevancyTime;
|
|
1051
|
+
private static readonly maximumAngleRelevancyTime;
|
|
1052
|
+
/**
|
|
1053
|
+
* Evaluates the difficulty of reading the object.
|
|
1054
|
+
*/
|
|
1055
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject, mods: ModMap): number;
|
|
1056
|
+
/**
|
|
1057
|
+
* Calculates the density difficulty of the current object and how hard it is to aim it because of it based on:
|
|
1058
|
+
*
|
|
1059
|
+
* - cursor velocity to the current object,
|
|
1060
|
+
* - how many times the current object's angle was repeated,
|
|
1061
|
+
* - density of objects visible when the current object appears, and
|
|
1062
|
+
* - density of objects visible when the current object needs to be clicked.
|
|
1063
|
+
*/
|
|
1064
|
+
private static calculateDensityDifficulty;
|
|
1065
|
+
/**
|
|
1066
|
+
* Calculates the difficulty of aiming the current object when the approach rate is very high based on:
|
|
1067
|
+
*
|
|
1068
|
+
* - cursor velocity to the current object,
|
|
1069
|
+
* - how many times the current object's angle was repeated, and
|
|
1070
|
+
* - how many milliseconds elapse between the approach circle appearing and touching the inner circle.
|
|
1071
|
+
*/
|
|
1072
|
+
private static calculatePreemptDifficulty;
|
|
1073
|
+
/**
|
|
1074
|
+
* Calculates the difficulty of aiming the current object when the Hidden mod is active based on:
|
|
1075
|
+
*
|
|
1076
|
+
* - cursor velocity to the current object,
|
|
1077
|
+
* - time the current object spends invisible,
|
|
1078
|
+
* - density of objects visible when the current object appears,
|
|
1079
|
+
* - density of objects visible when the current object needs to be clicked,
|
|
1080
|
+
* - how many times the current object's angle was repeated, and
|
|
1081
|
+
* - if the current object is perfectly stacked to the previous one.
|
|
1082
|
+
*/
|
|
1083
|
+
private static calculateHiddenDifficulty;
|
|
1084
|
+
private static calculateTraceableDifficulty;
|
|
1085
|
+
private static getPastObjectDifficultyInfluence;
|
|
1086
|
+
/**
|
|
1087
|
+
* Returns a list of objects that are visible on screen at the point in time the current object becomes visible.
|
|
1088
|
+
*/
|
|
1089
|
+
private static retrievePastVisibleObjects;
|
|
1090
|
+
/**
|
|
1091
|
+
* Returns the density of objects visible at the point in time the current object needs to be clicked capped by the reading window.
|
|
1092
|
+
*/
|
|
1093
|
+
private static retrieveCurrentVisibleObjectDensity;
|
|
1094
|
+
/**
|
|
1095
|
+
* Returns a factor of how often the current object's angle has been repeated in a certain time frame.
|
|
1096
|
+
* It does this by checking the difference in angle between current and past objects and sums them based on a range of similarity.
|
|
1097
|
+
* https://www.desmos.com/calculator/eb057a4822
|
|
1098
|
+
*/
|
|
1099
|
+
private static getConstantAngleNerfFactor;
|
|
1100
|
+
/**
|
|
1101
|
+
* Returns a nerfing factor for when objects are very distant in time, affecting reading less.
|
|
1102
|
+
*/
|
|
1103
|
+
private static getTimeNerfFactor;
|
|
1104
|
+
private static highBpmBonus;
|
|
1105
|
+
}
|
|
1106
|
+
/**
|
|
1107
|
+
* An evaluator for calculating osu!droid Rhythm skill.
|
|
1108
|
+
*/
|
|
1109
|
+
export declare abstract class DroidRhythmEvaluator {
|
|
1110
|
+
private static readonly historyTimeMax;
|
|
1111
|
+
private static readonly historyObjectsMax;
|
|
1112
|
+
private static readonly rhythmOverallMultiplier;
|
|
1113
|
+
private static readonly rhythmRatioMultiplier;
|
|
1114
|
+
/**
|
|
1115
|
+
* Calculates a rhythm multiplier for the difficulty of the tap associated
|
|
1116
|
+
* with historic data of the current object.
|
|
1117
|
+
*
|
|
1118
|
+
* @param current The current object.
|
|
1119
|
+
* @param useSliderAccuracy Whether to use slider accuracy.
|
|
1120
|
+
*/
|
|
1121
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject, useSliderAccuracy: boolean): number;
|
|
1122
|
+
private static getEffectiveRatio;
|
|
1123
|
+
}
|
|
1124
|
+
/**
|
|
1125
|
+
* An evaluator for calculating osu!droid snap aim difficulty.
|
|
1126
|
+
*/
|
|
1127
|
+
export declare abstract class DroidSnapAimEvaluator {
|
|
1128
|
+
private static readonly wideAngleMultiplier;
|
|
1129
|
+
private static readonly acuteAngleMultiplier;
|
|
1130
|
+
private static readonly sliderMultiplier;
|
|
1131
|
+
private static readonly velocityChangeMultiplier;
|
|
1132
|
+
private static readonly wiggleMultiplier;
|
|
1133
|
+
private static readonly angleRepetitionNoteLimit;
|
|
1134
|
+
private static readonly maximumRepetitionNerf;
|
|
1135
|
+
private static readonly maximumVectorInfluence;
|
|
1136
|
+
/**
|
|
1137
|
+
* Evaluates the difficulty of aiming the current object, based on:
|
|
1138
|
+
*
|
|
1139
|
+
* - cursor velocity to the current object,
|
|
1140
|
+
* - angle difficulty,
|
|
1141
|
+
* - sharp velocity increases,
|
|
1142
|
+
* - and slider difficulty.
|
|
1143
|
+
*
|
|
1144
|
+
* @param current The current object.
|
|
1145
|
+
* @param withSliders Whether to take slider difficulty into account.
|
|
1146
|
+
*/
|
|
1147
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject, withSliders: boolean): number;
|
|
1148
|
+
private static calculateWideAngleAcuteness;
|
|
1149
|
+
static calculateAcuteAngleAcuteness(angle: number): number;
|
|
1150
|
+
private static highBpmBonus;
|
|
1151
|
+
private static calculateVectorAngleRepetition;
|
|
1152
|
+
}
|
|
1153
|
+
/**
|
|
1154
|
+
* An evaluator for calculating osu!droid tap skill.
|
|
1155
|
+
*/
|
|
1156
|
+
export declare abstract class DroidTapEvaluator {
|
|
1157
|
+
private static readonly minSpeedBonus;
|
|
1158
|
+
/**
|
|
1159
|
+
* Evaluates the difficulty of tapping the current object, based on:
|
|
1160
|
+
*
|
|
1161
|
+
* - time between pressing the previous and current object,
|
|
1162
|
+
* - distance between those objects,
|
|
1163
|
+
* - how easily they can be cheesed,
|
|
1164
|
+
* - and the strain time cap.
|
|
1165
|
+
*
|
|
1166
|
+
* @param current The current object.
|
|
1167
|
+
* @param considerCheesability Whether to consider cheesability.
|
|
1168
|
+
*/
|
|
1169
|
+
static evaluateDifficultyOf(current: DroidDifficultyHitObject, considerCheesability: boolean): number;
|
|
1170
|
+
private static highBpmBonus;
|
|
1171
|
+
}
|
|
1172
|
+
/**
|
|
1173
|
+
* Represents an osu!standard hit object with difficulty calculation values.
|
|
1174
|
+
*/
|
|
1175
|
+
export declare class OsuDifficultyHitObject extends DifficultyHitObject {
|
|
1176
|
+
/**
|
|
1177
|
+
* The speed strain generated by the hitobject.
|
|
1178
|
+
*/
|
|
1179
|
+
speedStrain: number;
|
|
1180
|
+
readonly normalizedRadius = 50;
|
|
1181
|
+
get smallCircleBonus(): number;
|
|
1182
|
+
get overallDifficulty(): number;
|
|
1183
|
+
protected readonly mode = Modes.Osu;
|
|
1184
|
+
}
|
|
1185
|
+
/**
|
|
1186
|
+
* An evaluator for calculating osu!standard agility aim difficulty.
|
|
1187
|
+
*/
|
|
1188
|
+
export declare abstract class OsuAgilityEvaluator {
|
|
1189
|
+
/**
|
|
1190
|
+
* Evaluates the difficulty of fast aiming the current object.
|
|
1191
|
+
*
|
|
1192
|
+
* @param current The current object.
|
|
1193
|
+
*/
|
|
1194
|
+
static evaluateDifficultyOf(current: OsuDifficultyHitObject): number;
|
|
1195
|
+
private static highBpmBonus;
|
|
1196
|
+
}
|
|
1197
|
+
/**
|
|
1198
|
+
* An evaluator for calculating osu!standard Flashlight skill.
|
|
1199
|
+
*/
|
|
1200
|
+
export declare abstract class OsuFlashlightEvaluator {
|
|
1201
|
+
private static readonly maxOpacityBonus;
|
|
1202
|
+
private static readonly hiddenBonus;
|
|
1203
|
+
private static readonly minVelocity;
|
|
1204
|
+
private static readonly sliderMultiplier;
|
|
1205
|
+
private static readonly minAngleMultiplier;
|
|
1206
|
+
/**
|
|
1207
|
+
* Evaluates the difficulty of memorizing and hitting the current object, based on:
|
|
1208
|
+
*
|
|
1209
|
+
* - distance between a number of previous objects and the current object,
|
|
1210
|
+
* - the visual opacity of the current object,
|
|
1211
|
+
* - the angle made by the current object,
|
|
1212
|
+
* - length and speed of the current object (for sliders),
|
|
1213
|
+
* - and whether Hidden mod is enabled.
|
|
1214
|
+
*
|
|
1215
|
+
* @param current The current object.
|
|
1216
|
+
* @param mods The mods used.
|
|
1217
|
+
*/
|
|
1218
|
+
static evaluateDifficultyOf(current: OsuDifficultyHitObject, mods: ModMap): number;
|
|
1219
|
+
}
|
|
1220
|
+
/**
|
|
1221
|
+
* An evaluator for calculating osu!standard flow aim difficulty.
|
|
1222
|
+
*/
|
|
1223
|
+
export declare abstract class OsuFlowAimEvaluator {
|
|
1224
|
+
private static readonly velocityChangeMultiplier;
|
|
1225
|
+
static evaluateDifficultyOf(current: OsuDifficultyHitObject, withSliders: boolean): number;
|
|
1226
|
+
private static calculateOverlapFactor;
|
|
1227
|
+
}
|
|
1228
|
+
/**
|
|
1229
|
+
* Evaluator for reading difficulty in osu!standard.
|
|
1230
|
+
*/
|
|
1231
|
+
export declare abstract class OsuReadingEvaluator {
|
|
1232
|
+
private static readonly readingWindowSize;
|
|
1233
|
+
private static readonly hiddenMultiplier;
|
|
1234
|
+
private static readonly densityMultiplier;
|
|
1235
|
+
private static readonly densityDifficultyBase;
|
|
1236
|
+
private static readonly preemptBalancingFactor;
|
|
1237
|
+
private static readonly preemptStartingPoint;
|
|
1238
|
+
private static readonly minimumAngleRelevancyTime;
|
|
1239
|
+
private static readonly maximumAngleRelevancyTime;
|
|
1240
|
+
/**
|
|
1241
|
+
* Evaluates the difficulty of reading the object.
|
|
1242
|
+
*/
|
|
1243
|
+
static evaluateDifficultyOf(current: OsuDifficultyHitObject, mods: ModMap): number;
|
|
1244
|
+
/**
|
|
1245
|
+
* Calculates the density difficulty of the current object and how hard it is to aim it because of it based on:
|
|
1246
|
+
*
|
|
1247
|
+
* - cursor velocity to the current object,
|
|
1248
|
+
* - how many times the current object's angle was repeated,
|
|
1249
|
+
* - density of objects visible when the current object appears, and
|
|
1250
|
+
* - density of objects visible when the current object needs to be clicked.
|
|
1251
|
+
*/
|
|
1252
|
+
private static calculateDensityDifficulty;
|
|
1253
|
+
/**
|
|
1254
|
+
* Calculates the difficulty of aiming the current object when the approach rate is very high based on:
|
|
1255
|
+
*
|
|
1256
|
+
* - cursor velocity to the current object,
|
|
1257
|
+
* - how many times the current object's angle was repeated, and
|
|
1258
|
+
* - how many milliseconds elapse between the approach circle appearing and touching the inner circle.
|
|
1259
|
+
*/
|
|
1260
|
+
private static calculatePreemptDifficulty;
|
|
1261
|
+
/**
|
|
1262
|
+
* Calculates the difficulty of aiming the current object when the Hidden mod is active based on:
|
|
1263
|
+
*
|
|
1264
|
+
* - cursor velocity to the current object,
|
|
1265
|
+
* - time the current object spends invisible,
|
|
1266
|
+
* - density of objects visible when the current object appears,
|
|
1267
|
+
* - density of objects visible when the current object needs to be clicked,
|
|
1268
|
+
* - how many times the current object's angle was repeated, and
|
|
1269
|
+
* - if the current object is perfectly stacked to the previous one.
|
|
1270
|
+
*/
|
|
1271
|
+
private static calculateHiddenDifficulty;
|
|
1272
|
+
private static getPastObjectDifficultyInfluence;
|
|
1273
|
+
/**
|
|
1274
|
+
* Returns a list of objects that are visible on screen at the point in time the current object becomes visible.
|
|
1275
|
+
*/
|
|
1276
|
+
private static retrievePastVisibleObjects;
|
|
1277
|
+
/**
|
|
1278
|
+
* Returns the density of objects visible at the point in time the current object needs to be clicked capped by the reading window.
|
|
1279
|
+
*/
|
|
1280
|
+
private static retrieveCurrentVisibleObjectDensity;
|
|
1281
|
+
/**
|
|
1282
|
+
* Returns a factor of how often the current object's angle has been repeated in a certain time frame.
|
|
1283
|
+
* It does this by checking the difference in angle between current and past objects and sums them based on a range of similarity.
|
|
1284
|
+
* https://www.desmos.com/calculator/eb057a4822
|
|
1285
|
+
*/
|
|
1286
|
+
private static getConstantAngleNerfFactor;
|
|
1287
|
+
/**
|
|
1288
|
+
* Returns a nerfing factor for when objects are very distant in time, affecting reading less.
|
|
1289
|
+
*/
|
|
1290
|
+
private static getTimeNerfFactor;
|
|
1291
|
+
private static highBpmBonus;
|
|
1292
|
+
}
|
|
1293
|
+
/**
|
|
1294
|
+
* An evaluator for calculating osu!standard Rhythm skill.
|
|
1295
|
+
*/
|
|
1296
|
+
export declare abstract class OsuRhythmEvaluator {
|
|
1297
|
+
private static readonly historyTimeMax;
|
|
1298
|
+
private static readonly historyObjectsMax;
|
|
1299
|
+
private static readonly rhythmOverallMultiplier;
|
|
1300
|
+
private static readonly rhythmRatioMultiplier;
|
|
1301
|
+
/**
|
|
1302
|
+
* Calculates a rhythm multiplier for the difficulty of the tap associated
|
|
1303
|
+
* with historic data of the current object.
|
|
1304
|
+
*
|
|
1305
|
+
* @param current The current object.
|
|
1306
|
+
*/
|
|
1307
|
+
static evaluateDifficultyOf(current: OsuDifficultyHitObject): number;
|
|
1308
|
+
private static getEffectiveRatio;
|
|
1309
|
+
}
|
|
1310
|
+
/**
|
|
1311
|
+
* An evaluator for calculating osu!standard snap aim difficulty.
|
|
1312
|
+
*/
|
|
1313
|
+
export declare abstract class OsuSnapAimEvaluator {
|
|
1314
|
+
private static readonly wideAngleMultiplier;
|
|
1315
|
+
private static readonly acuteAngleMultiplier;
|
|
1316
|
+
private static readonly sliderMultiplier;
|
|
1317
|
+
private static readonly velocityChangeMultiplier;
|
|
1318
|
+
private static readonly wiggleMultiplier;
|
|
1319
|
+
private static readonly angleRepetitionNoteLimit;
|
|
1320
|
+
private static readonly maximumRepetitionNerf;
|
|
1321
|
+
private static readonly maximumVectorInfluence;
|
|
1322
|
+
/**
|
|
1323
|
+
* Evaluates the difficulty of aiming the current object, based on:
|
|
1324
|
+
*
|
|
1325
|
+
* - cursor velocity to the current object,
|
|
1326
|
+
* - angle difficulty,
|
|
1327
|
+
* - sharp velocity increases,
|
|
1328
|
+
* - and slider difficulty.
|
|
1329
|
+
*
|
|
1330
|
+
* @param current The current object.
|
|
1331
|
+
* @param withSliders Whether to take slider difficulty into account.
|
|
1332
|
+
*/
|
|
1333
|
+
static evaluateDifficultyOf(current: OsuDifficultyHitObject, withSliders: boolean): number;
|
|
1334
|
+
private static calculateWideAngleAcuteness;
|
|
1335
|
+
static calculateAcuteAngleAcuteness(angle: number): number;
|
|
1336
|
+
private static highBpmBonus;
|
|
1337
|
+
private static calculateVectorAngleRepetition;
|
|
1338
|
+
}
|
|
1339
|
+
/**
|
|
1340
|
+
* An evaluator for calculating osu!standard speed skill.
|
|
1341
|
+
*/
|
|
1342
|
+
export declare abstract class OsuSpeedEvaluator {
|
|
1343
|
+
private static readonly minSpeedBonus;
|
|
1344
|
+
/**
|
|
1345
|
+
* Evaluates the difficulty of tapping the current object, based on:
|
|
1346
|
+
*
|
|
1347
|
+
* - time between pressing the previous and current object,
|
|
1348
|
+
* - and how easily they can be cheesed.
|
|
1349
|
+
*
|
|
1350
|
+
* @param current The current object.
|
|
1351
|
+
*/
|
|
1352
|
+
static evaluateDifficultyOf(current: OsuDifficultyHitObject): number;
|
|
1353
|
+
private static highBpmBonus;
|
|
1354
|
+
}
|
|
1355
|
+
/**
|
|
1356
|
+
* Holds data that can be used to calculate osu!standard performance points.
|
|
1357
|
+
*/
|
|
1358
|
+
export interface IOsuDifficultyAttributes extends IDifficultyAttributes {
|
|
1359
|
+
/**
|
|
1360
|
+
* The perceived approach rate **exclusive** of rate-adjusting mods (DT/HT/etc).
|
|
1361
|
+
*
|
|
1362
|
+
* Rate-adjusting mods don't directly affect the approach rate difficulty value, but have a perceived effect as a result of adjusting audio timing.
|
|
1363
|
+
*/
|
|
1364
|
+
approachRate: number;
|
|
1365
|
+
/**
|
|
1366
|
+
* The health drain rate of the beatmap.
|
|
1367
|
+
*/
|
|
1368
|
+
drainRate: number;
|
|
1369
|
+
/**
|
|
1370
|
+
* The difficulty corresponding to the speed skill.
|
|
1371
|
+
*/
|
|
1372
|
+
speedDifficulty: number;
|
|
1373
|
+
/**
|
|
1374
|
+
* The amount of strains that are considered difficult with respect to the speed skill.
|
|
1375
|
+
*/
|
|
1376
|
+
speedDifficultStrainCount: number;
|
|
1377
|
+
/**
|
|
1378
|
+
* Describes how much of {@link aimDifficultStrainCount} is contributed to by circles or sliders.
|
|
1379
|
+
*
|
|
1380
|
+
* A value closer to 0 indicates most of {@link aimDifficultStrainCount} is contributed by circles.
|
|
1381
|
+
*
|
|
1382
|
+
* A value closer to infinity indicates most of {@link aimDifficultStrainCount} is contributed by sliders.
|
|
1383
|
+
*/
|
|
1384
|
+
aimTopWeightedSliderFactor: number;
|
|
1385
|
+
/**
|
|
1386
|
+
* Describes how much of {@link speedDifficultStrainCount} is contributed to by circles or sliders.
|
|
1387
|
+
*
|
|
1388
|
+
* A value closer to 0 indicates most of {@link speedDifficultStrainCount} is contributed by circles.
|
|
1389
|
+
*
|
|
1390
|
+
* A value closer to infinity indicates most of {@link speedDifficultStrainCount} is contributed by sliders.
|
|
1391
|
+
*/
|
|
1392
|
+
speedTopWeightedSliderFactor: number;
|
|
1393
|
+
}
|
|
1394
|
+
/**
|
|
1395
|
+
* Holds data that can be used to calculate osu!standard performance points.
|
|
1396
|
+
*/
|
|
1397
|
+
export declare class OsuDifficultyAttributes extends DifficultyAttributes implements IOsuDifficultyAttributes {
|
|
1398
|
+
approachRate: number;
|
|
1399
|
+
drainRate: number;
|
|
1400
|
+
speedDifficulty: number;
|
|
1401
|
+
speedDifficultStrainCount: number;
|
|
1402
|
+
speedTopWeightedSliderFactor: number;
|
|
1403
|
+
constructor(cacheableAttributes?: CacheableDifficultyAttributes<IOsuDifficultyAttributes>);
|
|
1404
|
+
toString(): string;
|
|
1405
|
+
}
|
|
1406
|
+
/**
|
|
1407
|
+
* A difficulty calculator for osu!standard gamemode.
|
|
1408
|
+
*/
|
|
1409
|
+
export declare class OsuDifficultyCalculator extends DifficultyCalculator<OsuPlayableBeatmap, OsuDifficultyHitObject, OsuDifficultyAttributes> {
|
|
1410
|
+
constructor();
|
|
1411
|
+
retainDifficultyAdjustmentMods(mods: Mod[]): Mod[];
|
|
1412
|
+
protected createDifficultyAttributes(beatmap: Beatmap, playableBeatmap: PlayableBeatmap, skills: Skill[]): OsuDifficultyAttributes;
|
|
1413
|
+
protected createPlayableBeatmap(beatmap: Beatmap, mods?: ModMap): OsuPlayableBeatmap;
|
|
1414
|
+
protected createDifficultyHitObjects(beatmap: OsuPlayableBeatmap): OsuDifficultyHitObject[];
|
|
1415
|
+
protected createSkills(beatmap: OsuPlayableBeatmap): Skill[];
|
|
1416
|
+
protected createStrainPeakSkills(beatmap: OsuPlayableBeatmap): (Skill & IHasPeakDifficulty)[];
|
|
1417
|
+
private calculateAimDifficultyRating;
|
|
1418
|
+
private calculateDifficultyRating;
|
|
1419
|
+
private calculateStarRating;
|
|
1420
|
+
static sumCognitionDifficulty(reading: number, flashlight: number): number;
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* Represents the calculated performance of a score in osu!.
|
|
1424
|
+
*/
|
|
1425
|
+
export interface IOsuPerformanceAttributes extends IPerformanceAttributes {
|
|
1426
|
+
/**
|
|
1427
|
+
* The aim performance points.
|
|
1428
|
+
*/
|
|
1429
|
+
aim: number;
|
|
1430
|
+
/**
|
|
1431
|
+
* The speed performance points.
|
|
1432
|
+
*/
|
|
1433
|
+
speed: number;
|
|
1434
|
+
/**
|
|
1435
|
+
* The accuracy performance points.
|
|
1436
|
+
*/
|
|
1437
|
+
accuracy: number;
|
|
1438
|
+
/**
|
|
1439
|
+
* The flashlight performance points.
|
|
1440
|
+
*/
|
|
1441
|
+
flashlight: number;
|
|
1442
|
+
/**
|
|
1443
|
+
* The reading performance points.
|
|
1444
|
+
*/
|
|
1445
|
+
reading: number;
|
|
1446
|
+
}
|
|
1447
|
+
/**
|
|
1448
|
+
* A performance points calculator that calculates performance points for osu!standard gamemode.
|
|
1449
|
+
*/
|
|
1450
|
+
export declare class OsuPerformanceCalculator extends PerformanceCalculator<IOsuDifficultyAttributes, IOsuPerformanceAttributes> {
|
|
1451
|
+
static readonly finalMultiplier = 1.12;
|
|
1452
|
+
static readonly normExponent = 1.1;
|
|
1453
|
+
private greatWindow;
|
|
1454
|
+
private okWindow;
|
|
1455
|
+
private mehWindow;
|
|
1456
|
+
private approachRate;
|
|
1457
|
+
private overallDifficulty;
|
|
1458
|
+
private _effectiveMissCount;
|
|
1459
|
+
private speedDeviation;
|
|
1460
|
+
protected createPerformanceAttributes(): IOsuPerformanceAttributes;
|
|
1461
|
+
/**
|
|
1462
|
+
* Calculates the aim performance value of the beatmap.
|
|
1463
|
+
*/
|
|
1464
|
+
private calculateAimValue;
|
|
1465
|
+
/**
|
|
1466
|
+
* Calculates the speed performance value of the beatmap.
|
|
1467
|
+
*/
|
|
1468
|
+
private calculateSpeedValue;
|
|
1469
|
+
/**
|
|
1470
|
+
* Calculates the accuracy performance value of the beatmap.
|
|
1471
|
+
*/
|
|
1472
|
+
private calculateAccuracyValue;
|
|
1473
|
+
/**
|
|
1474
|
+
* Calculates the flashlight performance value of the beatmap.
|
|
1475
|
+
*/
|
|
1476
|
+
private calculateFlashlightValue;
|
|
1477
|
+
/**
|
|
1478
|
+
* Calculates the reading performance value of the beatmap.
|
|
1479
|
+
*/
|
|
1480
|
+
private calculateReadingValue;
|
|
1481
|
+
/**
|
|
1482
|
+
* Calculates a strain-based miss penalty.
|
|
1483
|
+
*
|
|
1484
|
+
* Strain-based miss penalty assumes that a player will miss on the hardest parts of a map,
|
|
1485
|
+
* so we use the amount of relatively difficult sections to adjust miss penalty
|
|
1486
|
+
* to make it more punishing on maps with lower amount of hard sections.
|
|
1487
|
+
*/
|
|
1488
|
+
private calculateMissPenalty;
|
|
1489
|
+
/**
|
|
1490
|
+
* Estimates a player's deviation on speed notes using {@link calculateDeviation}, assuming worst-case.
|
|
1491
|
+
*
|
|
1492
|
+
* Treats all speed notes as hit circles.
|
|
1493
|
+
*/
|
|
1494
|
+
private calculateSpeedDeviation;
|
|
1495
|
+
/**
|
|
1496
|
+
* Estimates the player's tap deviation based on the OD, given number of greats, oks, mehs and misses,
|
|
1497
|
+
* assuming the player's mean hit error is 0. The estimation is consistent in that two SS scores on the
|
|
1498
|
+
* same map with the same settings will always return the same deviation.
|
|
1499
|
+
*
|
|
1500
|
+
* Misses are ignored because they are usually due to misaiming.
|
|
1501
|
+
*
|
|
1502
|
+
* Greats and oks are assumed to follow a normal distribution, whereas mehs are assumed to follow a uniform distribution.
|
|
1503
|
+
*/
|
|
1504
|
+
private calculateDeviation;
|
|
1505
|
+
/**
|
|
1506
|
+
* Calculates multiplier for speed to account for improper tapping based on the deviation and speed difficulty.
|
|
1507
|
+
*
|
|
1508
|
+
* [Graph](https://www.desmos.com/calculator/dmogdhzofn)
|
|
1509
|
+
*/
|
|
1510
|
+
private calculateSpeedHighDeviationNerf;
|
|
1511
|
+
private calculateEstimatedSliderBreaks;
|
|
1512
|
+
/**
|
|
1513
|
+
* Calculates the amount of misses + sliderbreaks from combo.
|
|
1514
|
+
*/
|
|
1515
|
+
private calculateComboBasedEstimatedMissCount;
|
|
1516
|
+
private calculateTraceableBonus;
|
|
1517
|
+
private calculateRateAdjustedApproachRate;
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* Data class for variable length strain.
|
|
1521
|
+
*/
|
|
1522
|
+
declare class StrainPeak {
|
|
1523
|
+
readonly value: number;
|
|
1524
|
+
readonly sectionLength: number;
|
|
1525
|
+
constructor(value: number, sectionLength: number);
|
|
1526
|
+
compareTo(other: StrainPeak): number;
|
|
1527
|
+
}
|
|
1528
|
+
/**
|
|
1529
|
+
* A skill that evaluates strain over a variable length of time. A new strain peak is created for every
|
|
1530
|
+
* {@link DifficultyHitObject}.
|
|
1531
|
+
*/
|
|
1532
|
+
declare abstract class VariableLengthStrainSkill extends Skill implements IHasPeakDifficulty {
|
|
1533
|
+
/**
|
|
1534
|
+
* The weight by which each strain value decays.
|
|
1535
|
+
*/
|
|
1536
|
+
protected readonly decayWeight: number;
|
|
1537
|
+
/**
|
|
1538
|
+
* The maximum length of a strain section, in milliseconds.
|
|
1539
|
+
*/
|
|
1540
|
+
protected readonly maxSectionLength: number;
|
|
1541
|
+
/**
|
|
1542
|
+
* The number of {@link maxSectionLength} sections calculated such that enough of the difficulty value is preserved.
|
|
1543
|
+
*
|
|
1544
|
+
* This should be overridden if strains are ever used outside of {@link difficultyValue}, or if {@link difficultyValue}
|
|
1545
|
+
* is overridden to not use the default geometric sum.
|
|
1546
|
+
*
|
|
1547
|
+
* This should be removed in the future when a better memory-saving technique is implemented.
|
|
1548
|
+
*/
|
|
1549
|
+
protected get maxStoredSections(): number;
|
|
1550
|
+
private currentSectionPeak;
|
|
1551
|
+
private currentSectionBegin;
|
|
1552
|
+
private currentSectionEnd;
|
|
1553
|
+
private totalLength;
|
|
1554
|
+
private readonly strainPeaks;
|
|
1555
|
+
/**
|
|
1556
|
+
* The peaks of this skill in chronological order, used for graphing purposes.
|
|
1557
|
+
*
|
|
1558
|
+
* Unlike {@link strainPeaks}, this is never trimmed, as it does not contribute to {@link difficultyValue}.
|
|
1559
|
+
*/
|
|
1560
|
+
private readonly chronologicalPeaks;
|
|
1561
|
+
get peaks(): readonly TimedStrainPeak[];
|
|
1562
|
+
/**
|
|
1563
|
+
* Stores previous strains so that, if a difficult {@link DifficultyHitObject} is followed by an easier
|
|
1564
|
+
* {@link DifficultyHitObject}, the difficult one gets a full strain instead of being cut short.
|
|
1565
|
+
*/
|
|
1566
|
+
private readonly queuedStrains;
|
|
1567
|
+
static difficultyToPerformance(difficulty: number): number;
|
|
1568
|
+
/**
|
|
1569
|
+
* Obtains the live strain peaks for each {@link maxSectionLength} of the beatmap, including the
|
|
1570
|
+
* peak of the current section.
|
|
1571
|
+
*/
|
|
1572
|
+
get currentStrainPeaks(): StrainPeak[];
|
|
1573
|
+
difficultyValue(): number;
|
|
1574
|
+
/**
|
|
1575
|
+
* Returns the number of strains weighed against the top strain.
|
|
1576
|
+
*
|
|
1577
|
+
* The result is scaled by clock rate as it affects the total number of strains.
|
|
1578
|
+
*/
|
|
1579
|
+
countTopWeightedStrains(difficultyValue: number): number;
|
|
1580
|
+
protected processInternal(current: DifficultyHitObject): number;
|
|
1581
|
+
/**
|
|
1582
|
+
* Calculates the strain value at the {@link DifficultyHitObject}. This value is calculated with or without respect to
|
|
1583
|
+
* previous {@link DifficultyHitObject}s.
|
|
1584
|
+
*
|
|
1585
|
+
* @param current The {@link DifficultyHitObject} for which the strain value should be calculated.
|
|
1586
|
+
*/
|
|
1587
|
+
protected abstract strainValueAt(current: DifficultyHitObject): number;
|
|
1588
|
+
/**
|
|
1589
|
+
* Retrieves the peak strain at a point in time.
|
|
1590
|
+
*
|
|
1591
|
+
* @param time The time to retrieve the peak strain at.
|
|
1592
|
+
* @param current The current hit object.
|
|
1593
|
+
* @returns The peak strain.
|
|
1594
|
+
*/
|
|
1595
|
+
protected abstract calculateInitialStrain(time: number, current: DifficultyHitObject): number;
|
|
1596
|
+
/**
|
|
1597
|
+
* Fills the space between the end of the current section and the current {@link DifficultyHitObject}, if any.
|
|
1598
|
+
*
|
|
1599
|
+
* @param current The current {@link DifficultyHitObject}.
|
|
1600
|
+
*/
|
|
1601
|
+
private backfillPeaks;
|
|
1602
|
+
/**
|
|
1603
|
+
* Saves the current peak strain level to the list of strain peaks, which will be used to calculate an overall difficulty.
|
|
1604
|
+
*/
|
|
1605
|
+
private saveCurrentPeak;
|
|
1606
|
+
private startNewSectionFrom;
|
|
1607
|
+
private addStrainPeakInPlace;
|
|
1608
|
+
}
|
|
1609
|
+
/**
|
|
1610
|
+
* Represents the skill required to correctly aim at every object in the map with a uniform CircleSize and normalized distances.
|
|
1611
|
+
*/
|
|
1612
|
+
export declare class DroidAim extends VariableLengthStrainSkill {
|
|
1613
|
+
private currentStrain;
|
|
1614
|
+
private readonly skillMultiplierSnap;
|
|
1615
|
+
private readonly skillMultiplierAgility;
|
|
1616
|
+
private readonly skillMultiplierFlow;
|
|
1617
|
+
private readonly skillMultiplierTotal;
|
|
1618
|
+
private readonly combinedSnapNormExponent;
|
|
1619
|
+
/**
|
|
1620
|
+
* The number of sections with the highest strains, which the peak strain reductions will apply to.
|
|
1621
|
+
* This is done in order to decrease their impact on the overall difficulty of the beatmap.
|
|
1622
|
+
*/
|
|
1623
|
+
private readonly reducedSectionTime;
|
|
1624
|
+
/**
|
|
1625
|
+
* The baseline multiplier applied to the section with the biggest strain.
|
|
1626
|
+
*/
|
|
1627
|
+
private readonly reducedStrainBaseline;
|
|
1628
|
+
private readonly sliderStrains;
|
|
1629
|
+
private maxSliderStrain;
|
|
1630
|
+
readonly withSliders: boolean;
|
|
1631
|
+
constructor(mods: ModMap, withSliders: boolean);
|
|
1632
|
+
/**
|
|
1633
|
+
* Obtains the amount of sliders that are considered difficult in terms of relative strain.
|
|
1634
|
+
*/
|
|
1635
|
+
countDifficultSliders(): number;
|
|
1636
|
+
/**
|
|
1637
|
+
* Obtains the amount of sliders that are considered difficult in terms of relative strain, weighted by consistency.
|
|
1638
|
+
*
|
|
1639
|
+
* @param difficultyValue The final difficulty value.
|
|
1640
|
+
*/
|
|
1641
|
+
countTopWeightedSliders(difficultyValue: number): number;
|
|
1642
|
+
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
1643
|
+
protected calculateInitialStrain(time: number, current: DroidDifficultyHitObject): number;
|
|
1644
|
+
protected saveToHitObject(current: DroidDifficultyHitObject, difficulty: number): void;
|
|
1645
|
+
private calculateAdjustedDifficulty;
|
|
1646
|
+
private calculateTotalValue;
|
|
1647
|
+
/**
|
|
1648
|
+
* Converts the ratio of snap to flow into the probability of snapping or flowing.
|
|
1649
|
+
*
|
|
1650
|
+
* Constraints:
|
|
1651
|
+
* - `P(snap) + P(flow) = 1` (the object is always either snapped or flowed)
|
|
1652
|
+
* - `P(snap) = f(snap / flow)` and `P(flow) = f(flow/snap)` (i.e., snap and flow are symmetric and
|
|
1653
|
+
* reversible). This means `f(x) + f(1/x) = 1`
|
|
1654
|
+
* - `0 <= f(x) <= 1` (cannot have negative or greater than 100% probability of snapping or flowing)
|
|
1655
|
+
*
|
|
1656
|
+
* This logistic function is a solution, which fits nicely with the general idea of interpolation and
|
|
1657
|
+
* provides a tuneable constant.
|
|
1658
|
+
*
|
|
1659
|
+
* @param ratio The ratio.
|
|
1660
|
+
* @returns The probability.
|
|
1661
|
+
*/
|
|
1662
|
+
private calculateSnapFlowProbability;
|
|
1663
|
+
difficultyValue(): number;
|
|
1664
|
+
private getReducedStrainPeaks;
|
|
1665
|
+
private strainDecay;
|
|
1666
|
+
}
|
|
1667
|
+
/**
|
|
1668
|
+
* Used to processes strain values of difficulty hitobjects, keep track of strain levels caused by the processed objects
|
|
1669
|
+
* and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
|
|
1670
|
+
*/
|
|
1671
|
+
declare abstract class StrainSkill extends Skill implements IHasPeakDifficulty {
|
|
1672
|
+
/**
|
|
1673
|
+
* The number of sections with the highest strains, which the peak strain reductions will apply to.
|
|
1674
|
+
* This is done in order to decrease their impact on the overall difficulty of the map for this skill.
|
|
1675
|
+
*/
|
|
1676
|
+
protected readonly reducedSectionCount: number;
|
|
1677
|
+
/**
|
|
1678
|
+
* The baseline multiplier applied to the section with the biggest strain.
|
|
1679
|
+
*/
|
|
1680
|
+
protected readonly reducedSectionBaseline: number;
|
|
1681
|
+
protected readonly _objectStrains: number[];
|
|
1682
|
+
/**
|
|
1683
|
+
* The strains of hitobjects.
|
|
1684
|
+
*/
|
|
1685
|
+
get objectStrains(): readonly number[];
|
|
1686
|
+
protected readonly strainPeaks: number[];
|
|
1687
|
+
private readonly strainPeakTimes;
|
|
1688
|
+
get peaks(): readonly TimedStrainPeak[];
|
|
1689
|
+
private readonly sectionLength;
|
|
1690
|
+
private currentStrain;
|
|
1691
|
+
private currentSectionPeak;
|
|
1692
|
+
private currentSectionEnd;
|
|
1693
|
+
/**
|
|
1694
|
+
* Converts a difficulty value to a performance value.
|
|
1695
|
+
*
|
|
1696
|
+
* @param difficulty The difficulty value to convert.
|
|
1697
|
+
* @returns The performance value.
|
|
1698
|
+
*/
|
|
1699
|
+
static difficultyToPerformance(difficulty: number): number;
|
|
1700
|
+
/**
|
|
1701
|
+
* Obtains the live strain peaks for each {@link sectionLength} of the beatmap, including the peak of the current section.
|
|
1702
|
+
*/
|
|
1703
|
+
get currentStrainPeaks(): number[];
|
|
1704
|
+
/**
|
|
1705
|
+
* Returns the number of strains weighed against the top strain.
|
|
1706
|
+
*
|
|
1707
|
+
* The result is scaled by clock rate as it affects the total number of strains.
|
|
1708
|
+
*
|
|
1709
|
+
* @param difficultyValue The final difficulty value.
|
|
1710
|
+
*/
|
|
1711
|
+
countTopWeightedStrains(difficultyValue: number): number;
|
|
1712
|
+
protected processInternal(current: DifficultyHitObject): number;
|
|
1713
|
+
/**
|
|
1714
|
+
* Calculates the starting time of a strain section at an object.
|
|
1715
|
+
*
|
|
1716
|
+
* @param current The object at which the strain section starts.
|
|
1717
|
+
* @returns The start time of the strain section.
|
|
1718
|
+
*/
|
|
1719
|
+
protected calculateCurrentSectionStart(current: DifficultyHitObject): number;
|
|
1720
|
+
/**
|
|
1721
|
+
* Calculates the strain value at a hitobject.
|
|
1722
|
+
*
|
|
1723
|
+
* @param current The hitobject to calculate.
|
|
1724
|
+
*/
|
|
1725
|
+
protected abstract strainValueAt(current: DifficultyHitObject): number;
|
|
1726
|
+
/**
|
|
1727
|
+
* Retrieves the peak strain at a point in time.
|
|
1728
|
+
*
|
|
1729
|
+
* @param time The time to retrieve the peak strain at.
|
|
1730
|
+
* @param current The current hit object.
|
|
1731
|
+
* @returns The peak strain.
|
|
1732
|
+
*/
|
|
1733
|
+
protected abstract calculateInitialStrain(time: number, current: DifficultyHitObject): number;
|
|
1734
|
+
/**
|
|
1735
|
+
* Saves the current peak strain level to the list of strain peaks, which will be used to calculate an overall difficulty.
|
|
1736
|
+
*/
|
|
1737
|
+
private saveCurrentPeak;
|
|
1738
|
+
/**
|
|
1739
|
+
* Sets the initial strain level for a new section.
|
|
1740
|
+
*
|
|
1741
|
+
* @param time The beginning of the new section in milliseconds.
|
|
1742
|
+
* @param current The current hitobject.
|
|
1743
|
+
*/
|
|
1744
|
+
private startNewSectionFrom;
|
|
1745
|
+
}
|
|
1746
|
+
/**
|
|
1747
|
+
* Used to processes strain values of difficulty hitobjects, keep track of strain levels caused by the processed objects
|
|
1748
|
+
* and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
|
|
1749
|
+
*/
|
|
1750
|
+
declare abstract class DroidSkill extends StrainSkill {
|
|
1751
|
+
/**
|
|
1752
|
+
* The bonus multiplier that is given for a sequence of notes of equal difficulty.
|
|
1753
|
+
*/
|
|
1754
|
+
protected abstract readonly starsPerDouble: number;
|
|
1755
|
+
protected difficulty: number;
|
|
1756
|
+
process(current: DifficultyHitObject): void;
|
|
1757
|
+
difficultyValue(): number;
|
|
1758
|
+
/**
|
|
1759
|
+
* Gets the strain of a hitobject.
|
|
1760
|
+
*
|
|
1761
|
+
* @param current The hitobject to get the strain from.
|
|
1762
|
+
* @returns The strain of the hitobject.
|
|
1763
|
+
*/
|
|
1764
|
+
protected abstract getObjectStrain(current: DifficultyHitObject): number;
|
|
1765
|
+
protected calculateCurrentSectionStart(current: DifficultyHitObject): number;
|
|
1766
|
+
}
|
|
1767
|
+
/**
|
|
1768
|
+
* Represents the skill required to memorize and hit every object in a beatmap with the Flashlight mod enabled.
|
|
1769
|
+
*/
|
|
1770
|
+
export declare class DroidFlashlight extends DroidSkill {
|
|
1771
|
+
private readonly totalObjects;
|
|
1772
|
+
protected readonly reducedSectionCount = 0;
|
|
1773
|
+
protected readonly reducedSectionBaseline = 1;
|
|
1774
|
+
protected readonly starsPerDouble = 1;
|
|
1775
|
+
private readonly skillMultiplier;
|
|
1776
|
+
private currentFlashlightStrain;
|
|
1777
|
+
static difficultyToPerformance(difficulty: number): number;
|
|
1778
|
+
constructor(mods: ModMap, totalObjects: number);
|
|
1779
|
+
protected strainValueAt(current: DroidDifficultyHitObject): number;
|
|
1780
|
+
protected calculateInitialStrain(time: number, current: DifficultyHitObject): number;
|
|
1781
|
+
protected getObjectStrain(): number;
|
|
1782
|
+
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
1783
|
+
difficultyValue(): number;
|
|
1784
|
+
private calculateAdjustedDifficulty;
|
|
1785
|
+
private strainDecay;
|
|
1786
|
+
}
|
|
1787
|
+
/**
|
|
1788
|
+
* A skill that calculates the difficulty of {@link DifficultyHitObject}s using harmonic summation.
|
|
1789
|
+
*/
|
|
1790
|
+
declare abstract class HarmonicSkill extends Skill implements IHasPeakDifficulty {
|
|
1791
|
+
private _noteWeightSum;
|
|
1792
|
+
private _objectTimes;
|
|
1793
|
+
/**
|
|
1794
|
+
* The sum of note weights, calculated during summation.
|
|
1795
|
+
*
|
|
1796
|
+
* Required for any calculations that normalizes the difficulty value.
|
|
1797
|
+
*/
|
|
1798
|
+
protected get noteWeightSum(): number;
|
|
1799
|
+
/**
|
|
1800
|
+
* The start times of {@link DifficultyHitObject}s, populated by {@link HarmonicSkill.process}.
|
|
1801
|
+
*
|
|
1802
|
+
* Indices correspond to {@link objectDifficulties}.
|
|
1803
|
+
*/
|
|
1804
|
+
protected get objectTimes(): readonly number[];
|
|
1805
|
+
/**
|
|
1806
|
+
* Scaling factor applied as `x / (i + 1)`, where `x` is the skill's {@link harmonicScale} and `i`
|
|
1807
|
+
* is the index of the {@link DifficultyHitObject} being processed.
|
|
1808
|
+
*
|
|
1809
|
+
* A higher value increases the influence of the hardest {@link DifficultyHitObject}s during summation.
|
|
1810
|
+
*/
|
|
1811
|
+
protected readonly harmonicScale: number;
|
|
1812
|
+
/**
|
|
1813
|
+
* An exponent that controls the rate of which decay increases as the index increases.
|
|
1814
|
+
*
|
|
1815
|
+
* Values closer to 1 decay faster, whilst lower values give more weight to easier {@link DifficultyHitObject}s.
|
|
1816
|
+
*/
|
|
1817
|
+
protected readonly decayExponent: number;
|
|
1818
|
+
get peaks(): readonly TimedStrainPeak[];
|
|
1819
|
+
static difficultyToPerformance(difficulty: number): number;
|
|
1820
|
+
difficultyValue(): number;
|
|
1821
|
+
/**
|
|
1822
|
+
* Calculates the amount of object difficulties weighed against the top object difficulty.
|
|
1823
|
+
*
|
|
1824
|
+
* @param difficultyValue The final difficulty value.
|
|
1825
|
+
*/
|
|
1826
|
+
countTopWeightedObjectDifficulties(difficultyValue: number): number;
|
|
1827
|
+
/**
|
|
1828
|
+
* Transforms the difficulties of {@link DifficultyHitObject}s before they are summed together.
|
|
1829
|
+
*
|
|
1830
|
+
* This can be used to decrease weight of certain {@link DifficultyHitObject}s based on a skill-specific criteria.
|
|
1831
|
+
*
|
|
1832
|
+
* @param difficulties The difficulties of {@link DifficultyHitObject}s to transform.
|
|
1833
|
+
*/
|
|
1834
|
+
protected applyDifficultyTransformation(difficulties: number[]): void;
|
|
1835
|
+
process(current: DifficultyHitObject): void;
|
|
1836
|
+
protected processInternal(current: DifficultyHitObject): number;
|
|
1837
|
+
/**
|
|
1838
|
+
* Calculates the difficulty value of a {@link DifficultyHitObject}. This value is calculated with or without respect to previous objects.
|
|
1839
|
+
*
|
|
1840
|
+
* @param current The {@link DifficultyHitObject} for which the difficulty value should be calculated.
|
|
1841
|
+
*/
|
|
1842
|
+
protected abstract objectDifficultyOf(current: DifficultyHitObject): number;
|
|
1843
|
+
}
|
|
1844
|
+
/**
|
|
1845
|
+
* Represents the skill required to read every object in the beatmap.
|
|
1846
|
+
*/
|
|
1847
|
+
export declare class DroidReading extends HarmonicSkill {
|
|
1848
|
+
private readonly clockRate;
|
|
1849
|
+
private readonly hitObjects;
|
|
1850
|
+
private currentDifficulty;
|
|
1851
|
+
private readonly skillMultiplier;
|
|
1852
|
+
private readonly difficultyDecayBase;
|
|
1853
|
+
constructor(mods: ModMap, clockRate: number, hitObjects: readonly PlaceableHitObject[]);
|
|
1854
|
+
countTopWeightedObjectDifficulties(difficultyValue: number): number;
|
|
1855
|
+
protected objectDifficultyOf(current: DroidDifficultyHitObject): number;
|
|
1856
|
+
protected applyDifficultyTransformation(difficulties: number[]): void;
|
|
1857
|
+
protected saveToHitObject(current: DroidDifficultyHitObject, difficulty: number): void;
|
|
1858
|
+
private calculateAdjustedDifficulty;
|
|
1859
|
+
private calculateReducedNoteCount;
|
|
1860
|
+
private difficultyDecay;
|
|
1861
|
+
}
|
|
1862
|
+
/**
|
|
1863
|
+
* Represents the skill required to properly follow a beatmap's rhythm.
|
|
1864
|
+
*/
|
|
1865
|
+
export declare class DroidRhythm extends HarmonicSkill {
|
|
1866
|
+
protected readonly harmonicScale = 25;
|
|
1867
|
+
protected readonly decayExponent = 0.8;
|
|
1868
|
+
private readonly skillMultiplier;
|
|
1869
|
+
private readonly strainDecayBase;
|
|
1870
|
+
private currentRhythmDifficulty;
|
|
1871
|
+
private currentRhythmMultiplier;
|
|
1872
|
+
private readonly useSliderAccuracy;
|
|
1873
|
+
constructor(mods: ModMap);
|
|
1874
|
+
protected objectDifficultyOf(current: DroidDifficultyHitObject): number;
|
|
1875
|
+
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
1876
|
+
private strainDecay;
|
|
1877
|
+
}
|
|
1878
|
+
/**
|
|
1879
|
+
* Represents the skill required to press keys or tap with regards to keeping up with the speed at which objects need to be hit.
|
|
1880
|
+
*/
|
|
1881
|
+
export declare class DroidTap extends HarmonicSkill {
|
|
1882
|
+
protected readonly harmonicScale = 20;
|
|
1883
|
+
private readonly skillMultiplier;
|
|
1884
|
+
private readonly strainDecayBase;
|
|
1885
|
+
private currentTapDifficulty;
|
|
1886
|
+
private currentRhythmMultiplier;
|
|
1887
|
+
private readonly sliderDifficulties;
|
|
1888
|
+
private maxDifficulty;
|
|
1889
|
+
readonly considerCheesability: boolean;
|
|
1890
|
+
constructor(mods: ModMap, considerCheesability: boolean);
|
|
1891
|
+
/**
|
|
1892
|
+
* The amount of notes that are relevant to the difficulty.
|
|
1893
|
+
*/
|
|
1894
|
+
relevantNoteCount(): number;
|
|
1895
|
+
/**
|
|
1896
|
+
* Obtains the amount of sliders that are considered difficult in terms of relative difficulty, weighted by consistency.
|
|
1897
|
+
*
|
|
1898
|
+
* @param difficultyValue The final difficulty value.
|
|
1899
|
+
*/
|
|
1900
|
+
countTopWeightedSliders(difficultyValue: number): number;
|
|
1901
|
+
protected objectDifficultyOf(current: DroidDifficultyHitObject): number;
|
|
1902
|
+
protected saveToHitObject(current: DroidDifficultyHitObject): void;
|
|
1903
|
+
private strainDecay;
|
|
1904
|
+
}
|
|
1905
|
+
/**
|
|
1906
|
+
* Represents the skill required to correctly aim at every object in the map with a uniform CircleSize and normalized distances.
|
|
1907
|
+
*/
|
|
1908
|
+
export declare class OsuAim extends VariableLengthStrainSkill {
|
|
1909
|
+
private currentStrain;
|
|
1910
|
+
private readonly skillMultiplierSnap;
|
|
1911
|
+
private readonly skillMultiplierAgility;
|
|
1912
|
+
private readonly skillMultiplierFlow;
|
|
1913
|
+
private readonly skillMultiplierTotal;
|
|
1914
|
+
private readonly combinedSnapNormExponent;
|
|
1915
|
+
/**
|
|
1916
|
+
* The number of sections with the highest strains, which the peak strain reductions will apply to.
|
|
1917
|
+
* This is done in order to decrease their impact on the overall difficulty of the beatmap.
|
|
1918
|
+
*/
|
|
1919
|
+
private readonly reducedSectionTime;
|
|
1920
|
+
/**
|
|
1921
|
+
* The baseline multiplier applied to the section with the biggest strain.
|
|
1922
|
+
*/
|
|
1923
|
+
private readonly reducedStrainBaseline;
|
|
1924
|
+
private readonly sliderStrains;
|
|
1925
|
+
private maxSliderStrain;
|
|
1926
|
+
readonly withSliders: boolean;
|
|
1927
|
+
constructor(mods: ModMap, withSliders: boolean);
|
|
1928
|
+
/**
|
|
1929
|
+
* Obtains the amount of sliders that are considered difficult in terms of relative strain.
|
|
1930
|
+
*/
|
|
1931
|
+
countDifficultSliders(): number;
|
|
1932
|
+
/**
|
|
1933
|
+
* Obtains the amount of sliders that are considered difficult in terms of relative strain, weighted by consistency.
|
|
1934
|
+
*
|
|
1935
|
+
* @param difficultyValue The final difficulty value.
|
|
1936
|
+
*/
|
|
1937
|
+
countTopWeightedSliders(difficultyValue: number): number;
|
|
1938
|
+
protected strainValueAt(current: OsuDifficultyHitObject): number;
|
|
1939
|
+
protected calculateInitialStrain(time: number, current: OsuDifficultyHitObject): number;
|
|
1940
|
+
protected saveToHitObject(current: OsuDifficultyHitObject): void;
|
|
1941
|
+
private calculateAdjustedDifficulty;
|
|
1942
|
+
private calculateTotalValue;
|
|
1943
|
+
/**
|
|
1944
|
+
* Converts the ratio of snap to flow into the probability of snapping or flowing.
|
|
1945
|
+
*
|
|
1946
|
+
* Constraints:
|
|
1947
|
+
* - `P(snap) + P(flow) = 1` (the object is always either snapped or flowed)
|
|
1948
|
+
* - `P(snap) = f(snap / flow)` and `P(flow) = f(flow/snap)` (i.e., snap and flow are symmetric and
|
|
1949
|
+
* reversible). This means `f(x) + f(1/x) = 1`
|
|
1950
|
+
* - `0 <= f(x) <= 1` (cannot have negative or greater than 100% probability of snapping or flowing)
|
|
1951
|
+
*
|
|
1952
|
+
* This logistic function is a solution, which fits nicely with the general idea of interpolation and
|
|
1953
|
+
* provides a tuneable constant.
|
|
1954
|
+
*
|
|
1955
|
+
* @param ratio The ratio.
|
|
1956
|
+
* @returns The probability.
|
|
1957
|
+
*/
|
|
1958
|
+
private calculateSnapFlowProbability;
|
|
1959
|
+
difficultyValue(): number;
|
|
1960
|
+
private getReducedStrainPeaks;
|
|
1961
|
+
private strainDecay;
|
|
1962
|
+
}
|
|
1963
|
+
/**
|
|
1964
|
+
* Used to processes strain values of difficulty hitobjects, keep track of strain levels caused by the processed objects
|
|
1965
|
+
* and to calculate a final difficulty value representing the difficulty of hitting all the processed objects.
|
|
1966
|
+
*/
|
|
1967
|
+
declare abstract class OsuSkill extends StrainSkill {
|
|
1968
|
+
/**
|
|
1969
|
+
* The weight by which each strain value decays.
|
|
1970
|
+
*/
|
|
1971
|
+
protected abstract readonly decayWeight: number;
|
|
1972
|
+
protected difficulty: number;
|
|
1973
|
+
difficultyValue(): number;
|
|
1974
|
+
}
|
|
1975
|
+
/**
|
|
1976
|
+
* Represents the skill required to memorize and hit every object in a beatmap with the Flashlight mod enabled.
|
|
1977
|
+
*/
|
|
1978
|
+
export declare class OsuFlashlight extends OsuSkill {
|
|
1979
|
+
private readonly totalObjects;
|
|
1980
|
+
protected readonly reducedSectionCount = 0;
|
|
1981
|
+
protected readonly reducedSectionBaseline = 1;
|
|
1982
|
+
protected readonly decayWeight = 1;
|
|
1983
|
+
private currentFlashlightStrain;
|
|
1984
|
+
private readonly skillMultiplier;
|
|
1985
|
+
static difficultyToPerformance(difficulty: number): number;
|
|
1986
|
+
constructor(mods: ModMap, totalObjects: number);
|
|
1987
|
+
difficultyValue(): number;
|
|
1988
|
+
protected strainValueAt(current: OsuDifficultyHitObject): number;
|
|
1989
|
+
protected calculateInitialStrain(time: number, current: OsuDifficultyHitObject): number;
|
|
1990
|
+
protected saveToHitObject(current: OsuDifficultyHitObject): void;
|
|
1991
|
+
private calculateAdjustedDifficulty;
|
|
1992
|
+
private strainDecay;
|
|
1993
|
+
}
|
|
1994
|
+
/**
|
|
1995
|
+
* Represents the skill required to read every object in the beatmap.
|
|
1996
|
+
*/
|
|
1997
|
+
export declare class OsuReading extends HarmonicSkill {
|
|
1998
|
+
private readonly clockRate;
|
|
1999
|
+
private readonly hitObjects;
|
|
2000
|
+
private currentDifficulty;
|
|
2001
|
+
private readonly skillMultiplier;
|
|
2002
|
+
private readonly difficultyDecayBase;
|
|
2003
|
+
constructor(mods: ModMap, clockRate: number, hitObjects: readonly PlaceableHitObject[]);
|
|
2004
|
+
countTopWeightedObjectDifficulties(difficultyValue: number): number;
|
|
2005
|
+
protected objectDifficultyOf(current: OsuDifficultyHitObject): number;
|
|
2006
|
+
protected applyDifficultyTransformation(difficulties: number[]): void;
|
|
2007
|
+
protected saveToHitObject(current: DifficultyHitObject, difficulty: number): void;
|
|
2008
|
+
private calculateAdjustedDifficulty;
|
|
2009
|
+
private calculateReducedNoteCount;
|
|
2010
|
+
private difficultyDecay;
|
|
2011
|
+
}
|
|
2012
|
+
/**
|
|
2013
|
+
* Represents the skill required to press keys or tap with regards to keeping up with the speed at which objects need to be hit.
|
|
2014
|
+
*/
|
|
2015
|
+
export declare class OsuSpeed extends HarmonicSkill {
|
|
2016
|
+
protected readonly harmonicScale = 20;
|
|
2017
|
+
private currentDifficulty;
|
|
2018
|
+
private currentRhythm;
|
|
2019
|
+
private readonly skillMultiplier;
|
|
2020
|
+
private readonly strainDecayBase;
|
|
2021
|
+
private readonly sliderDifficulties;
|
|
2022
|
+
private maxDifficulty;
|
|
2023
|
+
/**
|
|
2024
|
+
* The amount of notes that are relevant to the difficulty.
|
|
2025
|
+
*/
|
|
2026
|
+
relevantNoteCount(): number;
|
|
2027
|
+
/**
|
|
2028
|
+
* Obtains the amount of sliders that are considered difficult in terms of relative difficulty, weighted by consistency.
|
|
2029
|
+
*
|
|
2030
|
+
* @param difficultyValue The final difficulty value.
|
|
2031
|
+
*/
|
|
2032
|
+
countTopWeightedSliders(difficultyValue: number): number;
|
|
2033
|
+
protected objectDifficultyOf(current: OsuDifficultyHitObject): number;
|
|
2034
|
+
protected saveToHitObject(current: OsuDifficultyHitObject): void;
|
|
2035
|
+
private calculateAdjustedDifficulty;
|
|
2036
|
+
private strainDecay;
|
|
2037
|
+
}
|
|
2038
|
+
export {};
|