This should be an example calculator for a possible bbc rating. The aim of the rating is to estimate the current strength of a player as good as possible.
This page uses the rating 5.
You do not need to know the full details on how the rating will be computed, because this is very complicated. Here are some basic principles:
| Place | Old Rating | New Rating | Difference | played games |
|---|---|---|---|---|
| 1 | 5000 | 5421 | 421 | 1 |
| 2 | 5000 | 5273 | 273 | 1 |
| 3 | 5000 | 5193 | 193 | 1 |
| 4 | 5000 | 5113 | 113 | 1 |
| 5 | 5000 | 5033 | 33 | 1 |
| 6 | 5000 | 4953 | -47 | 1 |
| 7 | 5000 | 4873 | -127 | 1 |
| 8 | 5000 | 4793 | -207 | 1 |
| 9 | 5000 | 4713 | -287 | 1 |
| 10 | 5000 | 4633 | -367 | 1 |
function noobratingmain($ratings,$gamec,$probdiff=3000,$startspeed=80,$minspeed=40,$mingames=30,$winbonus=1.17)
{
/*
this is the core function of the bbc rating.
it was programmed by some supernoob :)
$ratings and $gamec are arrays of the same size
the size is the number of players
player with index 0 is winner, 9 is place 10
gamec is the number of games played before this game
*/
if(count($ratings) !=count($gamec) or count($ratings)>=11) return 0; //error
$NN=count($ratings); // $NN is the number of players in the game
$newrating=$ratings; // newrating will be return array
for($i1=0;$i1<$NN;$i1++)
{
$expect=0.0; // $expect is the expected score for each player
for($i2=0;$i2<$NN;$i2++)
{
if($i1==$i2) continue;
$diff = (float)($ratings[$i2]-$ratings[$i1]); //compare rating difference with each player
if($i2==0 or $i1==0) $expect += $winbonus/(1.0 + pow(2.0,$diff/$probdiff)); // add expected score for winners
if($i2!=0 and $i1!=0) $expect += 1.0/(1.0 + pow(2.0,$diff/$probdiff)); // add expected score for non-winners
}
if($gamec[$i1]<$mingames) $speed2 = (float)$startspeed + (float)($minspeed-$startspeed)*($gamec[$i1])/($mingames);
if($gamec[$i1]>=$mingames)$speed2=$minspeed; // determine the "speed" according to parameters
$wonpoints=$NN-$i1-1; //
if($i1==0) $wonpoints=$winbonus*9.0; // winners get more points
$newrating[$i1] =$ratings[$i1] + (int) ceil($speed2*($wonpoints - $expect) -0.5); //round the rating points to integer
}
return $newrating;
}
site views (clicks, all sites): 10665189
Server Time: 2020-12-30 00:15:22
Login (Admin Tools)