Skip to content

Commit 1810e33

Browse files
authored
Merge pull request #2 from Syriiin/update/2024.412.1
Update to osu version 2024.412.1
2 parents 9a78b94 + fd6ff7a commit 1810e33

File tree

27 files changed

+2936
-1795
lines changed

27 files changed

+2936
-1795
lines changed

Difficalcy.Catch.Tests/CatchCalculatorServiceTest.cs

+30-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,40 @@ namespace Difficalcy.Catch.Tests;
77

88
public class CatchCalculatorServiceTest : CalculatorServiceTest<CatchScore, CatchDifficulty, CatchPerformance, CatchCalculation>
99
{
10-
protected override CalculatorService<CatchScore, CatchDifficulty, CatchPerformance, CatchCalculation> CalculatorService { get; } = new CatchCalculatorService(new InMemoryCache(), new TestBeatmapProvider("osu.Game.Rulesets.Catch"));
10+
protected override CalculatorService<CatchScore, CatchDifficulty, CatchPerformance, CatchCalculation> CalculatorService { get; } = new CatchCalculatorService(new InMemoryCache(), new TestBeatmapProvider(typeof(CatchCalculatorService).Assembly.GetName().Name));
1111

1212
[Theory]
1313
[InlineData(4.0505463516206195d, 164.5770866821372d, "diffcalc-test", 0)]
1414
[InlineData(5.1696411260785498d, 291.43480971713944d, "diffcalc-test", 64)]
1515
public void Test(double expectedDifficultyTotal, double expectedPerformanceTotal, string beatmapId, int mods)
1616
=> base.TestGetCalculationReturnsCorrectValues(expectedDifficultyTotal, expectedPerformanceTotal, new CatchScore { BeatmapId = beatmapId, Mods = mods });
17+
18+
[Fact]
19+
public void TestAllParameters()
20+
{
21+
var score = new CatchScore
22+
{
23+
BeatmapId = "diffcalc-test",
24+
Mods = 80, // HR, DT
25+
Combo = 100,
26+
Misses = 5,
27+
TinyDroplets = 200,
28+
Droplets = 3,
29+
};
30+
base.TestGetCalculationReturnsCorrectValues(5.739025024925009d, 241.19384779497875d, score);
31+
}
32+
33+
[Fact]
34+
public void TestAccuracyParameter()
35+
{
36+
var score = new CatchScore
37+
{
38+
BeatmapId = "diffcalc-test",
39+
Mods = 80, // HR, DT
40+
Accuracy = 0.9583333333333334,
41+
Combo = 100,
42+
Misses = 5,
43+
};
44+
base.TestGetCalculationReturnsCorrectValues(5.739025024925009d, 241.19384779497875d, score);
45+
}
1746
}

Difficalcy.Catch/Difficalcy.Catch.csproj

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="ppy.osu.Game.Rulesets.Catch" Version="2023.1114.1" />
9-
<PackageReference Include="ppy.osu.Game.Rulesets.Osu" Version="2023.1114.1" /> <!-- required for convert support -->
8+
<PackageReference Include="ppy.osu.Game.Rulesets.Catch" Version="2024.412.1" />
9+
<PackageReference Include="ppy.osu.Game.Rulesets.Osu" Version="2024.412.1" /> <!-- required for convert support -->
1010
</ItemGroup>
1111

1212
<ItemGroup>
1313
<ProjectReference Include="../Difficalcy/Difficalcy.csproj" />
1414
</ItemGroup>
1515

16+
<ItemGroup Label="Resources">
17+
<EmbeddedResource Include="Resources\**\*.*" />
18+
</ItemGroup>
19+
1620
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
osu file format v14
2+
3+
[General]
4+
StackLeniency: 0.3
5+
Mode: 2
6+
7+
[Difficulty]
8+
CircleSize:4
9+
OverallDifficulty:7
10+
ApproachRate:8.3
11+
SliderMultiplier:1.6
12+
SliderTickRate:1
13+
14+
[TimingPoints]
15+
500,500,4,2,1,50,1,0
16+
34500,-50,4,2,1,50,0,0
17+
18+
[HitObjects]
19+
// fruits spaced 1/1 beat apart
20+
32,128,0,5,0,0:0:0:0:
21+
96,128,500,1,0,0:0:0:0:
22+
160,128,1000,1,0,0:0:0:0:
23+
224,128,1500,1,0,0:0:0:0:
24+
288,128,2000,1,0,0:0:0:0:
25+
352,128,2500,1,0,0:0:0:0:
26+
416,128,3000,1,0,0:0:0:0:
27+
480,128,3500,1,0,0:0:0:0:
28+
29+
// fruits spaced 1/2 beat apart
30+
32,160,4500,1,0,0:0:0:0:
31+
64,160,4750,1,0,0:0:0:0:
32+
96,160,5000,1,0,0:0:0:0:
33+
128,160,5250,1,0,0:0:0:0:
34+
160,160,5500,1,0,0:0:0:0:
35+
192,160,5750,1,0,0:0:0:0:
36+
224,160,6000,1,0,0:0:0:0:
37+
256,160,6250,1,0,0:0:0:0:
38+
288,160,6500,1,0,0:0:0:0:
39+
40+
// fruits spaced 1/4 beat apart
41+
96,128,7500,1,0,0:0:0:0:
42+
128,128,7625,1,0,0:0:0:0:
43+
160,128,7750,1,0,0:0:0:0:
44+
192,128,7875,1,0,0:0:0:0:
45+
224,128,8000,1,0,0:0:0:0:
46+
256,128,8125,1,0,0:0:0:0:
47+
288,128,8250,1,0,0:0:0:0:
48+
320,128,8375,1,0,0:0:0:0:
49+
352,128,8500,1,0,0:0:0:0:
50+
51+
// fruit hyperdashes, spaced 1/2 beat apart
52+
32,160,9500,1,0,0:0:0:0:
53+
480,160,9750,1,0,0:0:0:0:
54+
32,160,10000,1,0,0:0:0:0:
55+
480,160,10250,1,0,0:0:0:0:
56+
32,160,10500,1,0,0:0:0:0:
57+
480,160,10750,1,0,0:0:0:0:
58+
32,160,11000,1,0,0:0:0:0:
59+
60+
// fruit hyperdashes, spaced 1/4 beat apart
61+
32,192,12000,1,0,0:0:0:0:
62+
480,192,12125,1,0,0:0:0:0:
63+
32,192,12250,1,0,0:0:0:0:
64+
480,192,12375,1,0,0:0:0:0:
65+
32,192,12500,1,0,0:0:0:0:
66+
480,192,12625,1,0,0:0:0:0:
67+
32,192,12750,1,0,0:0:0:0:
68+
480,192,12875,1,0,0:0:0:0:
69+
32,192,13000,1,0,0:0:0:0:
70+
71+
// stream + hyperdash + stream, spaced 1/4 beat apart
72+
32,192,14000,1,0,0:0:0:0:
73+
64,192,14125,1,0,0:0:0:0:
74+
96,192,14250,1,0,0:0:0:0:
75+
128,192,14375,1,0,0:0:0:0:
76+
480,192,14500,1,0,0:0:0:0:
77+
448,192,14625,1,0,0:0:0:0:
78+
416,192,14750,1,0,0:0:0:0:
79+
384,192,14875,1,0,0:0:0:0:
80+
32,192,15000,1,0,0:0:0:0:
81+
82+
// basic sliders
83+
32,192,16000,2,0,L|192:192,1,160
84+
224,192,17000,2,0,L|384:192,1,160
85+
416,192,17875,2,0,L|480:192,1,40
86+
87+
// slider hyperdashes, spaced 1/4 beat apart
88+
32,192,19000,2,0,L|128:192,1,80
89+
480,192,19375,2,0,L|384:192,1,80
90+
352,192,19750,2,0,L|256:192,1,80
91+
0,192,20125,2,0,L|128:192,1,120
92+
93+
// stream + slider hyperdashes, spaced 1/4 beat apart
94+
32,192,21500,1,0,0:0:0:0:
95+
64,192,21625,1,0,0:0:0:0:
96+
96,192,21750,1,0,0:0:0:0:
97+
512,192,21875,2,0,L|320:192,1,160
98+
320,192,22500,1,0,0:0:0:0:
99+
288,192,22625,1,0,0:0:0:0:
100+
256,192,22750,1,0,0:0:0:0:
101+
0,192,22875,2,0,L|64:192,1,40
102+
103+
// streams, spaced 1/4 beat apart
104+
64,192,24000,1,0,0:0:0:0:
105+
160,192,24125,1,0,0:0:0:0:
106+
64,192,24250,1,0,0:0:0:0:
107+
160,192,24375,1,0,0:0:0:0:
108+
64,192,24500,1,0,0:0:0:0:
109+
160,192,24625,1,0,0:0:0:0:
110+
64,192,24750,1,0,0:0:0:0:
111+
160,192,24875,1,0,0:0:0:0:
112+
64,192,25000,1,0,0:0:0:0:
113+
160,192,25125,1,0,0:0:0:0:
114+
64,192,25250,1,0,0:0:0:0:
115+
160,192,25375,1,0,0:0:0:0:
116+
64,192,25500,1,0,0:0:0:0:
117+
118+
// stream + spinner combo, spaced 1/4 beat apart
119+
256,192,26500,12,0,27000,0:0:0:0:
120+
128,192,27250,5,0,0:0:0:0:
121+
128,192,27375,1,0,0:0:0:0:
122+
160,192,27500,1,0,0:0:0:0:
123+
192,192,27625,1,0,0:0:0:0:
124+
256,192,27750,12,0,28500,0:0:0:0:
125+
192,192,28625,5,0,0:0:0:0:
126+
224,192,28750,1,0,0:0:0:0:
127+
256,192,28875,1,0,0:0:0:0:
128+
256,192,29000,1,0,0:0:0:0:
129+
256,192,29125,12,0,29500,0:0:0:0:
130+
131+
// long slow slider
132+
0,192,30500,6,0,B|480:192|480:192|0:192,2,960
133+
134+
// long fast slider
135+
0,192,37500,6,0,B|480:192|480:192|0:192,2,960
136+
137+
// long hyperdash slider
138+
0,192,41500,2,0,P|544:192|544:192,5,480

Difficalcy.Catch/Services/CatchCalculatorService.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ protected override CatchPerformance CalculatePerformance(CatchScore score, objec
8989
var hitResultCount = beatmap.HitObjects.Count(h => h is Fruit) + beatmap.HitObjects.OfType<JuiceStream>().SelectMany(j => j.NestedHitObjects).Count(h => !(h is TinyDroplet));
9090
var combo = score.Combo ?? hitResultCount;
9191
var statistics = determineHitResults(score.Accuracy ?? 1, hitResultCount, beatmap, score.Misses ?? 0, score.TinyDroplets, score.Droplets);
92-
var accuracy = score.Accuracy ?? calculateAccuracy(statistics);
92+
var accuracy = calculateAccuracy(statistics);
9393

94-
var scoreInfo = new ScoreInfo()
94+
var scoreInfo = new ScoreInfo(beatmap.BeatmapInfo, CatchRuleset.RulesetInfo)
9595
{
9696
Accuracy = accuracy,
9797
MaxCombo = combo,

Difficalcy.Catch/Startup.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Reflection;
12
using Difficalcy.Catch.Services;
23
using Microsoft.Extensions.Configuration;
34
using Microsoft.Extensions.DependencyInjection;
@@ -12,7 +13,7 @@ public Startup(IConfiguration configuration) : base(configuration) { }
1213

1314
public override string OpenApiVersion => "v1";
1415

15-
protected override string TestBeatmapAssembly => "osu.Game.Rulesets.Catch";
16+
protected override string TestBeatmapAssembly => Assembly.GetExecutingAssembly().GetName().Name;
1617

1718
public override void ConfigureCalculatorServices(IServiceCollection services)
1819
{

Difficalcy.Mania.Tests/ManiaCalculatorServiceTest.cs

+34-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,42 @@ namespace Difficalcy.Mania.Tests;
77

88
public class ManiaCalculatorServiceTest : CalculatorServiceTest<ManiaScore, ManiaDifficulty, ManiaPerformance, ManiaCalculation>
99
{
10-
protected override CalculatorService<ManiaScore, ManiaDifficulty, ManiaPerformance, ManiaCalculation> CalculatorService { get; } = new ManiaCalculatorService(new InMemoryCache(), new TestBeatmapProvider("osu.Game.Rulesets.Mania"));
10+
protected override CalculatorService<ManiaScore, ManiaDifficulty, ManiaPerformance, ManiaCalculation> CalculatorService { get; } = new ManiaCalculatorService(new InMemoryCache(), new TestBeatmapProvider(typeof(ManiaCalculatorService).Assembly.GetName().Name));
1111

1212
[Theory]
13-
[InlineData(2.3493769750220914d, 45.71911573894849d, "diffcalc-test", 0)]
14-
[InlineData(2.797245912537965d, 68.73627121504641d, "diffcalc-test", 64)]
13+
[InlineData(2.3493769750220914d, 45.76140071089439d, "diffcalc-test", 0)]
14+
[InlineData(2.797245912537965d, 68.79984443279172d, "diffcalc-test", 64)]
1515
public void Test(double expectedDifficultyTotal, double expectedPerformanceTotal, string beatmapId, int mods)
1616
=> base.TestGetCalculationReturnsCorrectValues(expectedDifficultyTotal, expectedPerformanceTotal, new ManiaScore { BeatmapId = beatmapId, Mods = mods });
17+
18+
[Fact]
19+
public void TestAllParameters()
20+
{
21+
var score = new ManiaScore
22+
{
23+
BeatmapId = "diffcalc-test",
24+
Mods = 64, // DT
25+
Misses = 5,
26+
Mehs = 4,
27+
Oks = 3,
28+
Goods = 2,
29+
Greats = 1,
30+
};
31+
base.TestGetCalculationReturnsCorrectValues(2.797245912537965d, 43.17076331130473d, score);
32+
}
33+
34+
[Fact]
35+
public void TestAccuracyParameter()
36+
{
37+
var score = new ManiaScore
38+
{
39+
BeatmapId = "diffcalc-test",
40+
Mods = 64, // DT
41+
Accuracy = 0.9271523178807947,
42+
Misses = 5,
43+
};
44+
// expected pp is slightly higher than above test because there is a different solution to
45+
// the hitresult distribution that yields the same accuracy but gives slightly higher pp
46+
base.TestGetCalculationReturnsCorrectValues(2.797245912537965d, 43.455530879321245d, score);
47+
}
1748
}

Difficalcy.Mania/Difficalcy.Mania.csproj

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="ppy.osu.Game.Rulesets.Mania" Version="2023.1114.1" />
9-
<PackageReference Include="ppy.osu.Game.Rulesets.Osu" Version="2023.1114.1" /> <!-- required for convert support -->
8+
<PackageReference Include="ppy.osu.Game.Rulesets.Mania" Version="2024.412.1" />
9+
<PackageReference Include="ppy.osu.Game.Rulesets.Osu" Version="2024.412.1" /> <!-- required for convert support -->
1010
</ItemGroup>
1111

1212
<ItemGroup>
1313
<ProjectReference Include="../Difficalcy/Difficalcy.csproj" />
1414
</ItemGroup>
1515

16+
<ItemGroup Label="Resources">
17+
<EmbeddedResource Include="Resources\**\*.*" />
18+
</ItemGroup>
19+
1620
</Project>

Difficalcy.Mania/Models/ManiaScore.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ namespace Difficalcy.Mania.Models
44
{
55
public record ManiaScore : Score
66
{
7-
public int? TotalScore { get; init; }
7+
public double? Accuracy { get; init; }
8+
public int? Misses { get; init; }
9+
public int? Mehs { get; init; }
10+
public int? Oks { get; init; }
11+
public int? Goods { get; init; }
12+
public int? Greats { get; init; }
813
}
914
}

0 commit comments

Comments
 (0)