[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pbmserv-dev] Solitaire game scoring



A rolling average for solitaire game ratings has been tested using the following formula (N = 10):

Once  totalplayed >= N, then it becomes a rolling average of the last
N games played

                   ((N-1) * oldrating) + currentscore
    newrating = ----------------------------------------------
                              N

This works pretty well. One problem is that values are stored as integers so some pretty hideous rounding occurs during the calculation.


It turns out that the user's rating changes by 1 pt for every N pts their score differs from their current average. For instance, if the user's score is less than 10 pts different from their current average there is no change, if it is 73 pts different then the average changes by 7 etc.

This becomes obvious if we substitute "currentscore = oldrating + difference":

                  ((N-1) * oldrating) + (oldrating + difference)
    newrating =  ------------------------------------------------
                              N

                   N * oldrating + difference
    newrating =  -----------------------------
                              N

newrating = oldrating + difference/N

and integer rounding makes this a pretty chunky increment.