feat: update mania calc

This commit is contained in:
MaxOhn
2024-09-28 19:57:02 +02:00
parent a02b8a8323
commit c7b5414a8a
4 changed files with 12 additions and 13 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ use crate::{
use super::{ use super::{
object::ManiaDifficultyObject, skills::strain::Strain, DifficultyValues, object::ManiaDifficultyObject, skills::strain::Strain, DifficultyValues,
ManiaDifficultyAttributes, ManiaObject, STAR_SCALING_FACTOR, ManiaDifficultyAttributes, ManiaObject, DIFFICULTY_MULTIPLIER,
}; };
/// Gradually calculate the difficulty attributes of an osu!mania map. /// Gradually calculate the difficulty attributes of an osu!mania map.
@@ -136,7 +136,7 @@ impl Iterator for ManiaGradualDifficulty {
self.idx += 1; self.idx += 1;
Some(ManiaDifficultyAttributes { Some(ManiaDifficultyAttributes {
stars: self.strain.as_difficulty_value() * STAR_SCALING_FACTOR, stars: self.strain.as_difficulty_value() * DIFFICULTY_MULTIPLIER,
hit_window: self.hit_window, hit_window: self.hit_window,
max_combo: self.curr_combo, max_combo: self.curr_combo,
n_objects: self.idx as u32, n_objects: self.idx as u32,
+2 -2
View File
@@ -14,7 +14,7 @@ pub mod gradual;
mod object; mod object;
mod skills; mod skills;
const STAR_SCALING_FACTOR: f64 = 0.018; const DIFFICULTY_MULTIPLIER: f64 = 0.018;
pub fn difficulty( pub fn difficulty(
difficulty: &Difficulty, difficulty: &Difficulty,
@@ -31,7 +31,7 @@ pub fn difficulty(
.od; .od;
ManiaDifficultyAttributes { ManiaDifficultyAttributes {
stars: values.strain.difficulty_value() * STAR_SCALING_FACTOR, stars: values.strain.difficulty_value() * DIFFICULTY_MULTIPLIER,
hit_window, hit_window,
max_combo: values.max_combo, max_combo: values.max_combo,
n_objects, n_objects,
+6 -5
View File
@@ -9,7 +9,7 @@ use crate::{
const INDIVIDUAL_DECAY_BASE: f64 = 0.125; const INDIVIDUAL_DECAY_BASE: f64 = 0.125;
const OVERALL_DECAY_BASE: f64 = 0.3; const OVERALL_DECAY_BASE: f64 = 0.3;
const RELEASE_THRESHOLD: f64 = 24.0; const RELEASE_THRESHOLD: f64 = 30.0;
const SKILL_MULTIPLIER: f64 = 1.0; const SKILL_MULTIPLIER: f64 = 1.0;
const STRAIN_DECAY_BASE: f64 = 1.0; const STRAIN_DECAY_BASE: f64 = 1.0;
@@ -87,11 +87,12 @@ impl Strain {
for i in 0..self.end_times.len() { for i in 0..self.end_times.len() {
// * The current note is overlapped if a previous note or end is overlapping the current note body // * The current note is overlapped if a previous note or end is overlapping the current note body
is_overlapping |= is_overlapping |= self.end_times[i] > start_time + 1.0
self.end_times[i] > start_time + 1.0 && end_time > self.end_times[i] + 1.0; && end_time > self.end_times[i] + 1.0
&& start_time > self.start_times[i] + 1.0;
// * We give a slight bonus to everything if something is held meanwhile // * We give a slight bonus to everything if something is held meanwhile
if self.end_times[i] > end_time + 1.0 { if self.end_times[i] > end_time + 1.0 && start_time > self.start_times[i] + 1.0 {
hold_factor = 1.25; hold_factor = 1.25;
} }
@@ -109,7 +110,7 @@ impl Strain {
// * 0.0 +--------+-+---------------> Release Difference / ms // * 0.0 +--------+-+---------------> Release Difference / ms
// * release_threshold // * release_threshold
if is_overlapping { if is_overlapping {
hold_addition = (1.0 + (0.5 * (RELEASE_THRESHOLD - closest_end_time)).exp()).recip(); hold_addition = (1.0 + (0.27 * (RELEASE_THRESHOLD - closest_end_time)).exp()).recip();
} }
// * Decay and increase individualStrains in own column // * Decay and increase individualStrains in own column
+2 -4
View File
@@ -863,9 +863,7 @@ struct ManiaPerformanceInner<'mods> {
impl ManiaPerformanceInner<'_> { impl ManiaPerformanceInner<'_> {
fn calculate(self) -> ManiaPerformanceAttributes { fn calculate(self) -> ManiaPerformanceAttributes {
// * Arbitrary initial value for scaling pp in order to standardize distributions across game modes. let mut multiplier = 1.0;
// * The specific number has no intrinsic meaning and can be adjusted as needed.
let mut multiplier = 8.0;
if self.mods.nf() { if self.mods.nf() {
multiplier *= 0.75; multiplier *= 0.75;
@@ -887,7 +885,7 @@ impl ManiaPerformanceInner<'_> {
fn compute_difficulty_value(&self) -> f64 { fn compute_difficulty_value(&self) -> f64 {
// * Star rating to pp curve // * Star rating to pp curve
(self.attrs.stars - 0.15).max(0.05).powf(2.2) 8.0 * (self.attrs.stars - 0.15).max(0.05).powf(2.2)
// * From 80% accuracy, 1/20th of total pp is awarded per additional 1% accuracy // * From 80% accuracy, 1/20th of total pp is awarded per additional 1% accuracy
* (5.0 * self.calculate_custom_accuracy() - 4.0).max(0.0) * (5.0 * self.calculate_custom_accuracy() - 4.0).max(0.0)
// * Length bonus, capped at 1500 notes // * Length bonus, capped at 1500 notes