Hey everyone, another day, another extension. Hopefully I’ll get to release more small QoL extensions soon, but then again, every time I announce something it gets delayed or cancelled, so I’ll make it clear that was just an off hand comment, and not an official announcement!
Fact of the day: “ELO” isn’t, and never was an acronym - It’s named after its creator: Arpad Emmerich Elo, a Hungarian physics professor!
So, what’s Elo anyway? The Elo rating system is a method that estimates the relative strength of a player (or team) in a game. In this system, beating a higher-rated opponent gives you more points than beating one with a lower rating. At the same time, your opponent loses as many points as you win. It’s useful for assigning a fair score that’s relative to a player’s skill.
This extension may be useful for competitve games that need to assign a rating to players.
Elo statistical data spreads out the scores evenly (see graph below)
Blocks included
Only one block is included in this extension, which is used to calculate the elo change in a game scenario. It takes in 3 required and one optional argument.
a
- the elo score of the first player
b
- the elo score of the second player
score
- the result of the game (Win, Draw or Lose)
k
- k factor / development coefficient (default value is 20)
elo.calculate
function calculate(a: number, b: number, score: GameScore, k: number=20): number
The method returns the change in elo score for the first player.
At the same time, your opponent loses as many points as you win
So, if you want to get the elo change for the opponent, simply negate the value you recieve.
The k-factor / development coefficient regulates how wide the range of scores can be in your rating system. If you want a bigger range, increase the value. The k-factor should usually sit somewhere between 10 and 40. It’s set to 20 by default in the block, so if you don’t really understand it, I’d recommend leaving it as it is.
Resources
For additional reading, and as the reference I used while making this extension, see
And the link to the extension!