[ View Thread ] [ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

BGonline.org Forums

Its a start

Posted By: Tomawaky
Date: Thursday, 18 June 2009, at 6:21 p.m.

In Response To: Its a start (Rich Munitz)

Right, here is the formula I used at FLG.

$n = $Length ; // the length of the match
$P1 = $resV[1] ; // the rating of the winner Player 1
$P2 = $resP[1] ; // the rating of the loser Player 2
$E1 = $resV[2] ; // the experience of Player 1 right before finishing the match
$E2 = $resP[2] ; // the experience of Player 2 right before finishing the match
$PE1 = max(1, 5-(($E1+$n)/100)) ; // experience factor for Player 1 (calculated)
$PE2 = max(1, 5-(($E2+$n)/100)) ; // experience factor for Player 2 (calculated)
$D = Abs($P1-$P2) ; // the difference between the two ratings (calculated)
$U = 1/(pow(10,$D*sqrt($n)/2000)+1) ; // the probability of the underdog winning the match (calculated)
$F = 1-$U ; // the probability of the favorite winning the match (calculated)

$ExperienceV = $resV[2] + $Length;
if ($P1 > $P2) // If Player 1 is higher rated and wins, P1's rating increases
{ $RatingV = $P1 + 4*$PE1*sqrt($n)*$U ; }
else // If Player 1 is lower rated and wins, P1's rating increases
{ $RatingV = $P1 + 4*$PE1*sqrt($n)*$F ; }

$ExperienceP = $resP[2] + $Length;
if ($P2 > $P1) // If Player 2 is higher rated and loses, P2's rating decreases
{ $RatingP = $P2 - 4*$PE2*sqrt($n)*$F ; }
else // If Player 2 is lower rated and loses, P2's rating decreases
{ $RatingP = $P2 - 4*$PE2*sqrt($n)*$U ; }

Messages In This Thread

 

Post Response

Your Name:
Your E-Mail Address:
Subject:
Message:

If necessary, enter your password below:

Password:

 

 

[ View Thread ] [ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

BGonline.org Forums is maintained by Stick with WebBBS 5.12.