This commit is contained in:
smoogipoo 2017-11-17 16:54:50 +09:00
parent 825aa6570e
commit bf44b3d0ef
9 changed files with 21 additions and 26 deletions

View File

@ -3,7 +3,7 @@
namespace osu.Game.Rulesets.Catch.Tests
{
public class TestCasePerformancePoints : osu.Game.Tests.Visual.TestCasePerformancePoints
public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints
{
public TestCasePerformancePoints()
: base(new CatchRuleset(new RulesetInfo()))

View File

@ -3,7 +3,7 @@
namespace osu.Game.Rulesets.Mania.Tests
{
public class TestCasePerformancePoints : osu.Game.Tests.Visual.TestCasePerformancePoints
public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints
{
public TestCasePerformancePoints()
: base(new ManiaRuleset(new RulesetInfo()))

View File

@ -57,7 +57,7 @@ public override double Calculate(Dictionary<string, string> categoryDifficulty =
}
foreach (Skill s in skills)
s.Process(h);
s.Process(h, TimeRate);
}
double aimRating = Math.Sqrt(skills[0].DifficultyValue()) * difficulty_multiplier;

View File

@ -38,9 +38,9 @@ public abstract class Skill
/// <summary>
/// Process an <see cref="OsuDifficultyHitObject"/> and update current strain values accordingly.
/// </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))
currentStrain += StrainValueOf(current) * SkillMultiplier;

View File

@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.Beatmaps;
@ -32,7 +31,7 @@ public OsuPerformanceCalculator(Ruleset ruleset, Beatmap beatmap, Score score)
{
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());
}
@ -84,10 +83,10 @@ private double computeAimValue()
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
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);
aimValue *= LengthBonus;
aimValue *= lengthBonus;
// Penalize misses exponentially. This mainly fixes tag4 maps and the likes until a per-hitobject solution is available
aimValue *= Math.Pow(0.97f, countMiss);
@ -117,13 +116,13 @@ private double computeAimValue()
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.
aimValue *= 1.45f * LengthBonus;
aimValue *= 1.45f * lengthBonus;
}
// Scale the aim value with accuracy _slightly_
aimValue *= 0.5f + accuracy / 2.0f;
// 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;
}
@ -146,7 +145,7 @@ private double computeSpeedValue()
// Scale the speed value with accuracy _slightly_
speedValue *= 0.5f + accuracy / 2.0f;
// 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;
}
@ -154,7 +153,7 @@ private double computeSpeedValue()
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
double betterAccuracyPercentage = 0;
double betterAccuracyPercentage;
int amountHitObjectsWithAccuracy = countHitCircles;
if (amountHitObjectsWithAccuracy > 0)

View File

@ -3,7 +3,7 @@
namespace osu.Game.Rulesets.Osu.Tests
{
public class TestCasePerformancePoints : osu.Game.Tests.Visual.TestCasePerformancePoints
public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints
{
public TestCasePerformancePoints()
: base(new OsuRuleset(new RulesetInfo()))

View File

@ -3,7 +3,7 @@
namespace osu.Game.Rulesets.Taiko.Tests
{
public class TestCasePerformancePoints : osu.Game.Tests.Visual.TestCasePerformancePoints
public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints
{
public TestCasePerformancePoints()
: base(new TaikoRuleset(new RulesetInfo()))

View File

@ -21,7 +21,7 @@ public abstract class PerformanceCalculator<TObject> : PerformanceCalculator
protected readonly Beatmap<TObject> Beatmap;
protected readonly Score Score;
public PerformanceCalculator(Ruleset ruleset, Beatmap beatmap, Score score)
protected PerformanceCalculator(Ruleset ruleset, Beatmap beatmap, Score score)
{
Beatmap = CreateBeatmapConverter().Convert(beatmap);
Score = score;

View File

@ -12,15 +12,12 @@
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input;
using osu.Game.Beatmaps;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests;
using osu.Game.Overlays;
using osu.Game.Overlays.Music;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Scoring;
@ -29,7 +26,7 @@ namespace osu.Game.Tests.Visual
{
public abstract class TestCasePerformancePoints : OsuTestCase
{
public TestCasePerformancePoints(Ruleset ruleset)
protected TestCasePerformancePoints(Ruleset ruleset)
{
Child = new GridContainer
{
@ -49,7 +46,7 @@ public TestCasePerformancePoints(Ruleset ruleset)
Colour = Color4.Black,
Alpha = 0.5f,
},
new ScrollContainer(Direction.Vertical)
new ScrollContainer
{
RelativeSizeAxes = Axes.Both,
Child = new BeatmapList(ruleset)
@ -68,7 +65,7 @@ public TestCasePerformancePoints(Ruleset ruleset)
Colour = Color4.Black,
Alpha = 0.5f,
},
new ScrollContainer(Direction.Vertical)
new ScrollContainer
{
RelativeSizeAxes = Axes.Both,
Child = new StarRatingGrid()
@ -87,7 +84,7 @@ public TestCasePerformancePoints(Ruleset ruleset)
Colour = Color4.Black,
Alpha = 0.5f,
},
new ScrollContainer(Direction.Vertical)
new ScrollContainer
{
RelativeSizeAxes = Axes.Both,
Child = new PerformanceList()
@ -127,7 +124,7 @@ public BeatmapList(Ruleset ruleset)
}
[BackgroundDependencyLoader]
private void load(OsuGameBase osuGame, BeatmapManager beatmaps)
private void load(BeatmapManager beatmaps)
{
var sets = beatmaps.GetAllUsableBeatmapSets();
var allBeatmaps = sets.SelectMany(s => s.Beatmaps).Where(b => ruleset.LegacyID < 0 || b.RulesetID == ruleset.LegacyID);
@ -186,7 +183,6 @@ private void load(OsuGameBase osuGame, BeatmapManager beatmaps)
this.osuGame = osuGame;
this.beatmaps = beatmaps;
var working = beatmaps.GetWorkingBeatmap(beatmap);
text.Text = $"{beatmap.Metadata.Artist} - {beatmap.Metadata.Title} ({beatmap.Metadata.AuthorString}) [{beatmap.Version}]";
osuGame.Beatmap.ValueChanged += beatmapChanged;
@ -372,7 +368,7 @@ protected override void Update()
totalText.Text = $"Star rating: {totalSr:n2}";
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();