From 5ee64fa06b08393f24bb9623f7f6c4b0618d991b Mon Sep 17 00:00:00 2001 From: MinaciousGrace Date: Fri, 30 Dec 2016 17:28:57 -0500 Subject: [PATCH] hardcode wife params --- src/HighScore.cpp | 16 ++++++++-------- src/Player.cpp | 2 +- src/RageUtil.h | 8 +++++--- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/HighScore.cpp b/src/HighScore.cpp index f3fa230341..de7a093331 100644 --- a/src/HighScore.cpp +++ b/src/HighScore.cpp @@ -627,7 +627,7 @@ 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); } @@ -635,7 +635,7 @@ float HighScore::RescoreToWifeJudge(int x) { 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); } @@ -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]; diff --git a/src/Player.cpp b/src/Player.cpp index 92a1dea45c..e508dd541b 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -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); diff --git a/src/RageUtil.h b/src/RageUtil.h index 96bdb37295..8dc26d632e 100644 --- a/src/RageUtil.h +++ b/src/RageUtil.h @@ -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(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 )