LotR TCG Wiki → Card Sets:  All 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 → Forums:  TLHH CC

Author Topic: ELO rating system algorithm  (Read 654 times)

0 Members and 1 Guest are viewing this topic.

July 25, 2009, 01:56:22 PM
Read 654 times

Beyo

  • *
  • Information Offline
  • Orc
  • Posts: 30
ELO rating system algorithm
« on: July 25, 2009, 01:56:22 PM »
Does anyone have ELO algorithm code? I am wrting some web interface to manage local lotr league and I want to add ranking feature.

July 27, 2009, 07:04:17 AM
Reply #1

Treebeard13

  • *
  • Information Offline
  • Goblin
  • Posts: 22
Re: ELO rating system algorithm
« Reply #1 on: July 27, 2009, 07:04:17 AM »
Beyo,
The ELO system is used in chess and you might find some good information on the web.  The information below is what I had from the old Decipher site.

Some facts about the ELO system:
Decipher uses the proven ELO system (used to rate the World's chess Masters for many years) to determine each player's progress.  Every player begins with a base rating of 1500.  Points are added or deducted to an individuals's rating based on games won and lost, taking into account the strength of each opponent.

1600-1700 is considered an expert rating. A rating of 2000 indicates a master of the game.

- True ties are impossible
- Your rating cannot drop if it is below 1600, it can only increase
- Ratings are actually recalculated after each game of a tournament, not simultaneously at the end of the tournament.
- Ratings are weighted depending on the size/scope of the event. This is indicated by what is known as a K-value.

K-values:

- Local events [Level 1, 16k]
- Territorials & PSQs [Level 2, 32k]
- Premiere Series, Continental Championships [Level 3, 48k]
- World Championships [Level 4, 64k]

Calculation for each LOTR game:

- (Positive difference between you and your opponent's rating)/400 = X
- 1/(10^X + 1) = expected winning proportion (EW)
- EW*(K-value) = points adjustment, PA.  Note, round PA to nearest point with a minimum of 2.

You gain (K-value - PA) points to your rating for a full win.
You gain one half of (k-value - PA) points to your rating for a modified win.
You lose PA points from your rating for any type of loss.

LotR Example:

Your rating = 1700. Opponent's rating = 1900
Difference = (1700 - 1900) = -200 (drop negative)
200/400 = 0.5 = X
10^0.5 = 3.162
1/(1 + 3.162) = 0.2402 = EW. So, you're predicted to win 24% of the time in this matchup.
At a local tournament where K-value = 16: 16*0.2402 = 3.84 = PA.  A full win would add 16 - 3.84 = 12 points to your rating.  Modified win would add 6 points and you would lose 4 points for a loss.

Hope this helps.
"...it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a long time to say.."    Treebeard

July 27, 2009, 08:30:24 AM
Reply #2

Treebeard13

  • *
  • Information Offline
  • Goblin
  • Posts: 22
Re: ELO rating system algorithm
« Reply #2 on: July 27, 2009, 08:30:24 AM »
Beyo,
I was re-reading my post and then re-checked the information I had from Decipher and it seems correct if your rating is less than your opponents but not if yours is greater.  Does this mean that if you play an opponent who has a lower rating and you win your rating stays the same?  Might require some additional research - or perhaps someone else knows the answer.

Chuck Ward
"...it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a long time to say.."    Treebeard

July 27, 2009, 08:56:48 AM
Reply #3

Treebeard13

  • *
  • Information Offline
  • Goblin
  • Posts: 22
Re: ELO rating system algorithm
« Reply #3 on: July 27, 2009, 08:56:48 AM »
OK - Last posting (hopefully) on this.

Difference is always rating of player's opponent minus players rating.  In the example above your difference (player A) is 200 (1900 - 1700) and your opponent (player B) would calulate out their difference as -200 (1700 - 1900).  X would be 0.5 for player A and -0.5 for player B.

Player A would be 10^0.5 = 3.162 and 1/(1 + 3.162) = 0.2402 = EW
Player B would be 10^-0.5 = 0.3162 and 1/(1 + 0.3162) = 0.758 = EW

Player A would be 16 * 0.2402 = 3.84 or 4 for PA so points for full win are 16 - 4 or 12.
Player B would be 16 * 0.758 = 12.128 or 12 for PA so points for full win are 16 - 12 or 4.
Player B loss would be minus 12 points.

Good Luck,
Chuck Ward
"...it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a long time to say.."    Treebeard

July 30, 2009, 11:59:55 AM
Reply #4

Beyo

  • *
  • Information Offline
  • Orc
  • Posts: 30
Re: ELO rating system algorithm
« Reply #4 on: July 30, 2009, 11:59:55 AM »
Thanks for information, I will try to digg it deeper and if I create such system I will gladly share...
I wonder during the tournament , how the pair are set in every round when using Rating.

There is Tournament Managment System software but it does not use rating in swiss pairing.
« Last Edit: July 30, 2009, 12:07:27 PM by Beyo »

July 30, 2009, 03:59:52 PM
Reply #5

Treebeard13

  • *
  • Information Offline
  • Goblin
  • Posts: 22
Re: ELO rating system algorithm
« Reply #5 on: July 30, 2009, 03:59:52 PM »
Beyo,
No, rating does not come into play during a tournament.  I wrote a simple visual basic program to run tournaments several years ago and it came in handy especially when calculating tie breakers (based on strength of schedule).  At one time it was made available on Decipher's site and was called Entmoot. 

The first round is a random assignment then in the later rounds assignments are based on random assignments but within the group of players with the same win/loss record.  So the second round would have random assignments among all the players with one win.  The only time when you would play a player with a different win/loss record than your own would be if that group had an odd number then someone would 'play down', or play someone with a lower win/loss record.  Of course you never would play the same player twice.

I had an option in the software which would calculate standings and sort by strength of schedule and the would pair players so that you were always playing the player right above or below you in the standings - as long as you had not played each other already.  But this isn't allowed by guidelines set by Decipher, partly because it would have been near impossible to do without a computer.

Anyway, I'd be interested in seeing what you come up with.

Chuck

"...it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a long time to say.."    Treebeard

July 31, 2009, 12:04:32 PM
Reply #6

Beyo

  • *
  • Information Offline
  • Orc
  • Posts: 30
Re: ELO rating system algorithm
« Reply #6 on: July 31, 2009, 12:04:32 PM »
I remember Entmoot..do you have install version? It is missed from Decipher page as well as other stuff.
In Decipher CCGs there was two kinds of running tournaments : based on diffferential (e.g Star Trek) and based on SoS (LOTR). There is application called Tournament Managment System and it supports both ways but without calculating ratings. However, I dont have source code so I am not sure how other data needed to calculate final results are done in LOTR when two or more players have the same number of points.

In chess there was something like Berger and Bucholz points, but dont know the algorithm.

October 06, 2009, 01:49:25 PM
Reply #7

Beyo

  • *
  • Information Offline
  • Orc
  • Posts: 30
Re: ELO rating system algorithm
« Reply #7 on: October 06, 2009, 01:49:25 PM »
hmm..I started to think..what is with true tie?
I considered this as two players score their points for MW