mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 16:32:54 +08:00
Cleanups
This commit is contained in:
parent
825aa6570e
commit
bf44b3d0ef
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Tests
|
namespace osu.Game.Rulesets.Catch.Tests
|
||||||
{
|
{
|
||||||
public class TestCasePerformancePoints : osu.Game.Tests.Visual.TestCasePerformancePoints
|
public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints
|
||||||
{
|
{
|
||||||
public TestCasePerformancePoints()
|
public TestCasePerformancePoints()
|
||||||
: base(new CatchRuleset(new RulesetInfo()))
|
: base(new CatchRuleset(new RulesetInfo()))
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Mania.Tests
|
namespace osu.Game.Rulesets.Mania.Tests
|
||||||
{
|
{
|
||||||
public class TestCasePerformancePoints : osu.Game.Tests.Visual.TestCasePerformancePoints
|
public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints
|
||||||
{
|
{
|
||||||
public TestCasePerformancePoints()
|
public TestCasePerformancePoints()
|
||||||
: base(new ManiaRuleset(new RulesetInfo()))
|
: base(new ManiaRuleset(new RulesetInfo()))
|
||||||
|
@ -57,7 +57,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (Skill s in skills)
|
foreach (Skill s in skills)
|
||||||
s.Process(h);
|
s.Process(h, TimeRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
double aimRating = Math.Sqrt(skills[0].DifficultyValue()) * difficulty_multiplier;
|
double aimRating = Math.Sqrt(skills[0].DifficultyValue()) * difficulty_multiplier;
|
||||||
|
@ -38,9 +38,9 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Skills
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Process an <see cref="OsuDifficultyHitObject"/> and update current strain values accordingly.
|
/// Process an <see cref="OsuDifficultyHitObject"/> and update current strain values accordingly.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Process(OsuDifficultyHitObject current)
|
public void Process(OsuDifficultyHitObject current, double timeRate)
|
||||||
{
|
{
|
||||||
currentStrain *= strainDecay(current.DeltaTime);
|
currentStrain *= strainDecay(current.DeltaTime / timeRate);
|
||||||
if (!(current.BaseObject is Spinner))
|
if (!(current.BaseObject is Spinner))
|
||||||
currentStrain += StrainValueOf(current) * SkillMultiplier;
|
currentStrain += StrainValueOf(current) * SkillMultiplier;
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Osu.Beatmaps;
|
using osu.Game.Rulesets.Osu.Beatmaps;
|
||||||
@ -32,7 +31,7 @@ namespace osu.Game.Rulesets.Osu.Scoring
|
|||||||
{
|
{
|
||||||
countHitCircles = Beatmap.HitObjects.Count(h => h is HitCircle);
|
countHitCircles = Beatmap.HitObjects.Count(h => h is HitCircle);
|
||||||
|
|
||||||
beatmapMaxCombo = Beatmap.HitObjects.Count();
|
beatmapMaxCombo = Beatmap.HitObjects.Count;
|
||||||
beatmapMaxCombo += Beatmap.HitObjects.OfType<Slider>().Sum(s => s.RepeatCount + s.Ticks.Count());
|
beatmapMaxCombo += Beatmap.HitObjects.OfType<Slider>().Sum(s => s.RepeatCount + s.Ticks.Count());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,10 +83,10 @@ namespace osu.Game.Rulesets.Osu.Scoring
|
|||||||
double aimValue = Math.Pow(5.0f * Math.Max(1.0f, double.Parse(Attributes["Aim"]) / 0.0675f) - 4.0f, 3.0f) / 100000.0f;
|
double aimValue = Math.Pow(5.0f * Math.Max(1.0f, double.Parse(Attributes["Aim"]) / 0.0675f) - 4.0f, 3.0f) / 100000.0f;
|
||||||
|
|
||||||
// Longer maps are worth more
|
// Longer maps are worth more
|
||||||
double LengthBonus = 0.95f + 0.4f * Math.Min(1.0f, totalHits / 2000.0f) +
|
double lengthBonus = 0.95f + 0.4f * Math.Min(1.0f, totalHits / 2000.0f) +
|
||||||
(totalHits > 2000 ? Math.Log10(totalHits / 2000.0f) * 0.5f : 0.0f);
|
(totalHits > 2000 ? Math.Log10(totalHits / 2000.0f) * 0.5f : 0.0f);
|
||||||
|
|
||||||
aimValue *= LengthBonus;
|
aimValue *= lengthBonus;
|
||||||
|
|
||||||
// Penalize misses exponentially. This mainly fixes tag4 maps and the likes until a per-hitobject solution is available
|
// Penalize misses exponentially. This mainly fixes tag4 maps and the likes until a per-hitobject solution is available
|
||||||
aimValue *= Math.Pow(0.97f, countMiss);
|
aimValue *= Math.Pow(0.97f, countMiss);
|
||||||
@ -117,13 +116,13 @@ namespace osu.Game.Rulesets.Osu.Scoring
|
|||||||
if (mods.Any(h => h is OsuModFlashlight))
|
if (mods.Any(h => h is OsuModFlashlight))
|
||||||
{
|
{
|
||||||
// Apply length bonus again if flashlight is on simply because it becomes a lot harder on longer maps.
|
// Apply length bonus again if flashlight is on simply because it becomes a lot harder on longer maps.
|
||||||
aimValue *= 1.45f * LengthBonus;
|
aimValue *= 1.45f * lengthBonus;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scale the aim value with accuracy _slightly_
|
// Scale the aim value with accuracy _slightly_
|
||||||
aimValue *= 0.5f + accuracy / 2.0f;
|
aimValue *= 0.5f + accuracy / 2.0f;
|
||||||
// It is important to also consider accuracy difficulty when doing that
|
// It is important to also consider accuracy difficulty when doing that
|
||||||
aimValue *= 0.98f + (Math.Pow(Beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty, 2) / 2500);
|
aimValue *= 0.98f + Math.Pow(Beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty, 2) / 2500;
|
||||||
|
|
||||||
return aimValue;
|
return aimValue;
|
||||||
}
|
}
|
||||||
@ -146,7 +145,7 @@ namespace osu.Game.Rulesets.Osu.Scoring
|
|||||||
// Scale the speed value with accuracy _slightly_
|
// Scale the speed value with accuracy _slightly_
|
||||||
speedValue *= 0.5f + accuracy / 2.0f;
|
speedValue *= 0.5f + accuracy / 2.0f;
|
||||||
// It is important to also consider accuracy difficulty when doing that
|
// It is important to also consider accuracy difficulty when doing that
|
||||||
speedValue *= 0.98f + (Math.Pow(Beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty, 2) / 2500);
|
speedValue *= 0.98f + Math.Pow(Beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty, 2) / 2500;
|
||||||
|
|
||||||
return speedValue;
|
return speedValue;
|
||||||
}
|
}
|
||||||
@ -154,7 +153,7 @@ namespace osu.Game.Rulesets.Osu.Scoring
|
|||||||
private double computeAccuracyValue()
|
private double computeAccuracyValue()
|
||||||
{
|
{
|
||||||
// This percentage only considers HitCircles of any value - in this part of the calculation we focus on hitting the timing hit window
|
// This percentage only considers HitCircles of any value - in this part of the calculation we focus on hitting the timing hit window
|
||||||
double betterAccuracyPercentage = 0;
|
double betterAccuracyPercentage;
|
||||||
int amountHitObjectsWithAccuracy = countHitCircles;
|
int amountHitObjectsWithAccuracy = countHitCircles;
|
||||||
|
|
||||||
if (amountHitObjectsWithAccuracy > 0)
|
if (amountHitObjectsWithAccuracy > 0)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Tests
|
namespace osu.Game.Rulesets.Osu.Tests
|
||||||
{
|
{
|
||||||
public class TestCasePerformancePoints : osu.Game.Tests.Visual.TestCasePerformancePoints
|
public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints
|
||||||
{
|
{
|
||||||
public TestCasePerformancePoints()
|
public TestCasePerformancePoints()
|
||||||
: base(new OsuRuleset(new RulesetInfo()))
|
: base(new OsuRuleset(new RulesetInfo()))
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.Tests
|
namespace osu.Game.Rulesets.Taiko.Tests
|
||||||
{
|
{
|
||||||
public class TestCasePerformancePoints : osu.Game.Tests.Visual.TestCasePerformancePoints
|
public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints
|
||||||
{
|
{
|
||||||
public TestCasePerformancePoints()
|
public TestCasePerformancePoints()
|
||||||
: base(new TaikoRuleset(new RulesetInfo()))
|
: base(new TaikoRuleset(new RulesetInfo()))
|
||||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
protected readonly Beatmap<TObject> Beatmap;
|
protected readonly Beatmap<TObject> Beatmap;
|
||||||
protected readonly Score Score;
|
protected readonly Score Score;
|
||||||
|
|
||||||
public PerformanceCalculator(Ruleset ruleset, Beatmap beatmap, Score score)
|
protected PerformanceCalculator(Ruleset ruleset, Beatmap beatmap, Score score)
|
||||||
{
|
{
|
||||||
Beatmap = CreateBeatmapConverter().Convert(beatmap);
|
Beatmap = CreateBeatmapConverter().Convert(beatmap);
|
||||||
Score = score;
|
Score = score;
|
||||||
|
@ -12,15 +12,12 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Cursor;
|
using osu.Framework.Graphics.Cursor;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.API.Requests;
|
using osu.Game.Online.API.Requests;
|
||||||
using osu.Game.Overlays;
|
|
||||||
using osu.Game.Overlays.Music;
|
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
@ -29,7 +26,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
{
|
{
|
||||||
public abstract class TestCasePerformancePoints : OsuTestCase
|
public abstract class TestCasePerformancePoints : OsuTestCase
|
||||||
{
|
{
|
||||||
public TestCasePerformancePoints(Ruleset ruleset)
|
protected TestCasePerformancePoints(Ruleset ruleset)
|
||||||
{
|
{
|
||||||
Child = new GridContainer
|
Child = new GridContainer
|
||||||
{
|
{
|
||||||
@ -49,7 +46,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
Alpha = 0.5f,
|
Alpha = 0.5f,
|
||||||
},
|
},
|
||||||
new ScrollContainer(Direction.Vertical)
|
new ScrollContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = new BeatmapList(ruleset)
|
Child = new BeatmapList(ruleset)
|
||||||
@ -68,7 +65,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
Alpha = 0.5f,
|
Alpha = 0.5f,
|
||||||
},
|
},
|
||||||
new ScrollContainer(Direction.Vertical)
|
new ScrollContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = new StarRatingGrid()
|
Child = new StarRatingGrid()
|
||||||
@ -87,7 +84,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
Alpha = 0.5f,
|
Alpha = 0.5f,
|
||||||
},
|
},
|
||||||
new ScrollContainer(Direction.Vertical)
|
new ScrollContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = new PerformanceList()
|
Child = new PerformanceList()
|
||||||
@ -127,7 +124,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuGameBase osuGame, BeatmapManager beatmaps)
|
private void load(BeatmapManager beatmaps)
|
||||||
{
|
{
|
||||||
var sets = beatmaps.GetAllUsableBeatmapSets();
|
var sets = beatmaps.GetAllUsableBeatmapSets();
|
||||||
var allBeatmaps = sets.SelectMany(s => s.Beatmaps).Where(b => ruleset.LegacyID < 0 || b.RulesetID == ruleset.LegacyID);
|
var allBeatmaps = sets.SelectMany(s => s.Beatmaps).Where(b => ruleset.LegacyID < 0 || b.RulesetID == ruleset.LegacyID);
|
||||||
@ -186,7 +183,6 @@ namespace osu.Game.Tests.Visual
|
|||||||
this.osuGame = osuGame;
|
this.osuGame = osuGame;
|
||||||
this.beatmaps = beatmaps;
|
this.beatmaps = beatmaps;
|
||||||
|
|
||||||
var working = beatmaps.GetWorkingBeatmap(beatmap);
|
|
||||||
text.Text = $"{beatmap.Metadata.Artist} - {beatmap.Metadata.Title} ({beatmap.Metadata.AuthorString}) [{beatmap.Version}]";
|
text.Text = $"{beatmap.Metadata.Artist} - {beatmap.Metadata.Title} ({beatmap.Metadata.AuthorString}) [{beatmap.Version}]";
|
||||||
|
|
||||||
osuGame.Beatmap.ValueChanged += beatmapChanged;
|
osuGame.Beatmap.ValueChanged += beatmapChanged;
|
||||||
@ -372,7 +368,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
totalText.Text = $"Star rating: {totalSr:n2}";
|
totalText.Text = $"Star rating: {totalSr:n2}";
|
||||||
foreach (var kvp in categories)
|
foreach (var kvp in categories)
|
||||||
categoryTexts.Add(new OsuSpriteText { Text = $"{kvp.Key}: {kvp.Value:n2}" });
|
categoryTexts.Add(new OsuSpriteText { Text = $"{kvp.Key}: {kvp.Value}" });
|
||||||
}
|
}
|
||||||
|
|
||||||
informationCache.Validate();
|
informationCache.Validate();
|
||||||
|
Loading…
Reference in New Issue
Block a user