more flashlight fixes

This commit is contained in:
MaxOhn
2021-11-08 19:44:58 +01:00
parent 6041da3d50
commit 5f2942f94a
5 changed files with 20 additions and 16 deletions
+2 -2
View File
@@ -54,7 +54,7 @@ fn custom_osu() {
use crate::{Beatmap, OsuPP};
let path = "E:Games/osu!/beatmaps/70090.osu";
let path = "E:Games/osu!/beatmaps/809469.osu";
let file = File::open(path).unwrap();
let start = Instant::now();
@@ -76,7 +76,7 @@ fn custom_osu() {
println!("Parsing average: {:?}", accum / iters);
let start = Instant::now();
let result = OsuPP::new(&map).mods(8 + 16 + 64).calculate();
let result = OsuPP::new(&map).mods(66).calculate();
let iters = 100;
let accum = start.elapsed();
@@ -32,7 +32,7 @@ impl<'h> DifficultyObject<'h> {
// We don't need to calculate either angle or distance
// when one of the last->curr objects is a spinner
let (jump_dist, angle) = if base.is_spinner() {
let (jump_dist, angle) = if base.is_spinner() || prev.is_spinner() {
(0.0, None)
} else {
let jump_dist = ((pos - prev_cursor_pos) * scaling_factor).length();
+2 -2
View File
@@ -88,7 +88,7 @@ impl OsuObject {
(100.0 / slider_state.slider_velocity).max(10.0).min(1000.0) / 100.0;
}
// Build the curve w.r.t. the curve points
// Build the curve w.r.t. the control points
let curve = Curve::new(control_points, *pixel_len, curve_bufs);
let velocity =
@@ -182,7 +182,7 @@ impl OsuObject {
compute_vertex(final_progress);
let mut end_pos = h.pos + curve.position_at(progress);
let mut end_pos = h.pos + curve.position_at(1.0 - progress);
travel_dist *= *scaling_factor;
if hr {
+6
View File
@@ -50,6 +50,12 @@ impl Skill {
}
pub(crate) fn difficulty_value(&mut self) -> f32 {
// println!("---");
// for (i, strain) in self.strain_peaks.iter().enumerate() {
// println!("[{}] {}", i, strain);
// }
let mut difficulty = 0.0;
let mut weight = 1.0;
let decay_weight = self.kind.decay_weight();
+9 -11
View File
@@ -167,13 +167,12 @@ impl SkillKind {
let jump_dist = (curr.base.pos - prev.end_pos).length();
cumulative_strain_time += prev.strain_time;
// We want to nerf objects that can be easily seen within the Flashlight circle radius
// * We want to nerf objects that can be easily seen within the Flashlight circle radius
small_dist_nerf = (jump_dist / 75.0).min(1.0);
// We also want to nerf stacks so that only the first object of the stack is accounted for
// * We also want to nerf stacks so that only the first object of the stack is accounted for
// -- since jump distance is 0 on stacked notes in this version, approximate value as 0.2
let stack_nerf =
((prev.jump_dist / scaling_factor) / 25.0).min(1.0).max(0.2);
let stack_nerf = ((prev.jump_dist / scaling_factor) / 25.0).min(1.0);
result += stack_nerf * scaling_factor * jump_dist / cumulative_strain_time;
}
@@ -184,8 +183,7 @@ impl SkillKind {
if !prev.is_spinner {
let jump_dist = (curr.base.pos - prev.end_pos).length();
cumulative_strain_time += prev.strain_time;
let stack_nerf =
((prev.jump_dist / scaling_factor) / 25.0).min(1.0).max(0.2);
let stack_nerf = ((prev.jump_dist / scaling_factor) / 25.0).min(1.0);
result += factor * stack_nerf * scaling_factor * jump_dist
/ cumulative_strain_time;
@@ -211,7 +209,7 @@ impl SkillKind {
let speed_window_ratio = strain_time / hit_window_full;
let prev = history.front();
// Aim to nerf cheesy rhythms (very fast consecutive doubles with large delta times between)
// * Aim to nerf cheesy rhythms (very fast consecutive doubles with large delta times between)
if let Some(prev) =
prev.filter(|p| strain_time < hit_window_full && p.strain_time > strain_time)
{
@@ -219,12 +217,12 @@ impl SkillKind {
math_util::lerp(prev.strain_time, strain_time, speed_window_ratio);
}
// Cap delta time to the OD 300 hit window
// 0.93 is derived from making sure 260bpm OD8 streams aren't nerfed harshly,
// whilst 0.92 limits the effect of the cap
// * Cap delta time to the OD 300 hit window
// * 0.93 is derived from making sure 260bpm OD8 streams aren't nerfed harshly,
// * whilst 0.92 limits the effect of the cap
strain_time /= (strain_time / hit_window_full / 0.93).clamp(0.92, 1.0);
// Derive speed bonus for calculation
// * Derive speed bonus for calculation
let mut speed_bonus = 1.0;
if strain_time < MIN_SPEED_BONUS {