Cigar Forums banner
1 - 13 of 13 Posts

·
Banned
Joined
·
2,112 Posts
Discussion Starter · #1 ·
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.

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.
 

·
Registered
Joined
·
321 Posts
Is this for the new army game?

As the amount of times A attacks B approaches infinity won't the ratings just even out at whatever the teams started at? Let's make the math easy. From the example Team A had about a 70% chance of winning and would either win 30% of the points (15 points) or lose 70% (35 points) per fight. Team B would be the opposite.

So let's say they fight 10 times and A wins 7 and B wins 3 as they statistically should. Team A would gain 105 points (15 * 7 wins) and lose 105 points (35 * 3 loses) for a net of zero. Same for Team B only they'd gain 35 * 3 wins and lose 15 * 7 loses. So where's the incentive to fight, what do they get out of it?

The Elo works in chess where the skill of the players affects the outcome of a match. I don't know if it will work for an army game where the skill of the players doesn't affect the outcome of the battle. If this system isn't for the new army game, I apologize for the confusion - ignore my post.
 

·
Banned
Joined
·
2,112 Posts
Discussion Starter · #3 ·
Is this for the new army game?

As the amount of times A attacks B approaches infinity won't the ratings just even out at whatever the teams started at? Let's make the math easy. From the example Team A had about a 70% chance of winning and would either win 30% of the points (15 points) or lose 70% (35 points) per fight. Team B would be the opposite.
Exactly.

So let's say they fight 10 times and A wins 7 and B wins 3 as they statistically should. Team A would gain 105 points (15 * 7 wins) and lose 105 points (35 * 3 loses) for a net of zero. Same for Team B only they'd gain 35 * 3 wins and lose 15 * 7 loses. So where's the incentive to fight, what do they get out of it?
Can only attack a person once every 24 hours. That way you cant find some weakling and attack them 1,000 times.

If that's the case for winnings then nothing would be gained. but that is a rare case.

And the rating would change after each battle, thus changing the amount of points gained or loss.

The Elo works in chess where the skill of the players affects the outcome of a match. I don't know if it will work for an army game where the skill of the players doesn't affect the outcome of the battle. If this system isn't for the new army game, I apologize for the confusion - ignore my post.
It actually does work for a lot of games. Starcraft used it for years very successfully. A lot of other MMORPG's use it as well.

All players will start with a rating of 1000. By the end of the season its likely the highest rated players will be around 2,500 or so.
 

·
Registered
Joined
·
321 Posts
Can only attack a person once every 24 hours. That way you cant find some weakling and attack them 1,000 times.
I wasn't saying that. I mean say A attacked B once every do of the game for the course of the game (or infinity if you like). It sounds like his rating would even out to a net of no change.

If I'm understanding this right in every fight you have an X% chance of winning (50*(100-X))/100 points and corresponding (100-X)% chance of losing (50*X)/100 points. I'm pretty sure if you make an algorithm that picks a random value for X between 1 and 99, the more times you run it the closer the total points won or lost will go to zero.

I guess the big question is what determines who wins a fight? Does your rating determine who wins, or is your rating just an expected probability of the outcome that is unrelated to the actual result of the fight?
 

·
Banned
Joined
·
2,112 Posts
Discussion Starter · #6 ·
I wasn't saying that. I mean say A attacked B once every do of the game for the course of the game (or infinity if you like). It sounds like his rating would even out to a net of no change.

If I'm understanding this right in every fight you have an X% chance of winning (50*(100-X))/100 points and corresponding (100-X)% chance of losing (50*X)/100 points. I'm pretty sure if you make an algorithm that picks a random value for X between 1 and 99, the more times you run it the closer the total points won or lost will go to zero.

I guess the big question is what determines who wins a fight? Does your rating determine who wins, or is your rating just an expected probability of the outcome that is unrelated to the actual result of the fight?
Rating has nothing to do with who wins, its your defense and attack statistics. Rating is just a way to rate people so you have an idea of who has won the most and loss the least. It rates based on how good your opponents record is too, so you can't pick on the weaker players with weak records.
 

·
Registered
Joined
·
321 Posts
Rating has nothing to do with who wins, its your defense and attack statistics. Rating is just a way to rate people so you have an idea of who has won the most and loss the least. It rates based on how good your opponents record is too, so you can't pick on the weaker players with weak records.
Ok, now the system makes sense to me. So basically:

The winner of a fight is based on each army's strength.
There are no spies so you don't directly know how strong an opponent is.
But you can see their rating to get an idea of who you want to try to fight.
This gives people an incentive to fight because the only way to get a big rating is to win a lot of fights.

Do I understand it right? I can see why there will be no spies in the new version. If you knew other army's strengths everyone would only attack guys with good ratings but low strengths.
 

·
Banned
Joined
·
2,112 Posts
Discussion Starter · #8 ·
Ok, now the system makes sense to me. So basically:

The winner of a fight is based on each army's strength.
There are no spies so you don't directly know how strong an opponent is.
But you can see their rating to get an idea of who you want to try to fight.
This gives people an incentive to fight because the only way to get a big rating is to win a lot of fights.

Do I understand it right? I can see why there will be no spies in the new version. If you knew other army's strengths everyone would only attack guys with good ratings but low strengths.
Yup. You got it.

If someone has a rating of say, 830 you know they aren't doing so great. Since you start with 1000 they lost a majority of their matches.

Just cause someones rating is low though, doesn't reflect their army stats. Someone could just do nothing but defend, giving them no rating changes, build up a strong army, then out of nowhere start dominating.

A lot of strategy goes into it hehe. ;)

But a rating gives you a good idea of the strength of someone you are facing without actual statistics.
 

·
Registered
Joined
·
321 Posts
Someone could just do nothing but defend, giving them no rating changes, build up a strong army, then out of nowhere start dominating.
So your rating only changes when you attack and not when someone attacks you? Wouldn't one person's rating go up and one person's go down in a fight?
 

·
Banned
Joined
·
2,112 Posts
Discussion Starter · #10 ·
So your rating only changes when you attack and not when someone attacks you? Wouldn't one person's rating go up and one person's go down in a fight?
Nope. According to the ratings themselves, it doesn't matter if you were attacked or if you attacked someone else. Its a match. Just like a game of chess. In chess there's no attacker or defender.
 

·
Registered
Joined
·
321 Posts
Nope. According to the ratings themselves, it doesn't matter if you were attacked or if you attacked someone else. Its a match. Just like a game of chess. In chess there's no attacker or defender.
Ok, I think i misinterpreted what you meant by "just do nothing but defend". I thought you meant all they would do was defend themselves from attacks - in which case their rating would change after each time they were attacked. I think you actually meant they would just build up an army and not get involved in any fighting at all - that would keep your ratings from changing.
 

·
Banned
Joined
·
2,112 Posts
Discussion Starter · #12 ·
Ok, I think i misinterpreted what you meant by "just do nothing but defend". I thought you meant all they would do was defend themselves from attacks - in which case their rating would change after each time they were attacked. I think you actually meant they would just build up an army and not get involved in any fighting at all - that would keep your ratings from changing.
You can gain points by just defending. Though once its known that you are strong enough to ward off attacks, people wont attack you. So you will need to establish an attacking force at one point or another. Don't expect to just set up a killer defense and wait for others to keep attacking you for your rating to go up.

:)

As you can see in the example above, it doesn't matter who was attacking or defending, both sides receive a rating change after the battle based on the outcome.
 
1 - 13 of 13 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top