From e04eb7d113a5eb10901f66b73ca81fb46e5285de Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Thu, 27 Feb 2014 19:28:11 -0600 Subject: [PATCH] Rating decay and other ladder tweaks We now have a rating decay of -1/day at 1400, -2/day at 1450, -3/day at 1500, etc. This roughly translates to a fall from the top of OU to the bottom over a month of full inactivity, which is somewhat harsh considering it's done regardless of inactivity. I might tweak this to be less harsh later. There's no rating decay below 1400. People can stay there as long as they want. The only other tweak is that K is now 40 at >1300 instead of >1400. Very very slight tweak so that ratings in the 1300-1500 range are very very slightly more precise. --- lib/ntbb-ladder.lib.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/ntbb-ladder.lib.php b/lib/ntbb-ladder.lib.php index 87821f4ed..f27776c9c 100755 --- a/lib/ntbb-ladder.lib.php +++ b/lib/ntbb-ladder.lib.php @@ -255,6 +255,8 @@ class NTBBLadder { return false; } + $elo = $user['rating']['acre']; + $rating = new GlickoPlayer($user['rating']['r'], $user['rating']['rd']); if ($user['rating']['rpdata']) { $rpdata = explode('##',$user['rating']['rpdata']); @@ -274,10 +276,16 @@ class NTBBLadder { $rating->rating += $offset; $offset = 0; } + + if ($elo >= 1400) { + $elo -= 1 + intval(($elo-1400)/50); + } + $user['rating']['rptime'] = $this->nextrp($user['rating']['rptime']); } $user['rating']['r'] = $rating->rating; $user['rating']['rd'] = $rating->rd; + $user['rating']['lacre'] = $user['rating']['acre'] = $elo; } if ($newM) { @@ -324,9 +332,8 @@ class NTBBLadder { $user['rating']['rpdata'] .= '##'.$offset; } - if ($newM) { - $elo = $user['rating']['oldacre'] = $user['rating']['acre']; + $user['rating']['oldacre'] = $elo; $K = 50; if ($elo < 1100) { @@ -335,7 +342,7 @@ class NTBBLadder { } else if ($newM['score'] > 0.5) { $K = 80 - ($elo - 1000)*30/100; } - } else if ($elo > 1400) { + } else if ($elo > 1300) { $K = 40; } else if ($elo > 1600) { $K = 32;