imagebanner

Rating calculator

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.

small explanation

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:

The number of games each player has played so far can also have an influence on the rating points, therefor there is an extra column.
If you want to know, how things look like if you consider many games, here is an example computation: (click here). it uses all BBC games in 2013. you can even get a graph of players of their rating over time.

Example calculation

Input

System parameters:
Difference between Players:
Speed at Start: Normal Speed:
first games:
Bonus for Winner:
#RatingGames played
Winner
Place 2
Place 3
Place 4
Place 5
Place 6
Place 7
Place 8
Place 9
Place 10
Number of Players (2-10):

Results

PlaceOld RatingNew RatingDifferenceplayed games
1500054214211
2500052732731
3500051931931
4500051131131
550005033331
650004953-471
750004873-1271
850004793-2071
950004713-2871
1050004633-3671

Source code

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): 2780863    Server Time: 2017-12-12 18:35:50
login

>> SPECTATE BBC <<