Change the Arena Rating system to reflect the official system more.

Under 1000 rating the max rating gained should be 48.
Between 1000 rating and 1300 rating the max rating gained should move from 48 to 24.
Above 1300 rating the max rating gained is 24.
Team Rating and Personal Rating use this formula now.

--HG--
branch : trunk
This commit is contained in:
Liberate
2010-08-28 13:31:13 +02:00
parent 350ba75fc4
commit 2228a8f8d9
3 changed files with 33 additions and 15 deletions
+31 -13
View File
@@ -654,8 +654,10 @@ int32 ArenaTeam::WonAgainst(uint32 againstRating)
// calculate the rating modification // calculate the rating modification
// simulation on how it works. Not much info on how it really works // simulation on how it works. Not much info on how it really works
int32 mod; int32 mod;
if (m_stats.rating < 1500) if (m_stats.rating < 1000)
mod = (int32)ceil(48.0f * (1.0f - chance) * (1.0f - chance)); mod = (int32)ceil(48.0f * (1.0f - chance));
else if (m_stats.rating < 1300)
mod = (int32)ceil((24.0f + (24.0f * (1300 - m_stats.rating) / 300)) * (1.0f - chance));
else else
mod = (int32)ceil(24.0f * (1.0f - chance)); mod = (int32)ceil(24.0f * (1.0f - chance));
@@ -668,21 +670,19 @@ int32 ArenaTeam::WonAgainst(uint32 againstRating)
return mod; return mod;
} }
int32 ArenaTeam::LostAgainst(uint32 againstRating, bool winnerlowrating) int32 ArenaTeam::LostAgainst(uint32 againstRating)
{ {
// called when the team has lost // called when the team has lost
//'chance' calculation - to loose to the opponent //'chance' calculation - to loose to the opponent
float chance = GetChanceAgainst(m_stats.rating, againstRating); float chance = GetChanceAgainst(m_stats.rating, againstRating);
if (m_stats.rating < 1000)
{
FinishGame(0);
return 0;
}
// calculate the rating lost // calculate the rating lost
// there is not much info on the formula, but this is a very good simulation // there is not much info on the formula, but this is a very good simulation
int32 mod; int32 mod;
if (winnerlowrating) if (m_stats.rating < 1000)
mod = (int32)floor(48.0f * chance * chance) * -1; mod = (int32)floor(48.0f * (0.0f - chance));
else if (m_stats.rating < 1300)
mod = (int32)floor((24.0f + (24.0f * (1300 - m_stats.rating) / 300)) * (0.0f - chance));
else else
mod = (int32)floor(24.0f * (0.0f - chance)); mod = (int32)floor(24.0f * (0.0f - chance));
@@ -703,7 +703,13 @@ void ArenaTeam::MemberLost(Player * plr, uint32 againstMatchmakerRating)
// update personal rating // update personal rating
float chance = GetChanceAgainst(itr->personal_rating, m_stats.rating); float chance = GetChanceAgainst(itr->personal_rating, m_stats.rating);
// calculate the rating modification // calculate the rating modification
int32 mod = (int32)floor(24.0f * (0.0f - chance)); int32 mod;
if (itr->personal_rating < 1000)
mod = (int32)floor(48.0f * (0.0f - chance));
else if (itr->personal_rating < 1300)
mod = (int32)floor((24.0f + (24.0f * (1300 - m_stats.rating) / 300)) * (0.0f - chance));
else
mod = (int32)floor(24.0f * (0.0f - chance));
itr->ModifyPersonalRating(plr, mod, GetSlot()); itr->ModifyPersonalRating(plr, mod, GetSlot());
// update matchmaker rating // update matchmaker rating
chance = GetChanceAgainst(itr->matchmaker_rating, againstMatchmakerRating); chance = GetChanceAgainst(itr->matchmaker_rating, againstMatchmakerRating);
@@ -731,7 +737,13 @@ void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating)
// update personal rating // update personal rating
float chance = GetChanceAgainst(itr->personal_rating, m_stats.rating); float chance = GetChanceAgainst(itr->personal_rating, m_stats.rating);
// calculate the rating modification // calculate the rating modification
int32 mod = (int32)ceil(24.0f * (0.0f - chance)); int32 mod;
if (itr->personal_rating < 1000)
mod = (int32)floor(48.0f * (0.0f - chance));
else if (itr->personal_rating < 1300)
mod = (int32)floor((24.0f + (24.0f * (1300 - m_stats.rating) / 300)) * (0.0f - chance));
else
mod = (int32)floor(24.0f * (0.0f - chance));
itr->ModifyPersonalRating(NULL, mod, GetSlot()); itr->ModifyPersonalRating(NULL, mod, GetSlot());
// update matchmaker rating // update matchmaker rating
chance = GetChanceAgainst(itr->matchmaker_rating, againstMatchmakerRating); chance = GetChanceAgainst(itr->matchmaker_rating, againstMatchmakerRating);
@@ -757,7 +769,13 @@ void ArenaTeam::MemberWon(Player * plr, uint32 againstMatchmakerRating)
// update personal rating // update personal rating
float chance = GetChanceAgainst(itr->personal_rating, m_stats.rating); float chance = GetChanceAgainst(itr->personal_rating, m_stats.rating);
// calculate the rating modification // calculate the rating modification
int32 mod = (int32)ceil(24.0f * (1.0f - chance)); int32 mod;
if (itr->personal_rating < 1000)
mod = (int32)ceil(48.0f * (1.0f - chance) * (1.0f - chance));
else if (itr->personal_rating < 1300)
mod = (int32)ceil((24.0f + (24.0f * (1300 - m_stats.rating) / 300)) * (1.0f - chance));
else
mod = (int32)ceil(24.0f * (1.0f - chance));
itr->ModifyPersonalRating(plr, mod, GetSlot()); itr->ModifyPersonalRating(plr, mod, GetSlot());
// update matchmaker rating // update matchmaker rating
chance = GetChanceAgainst(matchmakerrating, againstMatchmakerRating); chance = GetChanceAgainst(matchmakerrating, againstMatchmakerRating);
+1 -1
View File
@@ -200,7 +200,7 @@ class ArenaTeam
float GetChanceAgainst(uint32 own_rating, uint32 enemy_rating); float GetChanceAgainst(uint32 own_rating, uint32 enemy_rating);
int32 WonAgainst(uint32 againstRating); int32 WonAgainst(uint32 againstRating);
void MemberWon(Player * plr, uint32 againstMatchmakerRating); void MemberWon(Player * plr, uint32 againstMatchmakerRating);
int32 LostAgainst(uint32 againstRating, bool winnerlowrating); int32 LostAgainst(uint32 againstRating);
void MemberLost(Player * plr, uint32 againstMatchmakerRating); void MemberLost(Player * plr, uint32 againstMatchmakerRating);
void OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating); void OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating);
@@ -731,7 +731,7 @@ void Battleground::EndBattleground(uint32 winner)
winner_team_rating = winner_arena_team->GetRating(); winner_team_rating = winner_arena_team->GetRating();
winner_matchmaker_rating = winner_arena_team->GetAverageMMR(GetBgRaid(winner)); winner_matchmaker_rating = winner_arena_team->GetAverageMMR(GetBgRaid(winner));
int32 winner_change = winner_arena_team->WonAgainst(loser_matchmaker_rating); int32 winner_change = winner_arena_team->WonAgainst(loser_matchmaker_rating);
int32 loser_change = loser_arena_team->LostAgainst(winner_matchmaker_rating, winner_team_rating < 1500); int32 loser_change = loser_arena_team->LostAgainst(winner_matchmaker_rating);
sLog.outDebug("--- Winner rating: %u, Loser rating: %u, Winner MMR: %u, Loser MMR: %u, Winner change: %u, Losser change: %u ---", winner_team_rating, loser_team_rating, sLog.outDebug("--- Winner rating: %u, Loser rating: %u, Winner MMR: %u, Loser MMR: %u, Winner change: %u, Losser change: %u ---", winner_team_rating, loser_team_rating,
winner_matchmaker_rating, loser_matchmaker_rating, winner_change, loser_change); winner_matchmaker_rating, loser_matchmaker_rating, winner_change, loser_change);
SetArenaTeamRatingChangeForTeam(winner, winner_change); SetArenaTeamRatingChangeForTeam(winner, winner_change);