diff --git a/src/com/rian/osu/difficulty/attributes/DroidDifficultyAttributes.kt b/src/com/rian/osu/difficulty/attributes/DroidDifficultyAttributes.kt index 36c8725ad..050745352 100644 --- a/src/com/rian/osu/difficulty/attributes/DroidDifficultyAttributes.kt +++ b/src/com/rian/osu/difficulty/attributes/DroidDifficultyAttributes.kt @@ -61,6 +61,12 @@ class DroidDifficultyAttributes : DifficultyAttributes() { @JvmField var visualDifficultStrainCount = 0.0 + /** + * The average delta time of speed objects. + */ + @JvmField + var averageSpeedDeltaTime = 0.0 + /** * Possible sections at which the player can use three fingers on. */ @@ -92,4 +98,14 @@ class DroidDifficultyAttributes : DifficultyAttributes() { */ @JvmField var visualSliderFactor = 1.0 + + /** + * Describes how much of tap difficulty is contributed by notes that are "vibroable". + * + * A value closer to 1 indicates most tap difficulty is contributed by notes that are not "vibroable". + * + * A value closer to 0 indicates most tap difficulty is contributed by notes that are "vibroable". + */ + @JvmField + var vibroFactor = 1.0 } \ No newline at end of file diff --git a/src/com/rian/osu/difficulty/calculator/DroidDifficultyCalculator.kt b/src/com/rian/osu/difficulty/calculator/DroidDifficultyCalculator.kt index 76c0ef1c0..bc899c77e 100644 --- a/src/com/rian/osu/difficulty/calculator/DroidDifficultyCalculator.kt +++ b/src/com/rian/osu/difficulty/calculator/DroidDifficultyCalculator.kt @@ -72,6 +72,15 @@ class DroidDifficultyCalculator : DifficultyCalculator 0) { + val tapSkillVibro = DroidTap(mods, true, averageSpeedDeltaTime) + + objects.forEach { o -> tapSkillVibro.process(o) } + + vibroFactor = calculateRating(tapSkillVibro) / tapDifficulty + } } var firstObjectIndex = 0 @@ -253,7 +262,7 @@ class DroidDifficultyCalculator : DifficultyCalculator() + /** * Gets the amount of notes that are relevant to the difficulty. */ @@ -44,15 +51,38 @@ class DroidTap( fold(0.0) { acc, d -> acc + 1 / (1 + exp(-(d / maxStrain * 12 - 6))) } } + /** + * Gets the delta time relevant to the difficulty. + */ + fun relevantDeltaTime() = objectStrains.run { + if (isEmpty()) { + return 0.0 + } + + val maxStrain = max() + if (maxStrain == 0.0) { + return 0.0 + } + + objectDeltaTimes.foldIndexed(0.0) { i, acc, d -> + acc + d / (1 + exp(-(this[i] / maxStrain * 25 - 20))) + } / fold(0.0) { acc, d -> + acc + 1 / (1 + exp(-(d / maxStrain * 25 - 20))) + } + } + override fun strainValueAt(current: DroidDifficultyHitObject): Double { currentStrain *= strainDecay(current.strainTime) - currentStrain += DroidTapEvaluator.evaluateDifficultyOf(current, considerCheesability) * skillMultiplier + currentStrain += DroidTapEvaluator.evaluateDifficultyOf( + current, considerCheesability, strainTimeCap + ) * skillMultiplier currentRhythm = current.rhythmMultiplier val totalStrain = currentStrain * currentRhythm objectStrains.add(totalStrain) + objectDeltaTimes.add(current.deltaTime) return totalStrain }