Welcome to TechNet Blogs Sign in | Join | Help

The Applied Games Group Blog

New stuff directly from Microsoft Research.
TrueSkill in F#

Following the publication of the F# source code for the TrueSkill Through Time paper, we have used the same inference library code to demonstrate how the original TrueSkill algorithm can be coded. In the attached source code, only the program.fs file is different to the TrueSkill through Time blog post and it builds up the factor graph for an arbitrary N-player game with an arbitrary draw probability. Both these numbers can be entered on the command line when running the resulting sample. We tried to make sure to stay as close as possible to the description on page 3 of the TrueSkill technical report.

The attached ZIP file contains the entire source code which should compile without problems with F# 1.9.3.14. You can either load the solution in Visual Studio 2008 or simply run build.bat form the command line - in either case you will end up with a trueskill.exe program.

Update: Following the release of the F# September 2008 CTP we have updated the source code to work with F# 1.9.6.2. Also, we added one of the new features of F#, namely units-of-measure, which makes the TrueSkill update invocation calls now read as follows:

    let priorMu = 25.0<SkillPoints>

    let priorSigma = priorMu / 3.0

    let priorSkills = Array.init noPlayers (fun i -> Gaussian.Create (priorMu, priorSigma))

    let (posteriorSkills, logZ) =

        NPlayerTrueSkillUpdate (0.5*priorSigma, 0.01*priorSigma, drawProb / 100.0) priorSkills

Note that one can no longer accidentally pass the variance instead of the standard deviation beceause the former being of type float<SkillPoints^2>. Try yourself!

 

Ralf Herbrich & Thore Graepel

Posted: Monday, June 16, 2008 5:25 AM by apg
Attachment(s): TrueSkill - CTP.zip

Comments

Josh Menke said:

Hey thanks guys, this is great!

# June 16, 2008 11:23 AM

Nick said:

Is it possible to go up in rank after you lose a match?

# July 28, 2008 4:34 PM

IncaWarrior said:

Very nice sample program, but it doesn't show how TrueSkill handles team games.

Any hope of seeing how this works? The details page says that teams are compared using a sum of the players, but that doesn't show how each of the players are updated after that comparison.  

Is it just a comparison of each player on the other team after that?

# August 4, 2008 6:06 PM

Aaron's Technology Musings said:

Some time ago, I speculated that F# should be the lingua-franca of BI . Well, had I done a little research,

# September 11, 2008 1:15 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker