# Example ranking calculation

Xplorers to 15JohnTim
Game Score 169
Current Ranking Score 150120
Game Count 305
```First cap the scores to the max-points and normalise to 100:
Score John = min( points , maxPoints ) / maxPoints * 100 = 15 / 15 * 100 = 100
Score Tim  = min( 9 , 15 ) / 15 * 100 = 9 / 15 * 100 = 60

Now calculate John's score:
A) win-lose-factor:
WLF = +1	(John won, so he RECEIVES points)
B) diff-opponent-factor:
They played each other 1 time before so opponentCount = 1
gameCount > 10, so:
DOFa = opponentCount / gameCount - 0.1 = 1 / 30 - 0.1 = 0.03 - 0.1 = -0.07
This value should always fit in the range of 0 - 0.5 (min-max( 0 > DOF < 0.5 ) = 0
DOF = 1 - 0 * 2 = 1  (so this is optimal)
C) diff-ranking-factor:
DRFa = ranking John - ranking Tim   = 150 - 120 = 30
DRFb = min-max( -250 > DRFa < 250 ) = 30
DRF  = (250 - DRFb) / (2*250) = (250 - 30) / 500 = 220 / 500 = 0.44
D) diff-score-factor:
DSFa = score John - score Tim = 100 - 60 = 40
DSF = min-max( 0 > DSFa < 50 ) = min-max( 0 > 50 < 50 ) = 40

Score John = WLF * DOF * DRF * DSF = +1 * 1 * 0.44 * 40 = +18 ranking points

Now calculate Tim's score:
A) WFL  = -1 (Tim lost so LOSES points)
B) DOFa = 1 / 5 - 0.1 = 0.2 - 0.1 = 0.1
DOF  = 1 - 0.1 * 2 = 0.8
C) DRFa = 120 - 150 = -30
DRFb = 30
DRF  = (250 + 30) / 500 = 0.56
( note: 0.56 (DRF Tim) + 0.44 (DRF John) = always 1 )
D) DSFa = 80 - 130 = -50
DSF  = absoluut( -50 ) = 40
(note: always equal for both players)

Score Tim = WLF * DOF * DRF * DSF = -1 * 0.8 * 0.56 * 40 = -18 ranking points
(note: In most cases the ranking points are the negative of each other)
```