Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(score): multiroom player skill calculation #528

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

anthroplankton
Copy link
Contributor

Description

Fix getMultiSkillRate form calculating "scale factor" to calculating "rate of change".

Related Issue

#403
#404

Motivation and Context

The scores in the multiplayer mode calculated by the "Song Recommender" website differ from those shown of the game.

The getMultiSkillRate function previously implemented the formula for "effective skill powers" based on the game's mechanics before the official change. The previous implementation:

const getMultiSkillRate = useCallback((skillRates: number[]) => {
let multiSkillRate = 1 + skillRates[0];
skillRates.forEach((v, i) => {
if (i > 0) multiSkillRate *= 1 + v / 5;
});
return multiSkillRate - 1;
}, []);

The old formula was:
$\left(1+ \mathtt{skill}_1\right) \cdot \left(1+ \frac{\mathtt{skill}_2}{5}\right) \cdot \left(1+ \frac{\mathtt{skill}_3}{5}\right) \cdot \left(1+ \frac{\mathtt{skill}_4}{5}\right) \cdot \left(1+ \frac{\mathtt{skill}_5}{5}\right) - 1$,
which represents a "rate of change".

The implementation in src/utils/scoreCalc.ts is based on representing an "effective skill power" as a "rate of change" .

Therefore, the updated formula should also represent a "rate of change," which is:
$\mathtt{skill}_1 + \frac{\mathtt{skill}_2}{5} + \frac{\mathtt{skill}_3}{5} + \frac{\mathtt{skill}_4}{5} + \frac{\mathtt{skill}_5}{5}$.

How Has This Been Tested?

  • Chrome (Desktop)
  • Chrome (Mobile)
  • Firefox (Desktop)
  • Firefox (Mobile)
  • Safari (Desktop, optional)
  • Safari (iPhone, optional)
  • Safari (iPad, optional)

Screenshots (if appropriate):

@dnaroma dnaroma merged commit 2e57de8 into Sekai-World:dev Nov 27, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants