mirror of
https://github.com/ppy/osu.git
synced 2025-02-12 04:12:56 +08:00
Rename Colour
/ Rhythm
related fields and classes
This commit is contained in:
parent
f3c17f1c2b
commit
fa844b0ebc
@ -34,8 +34,8 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Evaluators
|
|||||||
|
|
||||||
var previousHitObject = (TaikoDifficultyHitObject)current.Previous(1);
|
var previousHitObject = (TaikoDifficultyHitObject)current.Previous(1);
|
||||||
|
|
||||||
double currentRatio = current.Rhythm.Ratio;
|
double currentRatio = current.RhythmData.Ratio;
|
||||||
double previousRatio = previousHitObject.Rhythm.Ratio;
|
double previousRatio = previousHitObject.RhythmData.Ratio;
|
||||||
|
|
||||||
// A consistent interval is defined as the percentage difference between the two rhythmic ratios with the margin of error.
|
// A consistent interval is defined as the percentage difference between the two rhythmic ratios with the margin of error.
|
||||||
if (Math.Abs(1 - currentRatio / previousRatio) <= threshold)
|
if (Math.Abs(1 - currentRatio / previousRatio) <= threshold)
|
||||||
@ -61,17 +61,17 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Evaluators
|
|||||||
public static double EvaluateDifficultyOf(DifficultyHitObject hitObject)
|
public static double EvaluateDifficultyOf(DifficultyHitObject hitObject)
|
||||||
{
|
{
|
||||||
var taikoObject = (TaikoDifficultyHitObject)hitObject;
|
var taikoObject = (TaikoDifficultyHitObject)hitObject;
|
||||||
TaikoDifficultyHitObjectColour colour = taikoObject.Colour;
|
TaikoColourData colourData = taikoObject.ColourData;
|
||||||
double difficulty = 0.0d;
|
double difficulty = 0.0d;
|
||||||
|
|
||||||
if (colour.MonoStreak?.FirstHitObject == hitObject) // Difficulty for MonoStreak
|
if (colourData.MonoStreak?.FirstHitObject == hitObject) // Difficulty for MonoStreak
|
||||||
difficulty += evaluateMonoStreakDifficulty(colour.MonoStreak);
|
difficulty += evaluateMonoStreakDifficulty(colourData.MonoStreak);
|
||||||
|
|
||||||
if (colour.AlternatingMonoPattern?.FirstHitObject == hitObject) // Difficulty for AlternatingMonoPattern
|
if (colourData.AlternatingMonoPattern?.FirstHitObject == hitObject) // Difficulty for AlternatingMonoPattern
|
||||||
difficulty += evaluateAlternatingMonoPatternDifficulty(colour.AlternatingMonoPattern);
|
difficulty += evaluateAlternatingMonoPatternDifficulty(colourData.AlternatingMonoPattern);
|
||||||
|
|
||||||
if (colour.RepeatingHitPattern?.FirstHitObject == hitObject) // Difficulty for RepeatingHitPattern
|
if (colourData.RepeatingHitPattern?.FirstHitObject == hitObject) // Difficulty for RepeatingHitPattern
|
||||||
difficulty += evaluateRepeatingHitPatternsDifficulty(colour.RepeatingHitPattern);
|
difficulty += evaluateRepeatingHitPatternsDifficulty(colourData.RepeatingHitPattern);
|
||||||
|
|
||||||
double consistencyPenalty = consistentRatioPenalty(taikoObject);
|
double consistencyPenalty = consistentRatioPenalty(taikoObject);
|
||||||
difficulty *= consistencyPenalty;
|
difficulty *= consistencyPenalty;
|
||||||
|
@ -18,21 +18,21 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Evaluators
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static double EvaluateDifficultyOf(DifficultyHitObject hitObject, double hitWindow)
|
public static double EvaluateDifficultyOf(DifficultyHitObject hitObject, double hitWindow)
|
||||||
{
|
{
|
||||||
TaikoDifficultyHitObjectRhythm rhythm = ((TaikoDifficultyHitObject)hitObject).Rhythm;
|
TaikoRhythmData rhythmData = ((TaikoDifficultyHitObject)hitObject).RhythmData;
|
||||||
double difficulty = 0.0d;
|
double difficulty = 0.0d;
|
||||||
|
|
||||||
double sameRhythm = 0;
|
double sameRhythm = 0;
|
||||||
double samePattern = 0;
|
double samePattern = 0;
|
||||||
double intervalPenalty = 0;
|
double intervalPenalty = 0;
|
||||||
|
|
||||||
if (rhythm.SameRhythmGroupedHitObjects?.FirstHitObject == hitObject) // Difficulty for SameRhythmGroupedHitObjects
|
if (rhythmData.SameRhythmGroupedHitObjects?.FirstHitObject == hitObject) // Difficulty for SameRhythmGroupedHitObjects
|
||||||
{
|
{
|
||||||
sameRhythm += 10.0 * evaluateDifficultyOf(rhythm.SameRhythmGroupedHitObjects, hitWindow);
|
sameRhythm += 10.0 * evaluateDifficultyOf(rhythmData.SameRhythmGroupedHitObjects, hitWindow);
|
||||||
intervalPenalty = repeatedIntervalPenalty(rhythm.SameRhythmGroupedHitObjects, hitWindow);
|
intervalPenalty = repeatedIntervalPenalty(rhythmData.SameRhythmGroupedHitObjects, hitWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rhythm.SamePatternsGroupedHitObjects?.FirstHitObject == hitObject) // Difficulty for SamePatternsGroupedHitObjects
|
if (rhythmData.SamePatternsGroupedHitObjects?.FirstHitObject == hitObject) // Difficulty for SamePatternsGroupedHitObjects
|
||||||
samePattern += 1.15 * ratioDifficulty(rhythm.SamePatternsGroupedHitObjects.IntervalRatio);
|
samePattern += 1.15 * ratioDifficulty(rhythmData.SamePatternsGroupedHitObjects.IntervalRatio);
|
||||||
|
|
||||||
difficulty += Math.Max(sameRhythm, samePattern) * intervalPenalty;
|
difficulty += Math.Max(sameRhythm, samePattern) * intervalPenalty;
|
||||||
|
|
||||||
|
@ -55,8 +55,8 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Evaluators
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private static int availableFingersFor(TaikoDifficultyHitObject hitObject)
|
private static int availableFingersFor(TaikoDifficultyHitObject hitObject)
|
||||||
{
|
{
|
||||||
DifficultyHitObject? previousColourChange = hitObject.Colour.PreviousColourChange;
|
DifficultyHitObject? previousColourChange = hitObject.ColourData.PreviousColourChange;
|
||||||
DifficultyHitObject? nextColourChange = hitObject.Colour.NextColourChange;
|
DifficultyHitObject? nextColourChange = hitObject.ColourData.NextColourChange;
|
||||||
|
|
||||||
if (previousColourChange != null && hitObject.StartTime - previousColourChange.StartTime < 300)
|
if (previousColourChange != null && hitObject.StartTime - previousColourChange.StartTime < 300)
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stores colour compression information for a <see cref="TaikoDifficultyHitObject"/>.
|
/// Stores colour compression information for a <see cref="TaikoDifficultyHitObject"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TaikoDifficultyHitObjectColour
|
public class TaikoColourData
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The <see cref="MonoStreak"/> that encodes this note.
|
/// The <see cref="MonoStreak"/> that encodes this note.
|
@ -14,8 +14,8 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
|
|||||||
public static class TaikoColourDifficultyPreprocessor
|
public static class TaikoColourDifficultyPreprocessor
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Processes and encodes a list of <see cref="TaikoDifficultyHitObject"/>s into a list of <see cref="TaikoDifficultyHitObjectColour"/>s,
|
/// Processes and encodes a list of <see cref="TaikoDifficultyHitObject"/>s into a list of <see cref="TaikoColourData"/>s,
|
||||||
/// assigning the appropriate <see cref="TaikoDifficultyHitObjectColour"/>s to each <see cref="TaikoDifficultyHitObject"/>.
|
/// assigning the appropriate <see cref="TaikoColourData"/>s to each <see cref="TaikoDifficultyHitObject"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void ProcessAndAssign(List<DifficultyHitObject> hitObjects)
|
public static void ProcessAndAssign(List<DifficultyHitObject> hitObjects)
|
||||||
{
|
{
|
||||||
@ -41,9 +41,9 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
|
|||||||
|
|
||||||
foreach (var hitObject in monoStreak.HitObjects)
|
foreach (var hitObject in monoStreak.HitObjects)
|
||||||
{
|
{
|
||||||
hitObject.Colour.RepeatingHitPattern = repeatingHitPattern;
|
hitObject.ColourData.RepeatingHitPattern = repeatingHitPattern;
|
||||||
hitObject.Colour.AlternatingMonoPattern = monoPattern;
|
hitObject.ColourData.AlternatingMonoPattern = monoPattern;
|
||||||
hitObject.Colour.MonoStreak = monoStreak;
|
hitObject.ColourData.MonoStreak = monoStreak;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Rhythm
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stores rhythm data for a <see cref="TaikoDifficultyHitObject"/>.
|
/// Stores rhythm data for a <see cref="TaikoDifficultyHitObject"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TaikoDifficultyHitObjectRhythm
|
public class TaikoRhythmData
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The group of hit objects with consistent rhythm that this object belongs to.
|
/// The group of hit objects with consistent rhythm that this object belongs to.
|
||||||
@ -39,25 +39,25 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Rhythm
|
|||||||
/// <item>speeding up is <i>generally</i> harder than slowing down (with exceptions of rhythm changes requiring a hand switch).</item>
|
/// <item>speeding up is <i>generally</i> harder than slowing down (with exceptions of rhythm changes requiring a hand switch).</item>
|
||||||
/// </list>
|
/// </list>
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
private static readonly TaikoDifficultyHitObjectRhythm[] common_rhythms =
|
private static readonly TaikoRhythmData[] common_rhythms =
|
||||||
{
|
{
|
||||||
new TaikoDifficultyHitObjectRhythm(1, 1),
|
new TaikoRhythmData(1, 1),
|
||||||
new TaikoDifficultyHitObjectRhythm(2, 1),
|
new TaikoRhythmData(2, 1),
|
||||||
new TaikoDifficultyHitObjectRhythm(1, 2),
|
new TaikoRhythmData(1, 2),
|
||||||
new TaikoDifficultyHitObjectRhythm(3, 1),
|
new TaikoRhythmData(3, 1),
|
||||||
new TaikoDifficultyHitObjectRhythm(1, 3),
|
new TaikoRhythmData(1, 3),
|
||||||
new TaikoDifficultyHitObjectRhythm(3, 2),
|
new TaikoRhythmData(3, 2),
|
||||||
new TaikoDifficultyHitObjectRhythm(2, 3),
|
new TaikoRhythmData(2, 3),
|
||||||
new TaikoDifficultyHitObjectRhythm(5, 4),
|
new TaikoRhythmData(5, 4),
|
||||||
new TaikoDifficultyHitObjectRhythm(4, 5)
|
new TaikoRhythmData(4, 5)
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initialises a new instance of <see cref="TaikoDifficultyHitObjectRhythm"/>s,
|
/// Initialises a new instance of <see cref="TaikoRhythmData"/>s,
|
||||||
/// calculating the closest rhythm change and its associated difficulty for the current hit object.
|
/// calculating the closest rhythm change and its associated difficulty for the current hit object.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="current">The current <see cref="TaikoDifficultyHitObject"/> being processed.</param>
|
/// <param name="current">The current <see cref="TaikoDifficultyHitObject"/> being processed.</param>
|
||||||
public TaikoDifficultyHitObjectRhythm(TaikoDifficultyHitObject current)
|
public TaikoRhythmData(TaikoDifficultyHitObject current)
|
||||||
{
|
{
|
||||||
var previous = current.Previous(0);
|
var previous = current.Previous(0);
|
||||||
|
|
||||||
@ -67,8 +67,8 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Rhythm
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TaikoDifficultyHitObjectRhythm closestRhythm = getClosestRhythm(current.DeltaTime, previous.DeltaTime);
|
TaikoRhythmData closestRhythmData = getClosestRhythm(current.DeltaTime, previous.DeltaTime);
|
||||||
Ratio = closestRhythm.Ratio;
|
Ratio = closestRhythmData.Ratio;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -76,7 +76,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Rhythm
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="numerator">The numerator for <see cref="Ratio"/>.</param>
|
/// <param name="numerator">The numerator for <see cref="Ratio"/>.</param>
|
||||||
/// <param name="denominator">The denominator for <see cref="Ratio"/></param>
|
/// <param name="denominator">The denominator for <see cref="Ratio"/></param>
|
||||||
private TaikoDifficultyHitObjectRhythm(int numerator, int denominator)
|
private TaikoRhythmData(int numerator, int denominator)
|
||||||
{
|
{
|
||||||
Ratio = numerator / (double)denominator;
|
Ratio = numerator / (double)denominator;
|
||||||
}
|
}
|
||||||
@ -88,11 +88,10 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Rhythm
|
|||||||
/// <param name="currentDeltaTime">The time difference between the current hit object and the previous one.</param>
|
/// <param name="currentDeltaTime">The time difference between the current hit object and the previous one.</param>
|
||||||
/// <param name="previousDeltaTime">The time difference between the previous hit object and the one before it.</param>
|
/// <param name="previousDeltaTime">The time difference between the previous hit object and the one before it.</param>
|
||||||
/// <returns>The closest matching rhythm from <see cref="common_rhythms"/>.</returns>
|
/// <returns>The closest matching rhythm from <see cref="common_rhythms"/>.</returns>
|
||||||
private TaikoDifficultyHitObjectRhythm getClosestRhythm(double currentDeltaTime, double previousDeltaTime)
|
private TaikoRhythmData getClosestRhythm(double currentDeltaTime, double previousDeltaTime)
|
||||||
{
|
{
|
||||||
double ratio = currentDeltaTime / previousDeltaTime;
|
double ratio = currentDeltaTime / previousDeltaTime;
|
||||||
return common_rhythms.OrderBy(x => Math.Abs(x.Ratio - ratio)).First();
|
return common_rhythms.OrderBy(x => Math.Abs(x.Ratio - ratio)).First();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Rhythm
|
|||||||
{
|
{
|
||||||
foreach (var hitObject in rhythmGroup.HitObjects)
|
foreach (var hitObject in rhythmGroup.HitObjects)
|
||||||
{
|
{
|
||||||
hitObject.Rhythm.SameRhythmGroupedHitObjects = rhythmGroup;
|
hitObject.RhythmData.SameRhythmGroupedHitObjects = rhythmGroup;
|
||||||
hitObject.HitObjectInterval = rhythmGroup.HitObjectInterval;
|
hitObject.HitObjectInterval = rhythmGroup.HitObjectInterval;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Rhythm
|
|||||||
{
|
{
|
||||||
foreach (var hitObject in patternGroup.AllHitObjects)
|
foreach (var hitObject in patternGroup.AllHitObjects)
|
||||||
{
|
{
|
||||||
hitObject.Rhythm.SamePatternsGroupedHitObjects = patternGroup;
|
hitObject.RhythmData.SamePatternsGroupedHitObjects = patternGroup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The rhythm required to hit this hit object.
|
/// The rhythm required to hit this hit object.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly TaikoDifficultyHitObjectRhythm Rhythm;
|
public readonly TaikoRhythmData RhythmData;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The interval between this hit object and the surrounding hit objects in its rhythm group.
|
/// The interval between this hit object and the surrounding hit objects in its rhythm group.
|
||||||
@ -52,7 +52,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing
|
|||||||
/// Colour data for this hit object. This is used by colour evaluator to calculate colour difficulty, but can be used
|
/// Colour data for this hit object. This is used by colour evaluator to calculate colour difficulty, but can be used
|
||||||
/// by other skills in the future.
|
/// by other skills in the future.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly TaikoDifficultyHitObjectColour Colour;
|
public readonly TaikoColourData ColourData;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The adjusted BPM of this hit object, based on its slider velocity and scroll speed.
|
/// The adjusted BPM of this hit object, based on its slider velocity and scroll speed.
|
||||||
@ -92,10 +92,10 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing
|
|||||||
noteDifficultyHitObjects = noteObjects;
|
noteDifficultyHitObjects = noteObjects;
|
||||||
|
|
||||||
// Create the Colour object, its properties should be filled in by TaikoDifficultyPreprocessor
|
// Create the Colour object, its properties should be filled in by TaikoDifficultyPreprocessor
|
||||||
Colour = new TaikoDifficultyHitObjectColour();
|
ColourData = new TaikoColourData();
|
||||||
|
|
||||||
// Create a Rhythm object, its properties are filled in by TaikoDifficultyHitObjectRhythm
|
// Create a Rhythm object, its properties are filled in by TaikoDifficultyHitObjectRhythm
|
||||||
Rhythm = new TaikoDifficultyHitObjectRhythm(this);
|
RhythmData = new TaikoRhythmData(this);
|
||||||
|
|
||||||
switch ((hitObject as Hit)?.Type)
|
switch ((hitObject as Hit)?.Type)
|
||||||
{
|
{
|
||||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Skills
|
|||||||
}
|
}
|
||||||
|
|
||||||
var taikoObject = (TaikoDifficultyHitObject)current;
|
var taikoObject = (TaikoDifficultyHitObject)current;
|
||||||
int index = taikoObject.Colour.MonoStreak?.HitObjects.IndexOf(taikoObject) ?? 0;
|
int index = taikoObject.ColourData.MonoStreak?.HitObjects.IndexOf(taikoObject) ?? 0;
|
||||||
|
|
||||||
currentStrain *= DifficultyCalculationUtils.Logistic(index, 4, -1 / 25.0, 0.5) + 0.5;
|
currentStrain *= DifficultyCalculationUtils.Logistic(index, 4, -1 / 25.0, 0.5) + 0.5;
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Skills
|
|||||||
|
|
||||||
// Safely prevents previous strains from shifting as new notes are added.
|
// Safely prevents previous strains from shifting as new notes are added.
|
||||||
var currentObject = current as TaikoDifficultyHitObject;
|
var currentObject = current as TaikoDifficultyHitObject;
|
||||||
int index = currentObject?.Colour.MonoStreak?.HitObjects.IndexOf(currentObject) ?? 0;
|
int index = currentObject?.ColourData.MonoStreak?.HitObjects.IndexOf(currentObject) ?? 0;
|
||||||
|
|
||||||
double monolengthBonus = isConvert ? 1 : 1 + Math.Min(Math.Max((index - 5) / 50.0, 0), 0.30);
|
double monolengthBonus = isConvert ? 1 : 1 + Math.Min(Math.Max((index - 5) / 50.0, 0), 0.30);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user