updated osu's clockrate bugfix

mania: updated to osu's clockrate bugfix

taiko: updated to osu's clockrate bugfix

fruits: updated to osu's clockrate bugfix
This commit is contained in:
MaxOhn
2021-08-09 11:39:12 +02:00
parent dc3486201f
commit cc8c893866
12 changed files with 65 additions and 55 deletions
+3
View File
@@ -2,6 +2,9 @@
- Reduced amount of required features of `async_std` and `async_tokio`
- Fixed a panic for some mania difficulty calculations on converts
- Updated the difficulty & pp changes from 21.07.27
- Fixed dead loop when reading empty `.osu` files ([#2] - [@Pure-Peace])
- Updated osu's clockrate bugfix for all modes
# v0.2.2
+3
View File
@@ -7,6 +7,7 @@ pub(crate) struct DifficultyObject<'o> {
pub(crate) last: &'o CatchObject,
pub(crate) delta: f32,
pub(crate) start_time: f32,
pub(crate) normalized_pos: f32,
pub(crate) last_normalized_pos: f32,
@@ -24,6 +25,7 @@ impl<'o> DifficultyObject<'o> {
clock_rate: f32,
) -> Self {
let delta = (base.time - last.time) / clock_rate;
let start_time = base.time / clock_rate;
let strain_time = delta.max(40.0);
let scaling_factor = NORMALIZED_HITOBJECT_RADIUS / half_catcher_width;
@@ -34,6 +36,7 @@ impl<'o> DifficultyObject<'o> {
base,
last,
delta,
start_time,
normalized_pos,
last_normalized_pos,
strain_time,
+4 -4
View File
@@ -227,7 +227,7 @@ pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> S
while h.base.time > current_section_end {
movement.save_current_peak();
movement.start_new_section_from(current_section_end);
movement.start_new_section_from(current_section_end / attributes.clock_rate);
current_section_end += section_len;
}
@@ -247,7 +247,7 @@ pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> S
while h.base.time > current_section_end {
movement.save_current_peak();
movement.start_new_section_from(current_section_end);
movement.start_new_section_from(current_section_end / attributes.clock_rate);
current_section_end += section_len;
}
@@ -451,7 +451,7 @@ pub fn strains(map: &Beatmap, mods: impl Mods) -> Strains {
while h.base.time > current_section_end {
movement.save_current_peak();
movement.start_new_section_from(current_section_end);
movement.start_new_section_from(current_section_end / attributes.clock_rate);
current_section_end += section_len;
}
@@ -471,7 +471,7 @@ pub fn strains(map: &Beatmap, mods: impl Mods) -> Strains {
while h.base.time > current_section_end {
movement.save_current_peak();
movement.start_new_section_from(current_section_end);
movement.start_new_section_from(current_section_end / attributes.clock_rate);
current_section_end += section_len;
}
+1 -1
View File
@@ -59,7 +59,7 @@ impl Movement {
self.current_strain *= strain_decay(current.delta);
self.current_strain += self.strain_value_of(&current) * SKILL_MULTIPLIER;
self.current_section_peak = self.current_strain.max(self.current_section_peak);
self.prev_time.replace(current.base.time);
self.prev_time.replace(current.start_time);
}
pub(crate) fn difficulty_value(&mut self) -> f32 {
+4 -2
View File
@@ -74,7 +74,7 @@ pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> S
for h in hit_objects {
while h.base.start_time > current_section_end {
strain.save_current_peak();
strain.start_new_section_from(current_section_end);
strain.start_new_section_from(current_section_end / clock_rate);
current_section_end += section_len;
}
@@ -126,7 +126,7 @@ pub fn strains(map: &Beatmap, mods: impl Mods) -> Strains {
for h in hit_objects {
while h.base.start_time > current_section_end {
strain.save_current_peak();
strain.start_new_section_from(current_section_end);
strain.start_new_section_from(current_section_end / clock_rate);
current_section_end += section_len;
}
@@ -147,6 +147,7 @@ pub(crate) struct DifficultyHitObject<'o> {
base: &'o HitObject,
column: usize,
delta: f32,
start_time: f32,
}
impl<'o> DifficultyHitObject<'o> {
@@ -159,6 +160,7 @@ impl<'o> DifficultyHitObject<'o> {
base,
column,
delta: (base.start_time - prev.start_time) / clock_rate,
start_time: base.start_time / clock_rate,
}
}
}
+1 -1
View File
@@ -67,7 +67,7 @@ impl Strain {
self.current_strain *= self.strain_decay(current.delta);
self.current_strain += self.strain_value_of(&current) * SKILL_MULTIPLIER;
self.current_section_peak = self.current_strain.max(self.current_section_peak);
self.prev_time.replace(current.base.start_time);
self.prev_time.replace(current.start_time);
}
fn strain_value_of(&mut self, current: &DifficultyHitObject) -> f32 {
+2
View File
@@ -8,6 +8,7 @@ pub(crate) struct DifficultyObject<'o> {
pub(crate) prev: &'o HitObject,
pub(crate) delta: f32,
pub(crate) rhythm: &'static HitObjectRhythm,
pub(crate) start_time: f32,
}
impl<'o> DifficultyObject<'o> {
@@ -28,6 +29,7 @@ impl<'o> DifficultyObject<'o> {
prev,
delta,
rhythm,
start_time: base.start_time / clock_rate,
}
}
}
+2 -2
View File
@@ -84,7 +84,7 @@ pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> S
while h.base.start_time > current_section_end {
for skill in skills.iter_mut() {
skill.save_current_peak();
skill.start_new_section_from(current_section_end);
skill.start_new_section_from(current_section_end / clock_rate);
}
current_section_end += section_len;
@@ -172,7 +172,7 @@ pub fn strains(map: &Beatmap, mods: impl Mods) -> Strains {
while h.base.start_time > current_section_end {
for skill in skills.iter_mut() {
skill.save_current_peak();
skill.start_new_section_from(current_section_end);
skill.start_new_section_from(current_section_end / clock_rate);
}
current_section_end += section_len;
+1 -1
View File
@@ -53,7 +53,7 @@ impl Skill {
self.current_strain +=
self.kind.strain_value_of(&current, cheese) * self.skill_multiplier();
self.current_section_peak = self.current_section_peak.max(self.current_strain);
self.prev_time.replace(current.base.start_time);
self.prev_time.replace(current.start_time);
}
#[inline]
+16 -16
View File
@@ -114,8 +114,8 @@ const RESULTS: &[MapResult] = &[
MapResult {
map_id: 1977380,
mods: 256,
stars: 2.0564713386286573,
pp: 45.1590377326849,
stars: 2.053266215316665,
pp: 45.018113339112304,
},
MapResult {
map_id: 1977380,
@@ -132,8 +132,8 @@ const RESULTS: &[MapResult] = &[
MapResult {
map_id: 1977380,
mods: 64,
stars: 3.589887228221038,
pp: 141.14620680718699,
stars: 3.5912721232736073,
pp: 141.25524875691985,
},
MapResult {
map_id: 1977380,
@@ -151,8 +151,8 @@ const RESULTS: &[MapResult] = &[
MapResult {
map_id: 1974968,
mods: 256,
stars: 1.9544305373156605,
pp: 42.91338693937752,
stars: 1.9502416666346483,
pp: 42.729265293038324,
},
MapResult {
map_id: 1974968,
@@ -169,8 +169,8 @@ const RESULTS: &[MapResult] = &[
MapResult {
map_id: 1974968,
mods: 64,
stars: 3.650649037957456,
pp: 139.53871429136828,
stars: 3.655540489429042,
pp: 139.91329907739348,
},
MapResult {
map_id: 1974968,
@@ -188,8 +188,8 @@ const RESULTS: &[MapResult] = &[
MapResult {
map_id: 2420076,
mods: 256,
stars: 4.791039358886245,
pp: 258.46694642171224,
stars: 4.789614811665553,
pp: 258.3131405278226,
},
MapResult {
map_id: 2420076,
@@ -206,8 +206,8 @@ const RESULTS: &[MapResult] = &[
MapResult {
map_id: 2420076,
mods: 64,
stars: 8.908315960310958,
pp: 1138.695343583009,
stars: 8.910276701845461,
pp: 1139.1968785738873,
},
MapResult {
map_id: 2420076,
@@ -225,8 +225,8 @@ const RESULTS: &[MapResult] = &[
MapResult {
map_id: 2206596,
mods: 256,
stars: 4.767182611189798,
pp: 300.15942914986067,
stars: 4.7660034867565795,
pp: 300.0108412850544,
},
MapResult {
map_id: 2206596,
@@ -243,8 +243,8 @@ const RESULTS: &[MapResult] = &[
MapResult {
map_id: 2206596,
mods: 64,
stars: 8.93391286552717,
pp: 1315.2112887084272,
stars: 8.937404638714733,
pp: 1316.2400280229178,
},
MapResult {
map_id: 2206596,
+12 -12
View File
@@ -114,8 +114,8 @@ const RESULTS: &[MapResult] = &[
MapResult {
map_id: 1355822,
mods: 256,
stars: 2.2710870990702627,
pp: 43.654638516311564,
stars: 2.2684169993943653,
pp: 43.53325918930298,
},
MapResult {
map_id: 1355822,
@@ -126,15 +126,15 @@ const RESULTS: &[MapResult] = &[
MapResult {
map_id: 1355822,
mods: 64,
stars: 3.748525363730352,
pp: 140.25944202912322,
stars: 3.7490047677821776,
pp: 140.30066841634704,
},
// -----
MapResult {
map_id: 1974394,
mods: 256,
stars: 3.8736942117487256,
pp: 155.79817482289727,
stars: 3.873141963622833,
pp: 155.74720954392703,
},
MapResult {
map_id: 1974394,
@@ -145,15 +145,15 @@ const RESULTS: &[MapResult] = &[
MapResult {
map_id: 1974394,
mods: 64,
stars: 6.517894438878535,
pp: 508.4849982082652,
stars: 6.518026726802542,
pp: 508.5082744648102,
},
// -----
MapResult {
map_id: 992512,
mods: 256,
stars: 5.29507262961579,
pp: 317.82741466200764,
stars: 5.282601951185166,
pp: 316.1318109880581,
},
MapResult {
map_id: 992512,
@@ -164,7 +164,7 @@ const RESULTS: &[MapResult] = &[
MapResult {
map_id: 992512,
mods: 64,
stars: 8.944195050951032,
pp: 1035.4596772151892,
stars: 8.974411542576131,
pp: 1043.3119173151915,
},
];
+16 -16
View File
@@ -114,8 +114,8 @@ const RESULTS: &[MapResult] = &[
MapResult {
map_id: 110219,
mods: 256,
stars: 4.090461690284154,
pp: 172.2934532692781,
stars: 4.08968885024159,
pp: 172.2618767481684,
},
MapResult {
map_id: 110219,
@@ -126,15 +126,15 @@ const RESULTS: &[MapResult] = &[
MapResult {
map_id: 110219,
mods: 64,
stars: 6.785308286298745,
pp: 420.66337091577,
stars: 6.7868926972961,
pp: 420.7721479461209,
},
// -----
MapResult {
map_id: 168450,
mods: 256,
stars: 3.9102755155437663,
pp: 159.66231311695273,
stars: 3.906304814419791,
pp: 159.50978823553345,
},
MapResult {
map_id: 168450,
@@ -145,15 +145,15 @@ const RESULTS: &[MapResult] = &[
MapResult {
map_id: 168450,
mods: 64,
stars: 5.894260068145283,
pp: 352.08717183038954,
stars: 5.900723352868479,
pp: 352.4632039368069,
},
// -----
MapResult {
map_id: 1097541,
mods: 256,
stars: 4.0027499635116595,
pp: 181.18594125657705,
stars: 4.001086710846427,
pp: 181.1195995270953,
},
MapResult {
map_id: 1097541,
@@ -164,15 +164,15 @@ const RESULTS: &[MapResult] = &[
MapResult {
map_id: 1097541,
mods: 64,
stars: 6.587467490088248,
pp: 433.97174733352375,
stars: 6.588219669147997,
pp: 434.0217833573784,
},
// -----
MapResult {
map_id: 1432878,
mods: 256,
stars: 3.5850143199594258,
pp: 127.27033873288904,
stars: 3.5826958150176584,
pp: 127.191831998499,
},
MapResult {
map_id: 1432878,
@@ -183,7 +183,7 @@ const RESULTS: &[MapResult] = &[
MapResult {
map_id: 1432878,
mods: 64,
stars: 5.908970879987477,
pp: 307.9875634986321,
stars: 5.912036178782906,
pp: 308.1608793395345,
},
];