[Extension] Elo ratings!

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)

image

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

image

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!

11 Likes

Wooooooaaaaah…

1 Like

Imporant announcement

I changed my GitHub username, so please remove this extension in any project you may have it imported, and instead import the new link under my new username (sargedev).

This is not necessary, as the extension should still work, but it would be the safest option. By importing the new link you will also get access to any new updates.

WARNING: Do not import the new link before removing the old one, as this could cause conflicts

3 Likes