taiko: fixed & tested pp
This commit is contained in:
@@ -14,7 +14,7 @@ A standalone crate to calculate star ratings and performance points for all [osu
|
|||||||
- [x] mania sr
|
- [x] mania sr
|
||||||
---
|
---
|
||||||
- [x] osu pp (need testing!)
|
- [x] osu pp (need testing!)
|
||||||
- [x] taiko pp (need testing!)
|
- [x] taiko pp
|
||||||
- [x] ctb pp
|
- [x] ctb pp
|
||||||
- [x] mania pp
|
- [x] mania pp
|
||||||
---
|
---
|
||||||
|
|||||||
+2
-2
@@ -173,7 +173,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
#[ignore]
|
#[ignore]
|
||||||
fn taiko_single() {
|
fn taiko_single() {
|
||||||
let file = match File::open("E:/Games/osu!/beatmaps/1097541.osu") {
|
let file = match File::open("E:/Games/osu!/beatmaps/168450.osu") {
|
||||||
Ok(file) => file,
|
Ok(file) => file,
|
||||||
Err(why) => panic!("Could not open file: {}", why),
|
Err(why) => panic!("Could not open file: {}", why),
|
||||||
};
|
};
|
||||||
@@ -183,7 +183,7 @@ mod tests {
|
|||||||
Err(why) => panic!("Error while parsing map: {}", why),
|
Err(why) => panic!("Error while parsing map: {}", why),
|
||||||
};
|
};
|
||||||
|
|
||||||
let result = PpCalculator::new(&map).mods(256).calculate();
|
let result = PpCalculator::new(&map).mods(64).calculate();
|
||||||
|
|
||||||
println!("Stars: {}", result.stars);
|
println!("Stars: {}", result.stars);
|
||||||
println!("PP: {}", result.pp);
|
println!("PP: {}", result.pp);
|
||||||
|
|||||||
+13
-6
@@ -38,7 +38,7 @@ impl<'m> PpCalculator<'m> {
|
|||||||
mods: 0,
|
mods: 0,
|
||||||
max_combo,
|
max_combo,
|
||||||
combo: None,
|
combo: None,
|
||||||
acc: 100.0,
|
acc: 1.0,
|
||||||
n_misses: 0,
|
n_misses: 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -94,11 +94,8 @@ impl<'m> PpCalculator<'m> {
|
|||||||
multiplier *= 1.1;
|
multiplier *= 1.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Consider HR & co?
|
|
||||||
let hit_window = difficulty_range_od(self.map.od) as i32 as f32 / self.mods.speed();
|
|
||||||
|
|
||||||
let strain_value = self.compute_strain_value(stars);
|
let strain_value = self.compute_strain_value(stars);
|
||||||
let acc_value = self.compute_accuracy_value(hit_window);
|
let acc_value = self.compute_accuracy_value();
|
||||||
|
|
||||||
let pp = (strain_value.powf(1.1) + acc_value.powf(1.1)).powf(1.0 / 1.1) * multiplier;
|
let pp = (strain_value.powf(1.1) + acc_value.powf(1.1)).powf(1.0 / 1.1) * multiplier;
|
||||||
|
|
||||||
@@ -131,7 +128,17 @@ impl<'m> PpCalculator<'m> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn compute_accuracy_value(&self, hit_window: f32) -> f32 {
|
fn compute_accuracy_value(&self) -> f32 {
|
||||||
|
let mut od = self.map.od;
|
||||||
|
|
||||||
|
if self.mods.hr() {
|
||||||
|
od *= 1.4;
|
||||||
|
} else if self.mods.ez() {
|
||||||
|
od *= 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
let hit_window = difficulty_range_od(od) / self.mods.speed();
|
||||||
|
|
||||||
(150.0 / hit_window).powf(1.1)
|
(150.0 / hit_window).powf(1.1)
|
||||||
* self.acc.powi(15)
|
* self.acc.powi(15)
|
||||||
* 22.0
|
* 22.0
|
||||||
|
|||||||
+3
-3
@@ -13,7 +13,7 @@ struct MapResult {
|
|||||||
#[test]
|
#[test]
|
||||||
fn taiko() {
|
fn taiko() {
|
||||||
let star_margin = 0.001;
|
let star_margin = 0.001;
|
||||||
let pp_margin = 0.001;
|
let pp_margin = 0.0075;
|
||||||
|
|
||||||
for result in RESULTS {
|
for result in RESULTS {
|
||||||
let MapResult {
|
let MapResult {
|
||||||
@@ -75,8 +75,8 @@ const RESULTS: &[MapResult] = &[
|
|||||||
MapResult {
|
MapResult {
|
||||||
map_id: 110219,
|
map_id: 110219,
|
||||||
mods: 64,
|
mods: 64,
|
||||||
stars: 5.137432251440863,
|
stars: 6.785308286298745,
|
||||||
pp: 253.6918375585501,
|
pp: 420.66337091577,
|
||||||
},
|
},
|
||||||
// -----
|
// -----
|
||||||
MapResult {
|
MapResult {
|
||||||
|
|||||||
Reference in New Issue
Block a user