Skip to content

Commit

Permalink
Add slider accuracy rhythm calculation to osu!droid difficulty calcul…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
Rian8337 committed Feb 4, 2025
1 parent dd4624e commit a8fb95c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
23 changes: 13 additions & 10 deletions src/com/rian/osu/difficulty/evaluators/DroidRhythmEvaluator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ object DroidRhythmEvaluator {
* with historic data of the current object.
*
* @param current The current object.
* @param useSliderAccuracy Whether to use slider accuracy.
*/
@JvmStatic
fun evaluateDifficultyOf(current: DroidDifficultyHitObject): Double {
fun evaluateDifficultyOf(current: DroidDifficultyHitObject, useSliderAccuracy: Boolean): Double {
if (
current.obj is Spinner ||
// Exclude overlapping objects that can be tapped at once.
Expand Down Expand Up @@ -100,16 +101,18 @@ object DroidRhythmEvaluator {
// Island is still progressing, count size.
island.addDelta(currentDelta.toInt())
} else {
// BPM change is into slider, this is easy acc window.
if (currentObject.obj is Slider) {
effectiveRatio /= 8
}
if (!useSliderAccuracy) {
// BPM change is into slider, this is easy acc window.
if (currentObject.obj is Slider) {
effectiveRatio /= 8
}

// Bpm change was from a slider, this is easier typically than circle -> circle
// Unintentional side effect is that bursts with kicksliders at the ends might have lower difficulty
// than bursts without sliders
if (prevObject.obj is Slider) {
effectiveRatio *= 0.3
// Bpm change was from a slider, this is easier typically than circle -> circle
// Unintentional side effect is that bursts with kicksliders at the ends might have lower difficulty
// than bursts without sliders
if (prevObject.obj is Slider) {
effectiveRatio *= 0.3
}
}

// Repeated island polarity (2 -> 4, 3 -> 5)
Expand Down
5 changes: 4 additions & 1 deletion src/com/rian/osu/difficulty/skills/DroidRhythm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.rian.osu.difficulty.skills
import com.rian.osu.difficulty.DroidDifficultyHitObject
import com.rian.osu.difficulty.evaluators.DroidRhythmEvaluator
import com.rian.osu.mods.Mod
import com.rian.osu.mods.ModScoreV2
import kotlin.math.pow

/**
Expand All @@ -20,8 +21,10 @@ class DroidRhythm(
private var currentStrain = 0.0
private val strainDecayBase = 0.3

private val useSliderAccuracy = mods.any { it is ModScoreV2 }

override fun strainValueAt(current: DroidDifficultyHitObject): Double {
current.rhythmMultiplier = DroidRhythmEvaluator.evaluateDifficultyOf(current)
current.rhythmMultiplier = DroidRhythmEvaluator.evaluateDifficultyOf(current, useSliderAccuracy)

currentStrain *= strainDecay(current.deltaTime)
currentStrain += current.rhythmMultiplier - 1
Expand Down

0 comments on commit a8fb95c

Please sign in to comment.