-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Refactor of osu!taiko difficulty calculation code #31636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 15 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
fa20bc6
Remove `EffectiveBPMPreprocessor`
tsunyoku dbe3688
Refactor `ColourEvaluator`
tsunyoku 9919179
Format `ReadingEvaluator`
tsunyoku b8c79d5
Refactor `StaminaEvaluator`
tsunyoku ef88677
Add xmldoc to explain `IHasInterval.Interval`
tsunyoku 20a76d8
Rename rhythm preprocessing objects to be clearer with intent
tsunyoku e0882d2
Make `rescale` a static method
tsunyoku 764b000
Fix typo in `ColourEvaluator`
tsunyoku 1c4bc6d
Revert `Precision.DefinitelyBigger` usage
tsunyoku 14c68bc
Replace weird `IntervalGroupedHitObjects` inheritance layer
tsunyoku 2c0d6b1
Fix incorrect namespace
tsunyoku 753e9ef
Keep old behaviour of `double.PositiveInfinity` being the default for…
tsunyoku 8f17a44
Remove unused default value
tsunyoku a7aa553
Fix incorrect `startTime` calculation
tsunyoku 13c956c
Account for floating point errors
tsunyoku 71b89c3
Rename class, rename children to hit objects and groups, make fields …
tsunyoku f3c17f1
Use correct English
tsunyoku fa844b0
Rename `Colour` / `Rhythm` related fields and classes
peppy 709ad02
Simplify `TaikoRhythmData`'s ratio computation
peppy fc93390
Remove unused `HitObjectInterval`
peppy 3254831
Tidy up xmldoc and remove another unused field
peppy 8447679
Initial tidy-up pass on `IntervalGroupingUtils`
peppy 40ea7ff
Add better documentation for interval change code
peppy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 0 additions & 50 deletions
50
osu.Game.Rulesets.Taiko/Difficulty/Preprocessing/Reading/EffectiveBPM.cs
This file was deleted.
Oops, something went wrong.
55 changes: 0 additions & 55 deletions
55
osu.Game.Rulesets.Taiko/Difficulty/Preprocessing/Rhythm/Data/SamePatterns.cs
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
...Game.Rulesets.Taiko/Difficulty/Preprocessing/Rhythm/Data/SamePatternsGroupedHitObjects.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Rhythm.Data | ||
{ | ||
/// <summary> | ||
/// Represents <see cref="SameRhythmGroupedHitObjects"/> grouped by their <see cref="SameRhythmGroupedHitObjects.StartTime"/>'s interval. | ||
/// </summary> | ||
public class SamePatternsGroupedHitObjects | ||
{ | ||
public IReadOnlyList<SameRhythmGroupedHitObjects> Children { get; } | ||
|
||
public SamePatternsGroupedHitObjects? Previous { get; } | ||
|
||
/// <summary> | ||
/// The <see cref="SameRhythmGroupedHitObjects.Interval"/> between children <see cref="SameRhythmGroupedHitObjects"/> within this group. | ||
/// If there is only one child, this will have the value of the first child's <see cref="SameRhythmGroupedHitObjects.Interval"/>. | ||
/// </summary> | ||
public double ChildrenInterval => Children.Count > 1 ? Children[1].Interval : Children[0].Interval; | ||
|
||
/// <summary> | ||
/// The ratio of <see cref="ChildrenInterval"/> between this and the previous <see cref="SamePatternsGroupedHitObjects"/>. In the | ||
/// case where there is no previous <see cref="SamePatternsGroupedHitObjects"/>, this will have a value of 1. | ||
/// </summary> | ||
public double IntervalRatio => ChildrenInterval / Previous?.ChildrenInterval ?? 1.0d; | ||
|
||
public TaikoDifficultyHitObject FirstHitObject => Children[0].FirstHitObject; | ||
|
||
public IEnumerable<TaikoDifficultyHitObject> AllHitObjects => Children.SelectMany(child => child.Children); | ||
|
||
public SamePatternsGroupedHitObjects(SamePatternsGroupedHitObjects? previous, List<SameRhythmGroupedHitObjects> children) | ||
{ | ||
Previous = previous; | ||
Children = children; | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This xmldoc doesn't do much for me without reading into how it works. Can it be explained in less code-y terms?
For example, does every grouping in this class have the same rhythm?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It represents a group of hit objects grouped by the same spacing between their start times (interval). This then is calculated as a singular rhythmic group or segment. Every grouping in this class will be grouped by having the same interval, with the changes garnering the difficulty between them.