Hey guys, :laugh:
I just wrote this up to explain to those who may be wondering how the rating system works for Diplomacy of Middle Earth. This article will also be posted in the game itself for ease of access to view at any time, but I figured I might as well post it here as well so I can get some feedback.
I just wrote this up to explain to those who may be wondering how the rating system works for Diplomacy of Middle Earth. This article will also be posted in the game itself for ease of access to view at any time, but I figured I might as well post it here as well so I can get some feedback.
Introduction:
The rating system was one of the more difficult features to plan and develop for the game. There are so many different possibilities and systems out there, each with their strengths and weaknesses. One that really stood out to me was what is commonly known as the 'Elo Rating System'. What makes this rating system unique is it awards and deducts points from your total score based on the results of a match, the number of points awarded or deducted depends on the person who you are facing. The problem with fixed points rewarded and deducted from scores is that people will just target the weaker competitors for an easy victory, this system negates that strategy. The system Diplomacy of Middle Earth uses is a modified version of the 'Elo Rating System'.
How it works:
Before a match takes place, the rating system looks at both competitors current ratings and calculates the probability for each person to win the match. The amount of points a person gains or loses depends on their chances to win the match. The lower your chance to win the match, the more you have to gain and the less you have to lose. However, the rating system gives you a good idea of how skilled the player you would be facing is. Although you may gain a significant amount of points for beating someone with a much higher score, the actual chance that you will win is drastically low.
The maximum amount of points one may gain or lose in a single match is 50, as shown as "K" in the formula below. The amount of points you will gain for winning a match is determined by your chance to lose the match, and the amount of points deducted for losing a match is determined by your chance to win. If you had a 90% chance to win the match and 10% chance to lose the match, then for a win you gain 5 points (10% of the possible 50 points), but for a loss you lose -45 points (90% of the possible 50 points). This means your opponent has the opposite chances of winning and losing. They will have only a 10% chance to win the match and a 90% chance to lose the match, so for a win they will gain 45 points (90% of the possible 50 points), and for a loss they would lose only -5 points (10% of the possible 50 points). If both players have the same rating, then each player has a 50% chance to win and a 50% chance to lose. This will give either of the players 25 points for a win, and -25 points for a loss.
The Formula:
The following is the formula that the Diplomacy of Middle Earth uses to calculate the amount of points gained or lost from a match. It firsts calculates the probability for each person to win by comparing the difference in their rating. This will return a percentage value as a decimal, represented in the formula as 'K'. If the match is won 'W' will be 1, otherwise it will be 0. When the probability of winning is subtracted from 'W', it will either give a positive number (for a win since 'W' is 1) or a negative number (for loss since 'W' is 0). When this number is multiplied by the maximum rating change, represented in the formula by 'K', it will give you the amount of points to be added or subtracted from your current rating.
New Rating = Old Rating + K(W-P)
P = Probability of winning. 1 / 1 + 10^(difference_in_ratings / 400)
K = Maximum rating change. 50
W = 1 if match is won
W = 0 if match is lost
Examples
Here are a few different examples of possible scenarios.
Example 1 Determin Pre-Match Ratings Player A: 1360
Player B: 1200
Find Difference in Ratings To find a players odds of winning, you must subtract their rating from their opponents as followed.
Player A: 1200 - 1360 = -160
Player B: 1360 - 1200 = 160
Calculate Probability of Winning for Player A
Player A: 1 / 1 + 10^(-160 / 400)
-160 / 400 = -0.4
10 ^ -.04 = 0.3981071706
1 + 0.3981071706 = 1.3981071706
1 / 1.3981071706 = 0.715252751
The formula needs the percentage as a decimal, but to find your percentage of winning and losing just multiple that number by 100 and that will be the winning percentage. Subtract that number from 100 to find your chance to lose.
0.715252751 x 100 = 71.5252751% chance to win the match.
100 - 71.5252751 = 28.4747249% chance to lose the match.
Calculate Probability of Winning for Player B
Player A: 1 / 1 + 10^(160 / 400)
-160 / 400 = 0.4
10 ^ .04 = 2.511886432
1 + 2.511886432 = 3.511886432
1 / 1.3981071706 = 0.284747249
Does this number look familiar? Player B's winning percentage is the same as Player A's losing percentage. Makes sense doesn't it? Here's Player B's winning and losing percentages.
0.284747249 x 100 = 28.4747249% chance to win the match.
100 - 28.4747249 = 71.5252751% chance to lose the match.
Calculating New Rating for Player A If Player A beat's Player B, then this will be the formula to update his rating.
1360 + 50(1 - 0.715252751)
1 - 0.715252751 = 0.284747249
50 x 0.284747249 = 14.23736245 points to be added to record
1360 + 14.23736245 = 1374.23736245
New Rating = 1374, after rounded down.
However, if Player A was to lose to Player B this is how the results would look.
1360 + 50(0 - 0.715252751)
0 - 0.715252751 = -0.715252751
50 x -0.715252751 = -35.76263755 points to be subtracted from record
1360 + -35.76263755 = 1324.237362
New Rating = 1324, after rounded down.
Calculating New Rating for Player B If Player B beat's Player A, then this will be the formula to update his rating.
1360 + 50(1 - 0.284747249)
1 - 0.284747249 = 0.715252751
50 x 0.715252751 = 35.76263755 points to be added to record
1200 + 35.76263755 = 1235.76263755
New Rating = 1236, after rounded up.
However, if Player B was to lose to Player A this is how the results would look.
1360 + 50(0 - 0.284747249)
0 - 0.284747249 = -0.284747249
50 x -0.284747249 = -14.23736245 points to be subtracted from record
1200 + -14.23736245 = 1184.762638
New Rating = 1185, after rounded up.
Conclusion As you can see from the examples, there's a good amount of calculations that go into finding the amount of points a person gains or loses based on their chance to win the match and the outcome of the match. Player A had a higher rating so was more likely to win. As you can see from the results, Player B had a lot more to gain from a win and a lot less to lose from a loss, but the chances of him/her to win the match was low. As to the opposite, Player A didn't have much to gain but a lot to lose, but the chances of him winning the match was high. Because of the possible losses and gains, this creates a unique strategy. Do you face someone with a significantly better rating taking your chances against the odds to gain a lot? Or do you pray on the weaker where your almost guaranteed to win the match and only gain a little?
The best strategy is probably neither of the two, but instead face players with ratings close to yours. If two players have very close ratings, then the amount of points gained or loss is equal, and so is the odds of who will win the match. Winning and losing will determine your rank on the Ladder. How good you rank isn't necessarily determined by how good you are at the game, but also how good you are at selecting opponents.