seeh Posted October 24, 2021 Report Share Posted October 24, 2021 I there a good online Elo Calculator ? https://www.omnicalculator.com/sports/elo this calculated if i 1059 win vs Vali 2340 i get only 20 and if he wins both only 0 points. 20 looks to less. right? Quote Link to comment Share on other sites More sharing options...
Langbart Posted October 24, 2021 Report Share Posted October 24, 2021 The code can be found here: xpartamupp/elo.py / xpartamupp/echelon.py I used extendsclass.com/python.html to calculate it. # take inputs rating = float(input("Your Rating: ")) #If there is no rating, use 1200 opponent_rating = float(input("Opponent Rating: ")) #If no games being played use 0 games_played = float(input("Your Total Games: ")) if rating < -2199 or opponent_rating < -2199: raise ValueError('Too small rating given: rating: %i, opponent rating: %i' %(rating, opponent_rating)) RESULT_WIN = 1 RESULT_LOSS = -1 ELO_SURE_WIN_DIFFERENCE = 600 ELO_K_FACTOR_CONSTANT_RATING = 2200 VOLATILITY_CONSTANT = 20 ANTI_INFLATION = 0.015 rating_k_factor = 50.0 * (min(rating, ELO_K_FACTOR_CONSTANT_RATING) / ELO_K_FACTOR_CONSTANT_RATING + 1.0) / 2.0 player_volatility = (min(max(0, games_played+1), VOLATILITY_CONSTANT) / VOLATILITY_CONSTANT + 0.25) / 1.25 volatility = rating_k_factor * player_volatility rating_difference = opponent_rating - rating rating_adjustment_win = (rating_difference + RESULT_WIN * ELO_SURE_WIN_DIFFERENCE) / volatility - ANTI_INFLATION rating_adjustment_lost = (rating_difference + RESULT_LOSS * ELO_SURE_WIN_DIFFERENCE) / volatility - ANTI_INFLATION points_you_gain = (round(max(0.0, rating_adjustment_win))) points_you_lose = (round(min(0.0, rating_adjustment_lost))) new_rating_win = rating + points_you_gain new_rating_lose = rating + points_you_lose print('Current rating: %i\nPoints you would gain: %i (%i)\nPoints you would lose: %i (%i)' %(rating, points_you_gain, new_rating_win, points_you_lose, new_rating_lose)) Example: seeh vs Langbart Seeh rating = 1059 Langbart rating = 1434 Seeh total games = 116 Points you would gain: 26 (1085)Points you would lose: -6 (1053) Example: seeh vs valihrant Seeh rating = 1059 valihrant rating = 2340 Seeh total games = 116 Points you would gain: 51 (1110)Points you would lose: 0 (1059) It would be a good addition if these numbers were displayed in the lobby profile when you select a person from the playerlist. I will try to work this into the mod. 3 Quote Link to comment Share on other sites More sharing options...
seeh Posted November 17, 2021 Author Report Share Posted November 17, 2021 (edited) On 25/10/2021 at 12:41 AM, Langbart said: It would be a good addition if these numbers were displayed in the lobby profile when you select a person from the playerlist. I will try to work this into the mod. thats very cool plan. and ty for the only link BTW this source in other python online interpreters: https://www.online-python.com/wvGLoTZg70 Edited November 17, 2021 by seeh Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.