Skip to content

Commit

Permalink
hardcode wife params
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Dec 30, 2016
1 parent 4c1d116 commit 5ee64fa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/HighScore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,15 +627,15 @@ float HighScore::RescoreToWifeJudge(int x) {
float ts = tso[x-1];
float p = 0;
FOREACH_CONST(float, m_Impl->vOffsetVector, f)
p += wife2(*f * 1000.f, ts * 95.f, 2.f, 2, -8);
p += wife2(*f, ts);

return p / (m_Impl->vOffsetVector.size() * 2);
}

float HighScoreImpl::RescoreToWifeTS(float ts) {
float p = 0;
FOREACH_CONST(float, vOffsetVector, f)
p += wife2(*f * 1000.f, ts * 95.f, 2.f, 2, -8);
p += wife2(*f, ts);

return p / (vOffsetVector.size() * 2);
}
Expand Down Expand Up @@ -712,12 +712,12 @@ float HighScore::ConvertDpToWife() {
float ts = 1.f;
float estpoints = 0.f;
float maxpoints = 0.f;
estpoints += m_Impl->iTapNoteScores[TNS_W1] * wife2(22.49f, ts * 95.f, 2.f, 2, -8);
estpoints += m_Impl->iTapNoteScores[TNS_W2] * wife2(44.99f, ts * 95.f, 2.f, 2, -8);
estpoints += m_Impl->iTapNoteScores[TNS_W3] * wife2(89.99f, ts * 95.f, 2.f, 2, -8);
estpoints += m_Impl->iTapNoteScores[TNS_W4] * wife2(134.99f, ts * 95.f, 2.f, 2, -8);
estpoints += m_Impl->iTapNoteScores[TNS_W5] * wife2(179.99f, ts * 95.f, 2.f, 2, -8);
estpoints += m_Impl->iTapNoteScores[TNS_Miss] * wife2(179.99f, ts * 95.f, 2.f, 2, -8);
estpoints += m_Impl->iTapNoteScores[TNS_W1] * wife2(.002249f, ts);
estpoints += m_Impl->iTapNoteScores[TNS_W2] * wife2(.004499f, ts);
estpoints += m_Impl->iTapNoteScores[TNS_W3] * wife2(.008999f, ts);
estpoints += m_Impl->iTapNoteScores[TNS_W4] * wife2(.013499f, ts);
estpoints += m_Impl->iTapNoteScores[TNS_W5] * wife2(.017999f, ts);
estpoints += m_Impl->iTapNoteScores[TNS_Miss] * wife2(.017999f, ts);

FOREACH_ENUM(TapNoteScore, tns)
maxpoints += 2 * m_Impl->iTapNoteScores[tns];
Expand Down
2 changes: 1 addition & 1 deletion src/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3191,7 +3191,7 @@ void Player::SetJudgment( int iRow, int iTrack, const TapNote &tn, TapNoteScore
if (tns == TNS_Miss)
curwifescore -= 8;
else
curwifescore += wife2(tn.result.fTapNoteOffset * 1000.f, m_fTimingWindowScale * 95.f, 2.f, 2, -8);
curwifescore += wife2(tn.result.fTapNoteOffset, m_fTimingWindowScale);

maxwifescore += 2;
msg.SetParam("WifePercent", 100 * curwifescore / maxwifescore);
Expand Down
8 changes: 5 additions & 3 deletions src/RageUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ inline bool ENUM_CLAMP( T &x, T l, T h )
return false;
}

inline float wife2(float maxms, float avedeviation, float power, int upperbound, int lowerbound) {
inline float wife2(float maxms, float ts) {
maxms = maxms*1000.f;
float avedeviation = 95.f * ts;
float y = 1 - static_cast<float>(pow(2, -1 * maxms*maxms / (avedeviation*avedeviation)));
y = pow(y, power);
return (upperbound - lowerbound)*(1 - y) + lowerbound;
y = pow(y, 2);
return (2 - -8)*(1 - y) + -8;
}

inline void wrap( int &x, int n )
Expand Down

0 comments on commit 5ee64fa

Please sign in to comment.