Skip to content

Commit

Permalink
Initial attempt to include colour field data in pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
vunyunt committed Nov 24, 2024
1 parent eabd810 commit 7fab6d2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
19 changes: 16 additions & 3 deletions osu.Game.Rulesets.Taiko/Difficulty/Evaluators/PatternEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 17,23 @@ public static double EvaluateDifficultyOf(
{
if (hitObject.BaseObject is not Hit) return 0;

double errorAmplitude = fields.RhythmField.GetAmplitude(hitObject.StartTime, errorStandardDeviation);
double hitAmplitude = fields.RhythmField.GetAmplitude(hitObject.StartTime, hitWindowStandardDeviation);
double rhythmHitAmplitude = fields.RhythmField.GetAmplitude(hitObject.StartTime, hitWindowStandardDeviation);
double centreHitAmplitude = fields.CentreField.GetAmplitude(hitObject.StartTime, hitWindowStandardDeviation);
double rimHitAmplitude = fields.RimField.GetAmplitude(hitObject.StartTime, hitWindowStandardDeviation);
double colourChangeAmplitude = fields.ColourChangeField.GetAmplitude(hitObject.StartTime, hitWindowStandardDeviation);

// System.Console.WriteLine("errorAmplitude: " errorAmplitude ", hitAmplitude: " hitAmplitude);
double rhythmErrorAmplitude = fields.RhythmField.GetAmplitude(hitObject.StartTime, errorStandardDeviation);
double colourChangeErrorAmplitude = fields.ColourChangeField.GetAmplitude(hitObject.StartTime, errorStandardDeviation);

double hitAmplitude = Math.Sqrt(
Math.Pow(centreHitAmplitude, 2)
Math.Pow(rimHitAmplitude, 2)
Math.Pow(colourChangeAmplitude, 2)
Math.Pow(rhythmHitAmplitude, 2));

double errorAmplitude = Math.Sqrt(
Math.Pow(colourChangeErrorAmplitude, 2)
Math.Pow(rhythmErrorAmplitude, 2));

hitAmplitude = Math.Max(hitAmplitude, 0.1);
return errorAmplitude / hitAmplitude;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 11,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Pattern
{
public static class TaikoPatternDifficultyPreprocessor
{
private const int harmonics = 8;
private const int harmonics = 4;

private const double cycles_count = 4;

Expand All @@ -21,7 21,7 @@ private static void createAlignmentPoints(double time, double interval, TaikoTim
{
for (int i = 0; i < harmonics; i )
{
double harmonicInterval = interval * Math.Pow(2, i);
double harmonicInterval = interval / Math.Pow(2, i);
double harmonicAmplitude = Math.Pow(0.5, i);

for (int j = 0; j < cycles_count * (i 1); j )
Expand Down

0 comments on commit 7fab6d2

Please sign in to comment.