Skip to content

Commit

Permalink
Temporarily add adjusted speed UR to proto data
Browse files Browse the repository at this point in the history
  • Loading branch information
Rian8337 committed Oct 23, 2023
1 parent 4ab85a5 commit 38563b9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/database/utils/elainaDb/UserBind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,32 @@ export class UserBind extends Manager {
continue;
}

const { performance: perfResult } = liveAttribs;
const { performance: rebalPerfResult, params } = rebalAttribs;
const { performance: perfResult, params } = liveAttribs;
const { performance: rebalPerfResult, params: rebalParams } =
rebalAttribs;

const { customStatistics, accuracy: accuracyData } = params;
const accuracy = new Accuracy(accuracyData);

// This is moved from dpp calculation to minimize core module change.
// Normalize the deviation to 300 BPM.
const normalizedDeviation: number =
rebalPerfResult.tapDeviation *
Math.max(1, 50 / rebalAttribs.difficulty.averageSpeedDeltaTime);
// We expect the player to get 7500/x deviation when doubletapping x BPM.
// Using this expectation, we penalize scores with deviation above 25.
const averageBPM: number =
60000 / 4 / rebalAttribs.difficulty.averageSpeedDeltaTime;
const adjustedDeviation: number =
normalizedDeviation *
(1 +
1 /
(1 +
Math.exp(
-(normalizedDeviation - 7500 / averageBPM) /
((2 * 300) / averageBPM),
)));

const entry: PrototypePPEntry = {
uid: score.uid,
hash: beatmapInfo.hash,
Expand Down Expand Up @@ -490,6 +510,10 @@ export class UserBind extends Manager {
rebalPerfResult.tapDeviation * 10,
2,
),
adjustedSpeedUnstableRate: NumberHelper.round(
adjustedDeviation * 10,
2,
),
overallDifficulty: rebalAttribs.difficulty.overallDifficulty,
hit300: accuracy.n300,
hit100: accuracy.n100,
Expand Down
5 changes: 5 additions & 0 deletions src/structures/dpp/PrototypePPEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ export interface PrototypePPEntry extends PPEntry {
*/
estimatedSpeedUnstableRate: number;

/**
* The adjusted speed unstable rate of the score. Used to penalize for vibro.
*/
adjustedSpeedUnstableRate: number;

/**
* The evaluated overall difficulty of the score.
*/
Expand Down

0 comments on commit 38563b9

Please sign in to comment.