AllegSkill
Stub This article is incomplete This is an article about a topic that should be covered in more detail by the FreeAllegiance Wiki, but is lacking in content.
You can help by improving it!
AllegSkill is a system for rating the skill of Allegiance players based on their overall performance in-game. AllegSkill is based on the Trueskill system developed by Microsoft Research (who also developed Allegiance) with some notable additions. The term 'AllegSkill' is intended to refer to the entire system, which includes additional statistics, and Microsoft Research should not be held responsible for differences when and where the occur.
Technical details
What follows is the simplest incarnation of the Trueskill update algorithm, as used for commander ratings. We've provided as much information as is sensible, and we only assume that the reader is familiar with (or able to look up) the error function (<math>\text{erf}</math>).
This scenario pits a newbie commander (<math>\,\!\mu_A = 25; \sigma_A = 8.333...</math>) against a slightly more experienced commander (<math>\,\!\mu_B = 32; \sigma_B = 5</math>).
Getting ready
Now let's put some letters and functions on the field:
- <math>\beta = \frac{25}{6} </math> is the standard variance around performance
- <math>\gamma = \frac{25}{300}</math> is the dynamics variable, which prevents sigma from ever reaching zero
- <math>\varepsilon \simeq 0.08</math> is derived empirically from the percentage of games which result in a draw, currently ~1.01%.
We will use a normal distribution (with a mean of zero and variance of one), and more precisely its probability density function:
- <math>\text{PDF}(x):=\frac{1}{\sqrt{2\pi}} \cdot e^{-\frac{x^2}{2}}</math>
We will also use its cumulative distribution function:
- <math>\text{CDF}(y):=\frac{1}{2}+\frac{1}{2}\cdot\text{erf}\left( \frac{1}{\sqrt{2}} y\right)</math>.
The update formulas
The Trueskill update functions follow:
- <math>V_{win}(t,\varepsilon) := \frac{ \text{PDF}(t-\varepsilon)}{\text{CDF}(t-\varepsilon) }</math>; this formula is used to update a player's <math>\,\!\mu</math>.
- <math>W_{win}(t,\varepsilon) := V_{win}(t,\varepsilon) \cdot \left( V_{win}(t,\varepsilon )+t-\varepsilon \right)</math>; this formula is used to update a player's <math>\,\!\sigma</math>.
- <math>V_{draw}(t,\varepsilon ):=\frac{PDF(-\varepsilon -t)-PDF(\varepsilon -t)}{CDF(\varepsilon -t)-CDF(-\varepsilon -t)}</math>
- <math>W_{draw}(t,\varepsilon ):=V_{draw}^{2}(t,\varepsilon )\cdot \frac{(\varepsilon -t)\cdot PDF(\varepsilon -t)+(\varepsilon +t)PDF(\varepsilon +t)}{CDF(\varepsilon -t)-CDF(-\varepsilon -t)}</math>
The V and W functions are the core of the Trueskill system, and vary depending on whether the game resulted in a win or a draw. In both instances, positive values for t represent an unsurprising outcome: The winner was more skilled than the loser. Positive values result in the functions returning small values, which in turn result in small <math>\mu</math> and <math>\sigma</math> updates. The converse is also true: Negative values for t represent a surprising outcome, and result in large updates.
We also need to introduce a variable that expresses the general uncertainty of the system:
- <math>c=\sqrt{2\beta ^{2}+\sigma _{w}^{2}+\sigma _{l}^{2}}</math>
This value is used throughout the calculation.
Here is how the formulas are actually used:
| Mu | Sigma | |
|---|---|---|
| Winner | <math>\mu '_{w}=\mu _{w}+\frac{\sigma _{w}^{2}}{c}\cdot V_{win}\left( \frac{\mu _{w}-\mu _{l}}{c},\frac{\varepsilon }{c} \right)</math> | <math>\sigma '_{w}=\sqrt{\sigma _{w}^{2}\left( 1-\frac{\sigma _{w}^{2}}{c^{2}}\cdot W_{win}\left( \frac{\mu _{w}-\mu _{l}}{c},\frac{\varepsilon }{c} \right) \right)+\gamma ^{2}}</math> |
| Loser | <math>\mu '_{l}=\mu _{l}-\frac{\sigma _{l}^{2}}{c}\cdot V_{win}\left( \frac{\mu _{w}-\mu _{l}}{c},\frac{\varepsilon }{c} \right)</math> | <math>\sigma '_{l}=\sqrt{\sigma _{l}^{2}\left( 1-\frac{\sigma _{l}^{2}}{c^{2}}\cdot W_{win}\left( \frac{\mu _{w}-\mu _{l}}{c},\frac{\varepsilon }{c} \right) \right)+\gamma ^{2}}</math> |
AllegSkill in action
Let's now get our favourite computer assisted algebra system and do the calculations. Let's assume the experienced commander, B, won.
- <math>c = \frac{5}{6}\sqrt{186}</math>
- <math>\mu '_{B}=32+\frac{\text{0}\text{.09195636321}\sqrt{186}\sqrt{2}}{\sqrt{\pi }}</math>
- <math>\,\!\mu '_{B}=\text{33}\text{.00064106}</math>
- <math>\sigma '_{B}=\sqrt{\frac{3601}{144}-\frac{\text{2}\text{.758690898}\sqrt{2}\left( \frac{\text{0}\text{.5701294519}\sqrt{2}}{\sqrt{\pi }}+\text{0}\text{.04463650105}\sqrt{186} \right)}{\sqrt{\pi }}}</math>
- <math>\,\!\sigma '_{B}=\text{4}\text{.760851650}</math>
- <math>\mu '_{A}=25-\frac{\text{0}\text{.2554343423}\sqrt{186}\sqrt{2}}{\sqrt{\pi }}</math>
- <math>\,\!\mu '_{A}=\text{22}\text{.22044149}</math>
- <math>\sigma '_{A}=\sqrt{\frac{10001}{144}-\frac{\text{21}\text{.28619519}\sqrt{2}\left( \frac{\text{0}\text{.5701294519}\sqrt{2}}{\sqrt{\pi }}+\text{0}\text{.04463650105}\sqrt{186} \right)}{\sqrt{\pi }}}</math>
- <math>\,\!\sigma '_{A}=\text{7}\text{.168423552}</math>
Now let's run the same scenario in reverse, with commander A winning.
- <math>c = \frac{5}{6}\sqrt{186}</math>
- <math>\mu '_{A}=25+\frac{\text{0}\text{.6919672626}\sqrt{186}\sqrt{2}}{\sqrt{\pi }}</math>
- <math>\,\!\mu '_{A}=\text{32}\text{.52977643}</math>
- <math>\sigma '_{A}=\sqrt{\frac{10001}{144}-\frac{\text{57}\text{.66393855}\sqrt{2}\left( \frac{\text{1}\text{.544470930}\sqrt{2}}{\sqrt{\pi }}+\text{0}\text{.04568607959}\sqrt{186} \right)}{\sqrt{\pi }}}</math>
- <math>\,\!\sigma '_{A}=\text{6}\text{.435916375}</math>
- <math>\mu '_{B}=32-\frac{\text{0}\text{.2491082145}\sqrt{186}\sqrt{2}}{\sqrt{\pi }}</math>
- <math>\,\!\mu '_{B}=\text{29}\text{.28928048}</math>
- <math>\sigma '_{B}=\sqrt{\frac{\text{3601}}{144}-\frac{\text{7}\text{.473246435}\sqrt{2}\left( \frac{\text{1}\text{.544470930}\sqrt{2}}{\sqrt{\pi }}+\text{0}\text{.04568607959}\sqrt{186} \right)}{\sqrt{\pi }}}</math>
- <math>\,\!\sigma '_{B}=\text{4}\text{.623224911}</math>
Related Articles
| AllegSkill |
|
|---|