mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 12:22:57 +08:00
Fixing parameters naming
This commit is contained in:
parent
886be8ce1f
commit
68a929eb0c
@ -14,8 +14,8 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
{
|
{
|
||||||
public class CatchDifficultyCalculator : DifficultyCalculator
|
public class CatchDifficultyCalculator : DifficultyCalculator
|
||||||
{
|
{
|
||||||
private const double STAR_SCALING_FACTOR = 0.145;
|
private const double star_scaling_factor = 0.145;
|
||||||
private const float PLAYFIELD_WIDTH = CatchPlayfield.BASE_WIDTH;
|
private const float playfield_width = CatchPlayfield.BASE_WIDTH;
|
||||||
|
|
||||||
private readonly List<CatchDifficultyHitObject> difficultyHitObjects = new List<CatchDifficultyHitObject>();
|
private readonly List<CatchDifficultyHitObject> difficultyHitObjects = new List<CatchDifficultyHitObject>();
|
||||||
|
|
||||||
@ -54,6 +54,8 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
if (!(objectInJuiceStream is TinyDroplet))
|
if (!(objectInJuiceStream is TinyDroplet))
|
||||||
difficultyHitObjects.Add(new CatchDifficultyHitObject(objectInJuiceStream, catcherWidthHalf));
|
difficultyHitObjects.Add(new CatchDifficultyHitObject(objectInJuiceStream, catcherWidthHalf));
|
||||||
}
|
}
|
||||||
|
// Dispose the enumerator after counting all fruits.
|
||||||
|
nestedHitObjectsEnumerator.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +63,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
|
|
||||||
if (!CalculateStrainValues()) return 0;
|
if (!CalculateStrainValues()) return 0;
|
||||||
|
|
||||||
double starRating = Math.Sqrt(CalculateDifficulty()) * STAR_SCALING_FACTOR;
|
double starRating = Math.Sqrt(CalculateDifficulty()) * star_scaling_factor;
|
||||||
|
|
||||||
if (categoryDifficulty != null)
|
if (categoryDifficulty != null)
|
||||||
{
|
{
|
||||||
@ -85,12 +87,11 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
if (!hitObjectsEnumerator.MoveNext()) return false;
|
if (!hitObjectsEnumerator.MoveNext()) return false;
|
||||||
|
|
||||||
CatchDifficultyHitObject currentHitObject = hitObjectsEnumerator.Current;
|
CatchDifficultyHitObject currentHitObject = hitObjectsEnumerator.Current;
|
||||||
CatchDifficultyHitObject nextHitObject;
|
|
||||||
|
|
||||||
// First hitObject starts at strain 1. 1 is the default for strain values, so we don't need to set it here. See DifficultyHitObject.
|
// First hitObject starts at strain 1. 1 is the default for strain values, so we don't need to set it here. See DifficultyHitObject.
|
||||||
while (hitObjectsEnumerator.MoveNext())
|
while (hitObjectsEnumerator.MoveNext())
|
||||||
{
|
{
|
||||||
nextHitObject = hitObjectsEnumerator.Current;
|
CatchDifficultyHitObject nextHitObject = hitObjectsEnumerator.Current;
|
||||||
nextHitObject.CalculateStrains(currentHitObject, TimeRate);
|
nextHitObject.CalculateStrains(currentHitObject, TimeRate);
|
||||||
currentHitObject = nextHitObject;
|
currentHitObject = nextHitObject;
|
||||||
}
|
}
|
||||||
@ -104,12 +105,12 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
/// This is to eliminate higher influence of stream over aim by simply having more HitObjects with high strain.
|
/// This is to eliminate higher influence of stream over aim by simply having more HitObjects with high strain.
|
||||||
/// The higher this value, the less strains there will be, indirectly giving long beatmaps an advantage.
|
/// The higher this value, the less strains there will be, indirectly giving long beatmaps an advantage.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected const double strain_step = 750;
|
private const double strain_step = 750;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The weighting of each strain value decays to this number * it's previous value
|
/// The weighting of each strain value decays to this number * it's previous value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected const double decay_weight = 0.94;
|
private const double decay_weight = 0.94;
|
||||||
|
|
||||||
protected double CalculateDifficulty()
|
protected double CalculateDifficulty()
|
||||||
{
|
{
|
||||||
@ -137,7 +138,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double decay = Math.Pow(CatchDifficultyHitObject.DECAY_BASE, (intervalEndTime - previousHitObject.BaseHitObject.StartTime) / 1000);
|
double decay = Math.Pow(CatchDifficultyHitObject.decay_base, (intervalEndTime - previousHitObject.BaseHitObject.StartTime) / 1000);
|
||||||
maximumStrain = previousHitObject.Strain * decay;
|
maximumStrain = previousHitObject.Strain * decay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,12 +8,12 @@ using OpenTK;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Difficulty
|
namespace osu.Game.Rulesets.Catch.Difficulty
|
||||||
{
|
{
|
||||||
class CatchDifficultyHitObject
|
internal class CatchDifficultyHitObject
|
||||||
{
|
{
|
||||||
internal static readonly double DECAY_BASE = 0.20;
|
internal static readonly double decay_base = 0.20;
|
||||||
private const float NORMALIZED_HITOBJECT_RADIUS = 41.0f;
|
private const float normalized_hitobject_radius = 41.0f;
|
||||||
private const float ABSOLUTE_PLAYER_POSITIONING_ERROR = 16f;
|
private const float absolute_player_positioning_error = 16f;
|
||||||
private float playerPositioningError;
|
private readonly float playerPositioningError;
|
||||||
|
|
||||||
internal CatchHitObject BaseHitObject;
|
internal CatchHitObject BaseHitObject;
|
||||||
|
|
||||||
@ -37,26 +37,26 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
BaseHitObject = baseHitObject;
|
BaseHitObject = baseHitObject;
|
||||||
|
|
||||||
// We will scale everything by this factor, so we can assume a uniform CircleSize among beatmaps.
|
// We will scale everything by this factor, so we can assume a uniform CircleSize among beatmaps.
|
||||||
float scalingFactor = NORMALIZED_HITOBJECT_RADIUS / catcherWidthHalf;
|
float scalingFactor = normalized_hitobject_radius / catcherWidthHalf;
|
||||||
|
|
||||||
playerPositioningError = ABSOLUTE_PLAYER_POSITIONING_ERROR; // * scalingFactor;
|
playerPositioningError = absolute_player_positioning_error; // * scalingFactor;
|
||||||
NormalizedPosition = baseHitObject.X * CatchPlayfield.BASE_WIDTH * scalingFactor;
|
NormalizedPosition = baseHitObject.X * CatchPlayfield.BASE_WIDTH * scalingFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
private const double DIRECTION_CHANGE_BONUS = 12.5;
|
private const double direction_change_bonus = 12.5;
|
||||||
internal void CalculateStrains(CatchDifficultyHitObject previousHitObject, double timeRate)
|
internal void CalculateStrains(CatchDifficultyHitObject previousHitObject, double timeRate)
|
||||||
{
|
{
|
||||||
// Rather simple, but more specialized things are inherently inaccurate due to the big difference playstyles and opinions make.
|
// Rather simple, but more specialized things are inherently inaccurate due to the big difference playstyles and opinions make.
|
||||||
// See Taiko feedback thread.
|
// See Taiko feedback thread.
|
||||||
double timeElapsed = (BaseHitObject.StartTime - previousHitObject.BaseHitObject.StartTime) / timeRate;
|
double timeElapsed = (BaseHitObject.StartTime - previousHitObject.BaseHitObject.StartTime) / timeRate;
|
||||||
double decay = Math.Pow(DECAY_BASE, timeElapsed / 1000);
|
double decay = Math.Pow(decay_base, timeElapsed / 1000);
|
||||||
|
|
||||||
// Update new position with lazy movement.
|
// Update new position with lazy movement.
|
||||||
PlayerPositionOffset =
|
PlayerPositionOffset =
|
||||||
MathHelper.Clamp(
|
MathHelper.Clamp(
|
||||||
previousHitObject.ActualNormalizedPosition,
|
previousHitObject.ActualNormalizedPosition,
|
||||||
NormalizedPosition - (NORMALIZED_HITOBJECT_RADIUS - playerPositioningError),
|
NormalizedPosition - (normalized_hitobject_radius - playerPositioningError),
|
||||||
NormalizedPosition + (NORMALIZED_HITOBJECT_RADIUS - playerPositioningError)) // Obtain new lazy position, but be stricter by allowing for an error of a certain degree of the player.
|
NormalizedPosition + (normalized_hitobject_radius - playerPositioningError)) // Obtain new lazy position, but be stricter by allowing for an error of a certain degree of the player.
|
||||||
- NormalizedPosition; // Subtract HitObject position to obtain offset
|
- NormalizedPosition; // Subtract HitObject position to obtain offset
|
||||||
|
|
||||||
LastMovement = DistanceTo(previousHitObject);
|
LastMovement = DistanceTo(previousHitObject);
|
||||||
@ -77,9 +77,9 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
{
|
{
|
||||||
if (Math.Abs(previousHitObject.LastMovement) > 0.1 && Math.Sign(LastMovement) != Math.Sign(previousHitObject.LastMovement))
|
if (Math.Abs(previousHitObject.LastMovement) > 0.1 && Math.Sign(LastMovement) != Math.Sign(previousHitObject.LastMovement))
|
||||||
{
|
{
|
||||||
double bonus = DIRECTION_CHANGE_BONUS / sqrtTime;
|
double bonus = direction_change_bonus / sqrtTime;
|
||||||
|
|
||||||
// Weight bonus by how
|
// Weight bonus by how
|
||||||
double bonusFactor = Math.Min(playerPositioningError, Math.Abs(LastMovement)) / playerPositioningError;
|
double bonusFactor = Math.Min(playerPositioningError, Math.Abs(LastMovement)) / playerPositioningError;
|
||||||
|
|
||||||
// We want time to play a role twice here!
|
// We want time to play a role twice here!
|
||||||
@ -93,7 +93,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Base bonus for every movement, giving some weight to streams.
|
// Base bonus for every movement, giving some weight to streams.
|
||||||
addition += 7.5 * Math.Min(Math.Abs(LastMovement), NORMALIZED_HITOBJECT_RADIUS * 2) / (NORMALIZED_HITOBJECT_RADIUS * 6) / sqrtTime;
|
addition += 7.5 * Math.Min(Math.Abs(LastMovement), normalized_hitobject_radius * 2) / (normalized_hitobject_radius * 6) / sqrtTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bonus for "almost" hyperdashes at corner points
|
// Bonus for "almost" hyperdashes at corner points
|
||||||
|
Loading…
Reference in New Issue
Block a user