ReactiveDrop / reactivedrop_public_src

Alien Swarm: Reactive Drop game source code and issue tracker.
https://reactivedrop.com
106 stars 35 forks source link

[proposal] introducing elo system to the current HoIAF score #478

Open ywgATustcbbs opened 1 year ago

ywgATustcbbs commented 1 year ago

^This is only a concept.

Introducing elo system into the ranking.

My idea is to treat every combinations of maps, player number, ff, challenges, difficulties etc. as different virtual ai players. Then the player ranking problem is converted to a competition between Ai player and human. This is a problem that elo system good at.

AI's elo score could be evaluated using historical ranked game results. Put all human players to the starting point of 3000 pts (not sure). Then calculate the ai's elo score. Then calculate player scores using ai's score. The ai's and players' scores are believed to converge after several rounds of iterations.

Once determined, ai's score should calibrated periodically ( each match season or a week?). The players' scores can be updated after each game.

If elo is introduced, The farming issue will technically disappear

mithrand0 commented 1 year ago

Already made it in the past: https://github.com/mithrand0/reactive-drop-elo

ywgATustcbbs commented 1 year ago

Already made it in the past: https://github.com/mithrand0/reactive-drop-elo

It seems that the system isn't integrated into the current ranking system. At least the elo score isn't shown to the public

mithrand0 commented 1 year ago

Correct, it isn't. I think @jhh8 knows more about the current ranking system.

ywgATustcbbs commented 1 year ago

Correct, it isn't. I think @jhh8 knows more about the current ranking system.

If possible, could you please post some anonymous game results within a period on ranked servers. i have some ideas, But need some validation.

mithrand0 commented 1 year ago

Ranking game results are public: https://stats.reactivedrop.com/heroes/history?lang=en

You can see the amount of points in what context are earned.

ywgATustcbbs commented 1 year ago

Ranking game results are public: https://stats.reactivedrop.com/heroes/history?lang=en

You can see the amount of points in what context are earned.

Is there a csv file or something like that. Manually copy web record is a lot of work. If not, i have to find some time to write a script

jhh8 commented 1 year ago

in early stages of ranked points system i've made a calculator which takes in people's stats like winrate, killrate, points earned per mission and converts them into score (elo), it was pretty accurate but pretty biased and was frowned upon

ywgATustcbbs commented 1 year ago

in early stages of ranked points system i've made a calculator which takes in people's stats like winrate, killrate, points earned per mission and converts them into score (elo), it was pretty accurate but pretty biased and was frowned upon

Elo system focuses on the probability of win/loss between two players. Imo, since Asrd is a pve game, calculating player's elo score solely is useless, no matter how many aspects are taken into account. You have to calculate elo score for both sides human and ai. That is, treat Each one of map combinations as a virtual player who has a very stable performance.

Take jacobi1 and 2, normal and hard for example, We have j1n, j1h, j2n, j2h as 4 ai players. Then the 4 ai players will compete with different human players. There will be wins and losses for all ai and human players. Then elo scores for everyone are calculated. This will give a rank between different players.

Elo system never focuses on the absolute scores of players, it only addresses the difference between two score.

At the beginning, i think only taking win/loss into account is enough to produce a relatively good player rank. The equation is really simple, as described in mathematical details section. https://en.m.wikipedia.org/wiki/Elo_rating_system

To get a unified ranking, i suggest making jacobi1_normal_softFF_onslaught_off_no challenge elo score to a fixed value, forexample 1000. And shift all scores after calibration

mithrand0 commented 1 year ago

Above was implemented in the repo above: https://github.com/mithrand0/reactive-drop-elo/blob/master/addons/sourcemod/scripting/rd_elo.sp#L861

It includes PvE, group, map, and challenge weighting, including scoring tweaks, basically all the things you mention and more.

ywgATustcbbs commented 1 year ago

Above was implemented in the repo above: https://github.com/mithrand0/reactive-drop-elo/blob/master/addons/sourcemod/scripting/rd_elo.sp#L861

It includes PvE, group, map, and challenge weighting, including scoring tweaks, basically all the things you mention and more.

Quickly read the source code. The so called "ELO" Caclustion part is from line 944 to line 964. This is actually not an ELO-like system.

Yes,it takes many aspects into account, but the core aspect of elo, i.e. The opponent's elo is not considered. I would like to say it's not an elo score.

The mathematical details section on wiki clearly states that you need to calculate the elo score for both sides. For a pve game, that means both enemy and player sides' elo score should be calculated after a gsme. Its not the player in-game behaviors which elo concerns.

Elo only concerns two thing: 1. What Is the actually game relult. 2. What Is the expect relult based on the skill difference between the two sides. This is why i suggested to treat every combination (what ever settings that influences the difficulties/win rate should be addressed) as a virtual player. This will meet the basic requirement of calculating elo score: have players on both side

mithrand0 commented 1 year ago

Elo is only PvP, we don't do that in RD, which is a coop game.

To adept, we took the elo thing, and implemented enivornment vs player as a test.

(map difficulty * challenge difficulty) vs (player score)

Because that didn't work well in practice, we decided to play with the scoring curve, add group modifiers and finetuning. Strictly it's not Elo anymore, but strictly Elo wasn't going to work in a coop game. We also investigated Glicko. The test case did run on few servers for half a year. Above is just the last version that was coded, it doesn't have actual map scores, which were stored in a database.

I would say, maybe write some working code and maybe @jhh8 can look along, and go from there.

ywgATustcbbs commented 1 year ago

Elo is only PvP, we don't do that in RD, which is a coop game.

Imagine We have a human player who has a very very stable performance.

To adept, we took the elo thing, and implemented enivornment vs player as a test.

(map difficulty * challenge difficulty) vs (player score)

Elo is never about actual difficulties or something else. It is a system that evaluates a player's winning chance against something. I think.the reason for this didn't work is that not all of the influencing factors were taken into account.

Map, difficulty, friendly fire, onslaught, challenge, player numbers, etc. will influences the overall difficulties. So there will be N_maps5(difficulty)2(ff)2(onslaught)N_MobSpawnLevel*... for no-chqnge wnvironment. For challenges, it depends on the challenge setting.

Off of the influencing factors should be considered, or we will have a "environment player" which have different skill/performance levels in different games. This is why the wlo system failed

mithrand0 commented 1 year ago

If you look at the code, we have exactly implemented that what you are suggesting.

Or maybe I don't understand what you mean to do different. Maybe an idea is to make a demo in sourcemod or c++, so we know the exact implementation you mean. Feel free to use above repository if it helps.

That said, I am not the programmer behind the current ranking system. The team needs to agree to change the ranking system to something like elo.

ywgATustcbbs commented 1 year ago

Sure, i would like to. But i am not familiar with sourcemod api. Perhaps i can write some pseudo codes oe here.

I'musing a phone so better come back later cause i might revise This several times.

enum maps{ Jacobi1, Jacobi2, ... }

enum difficulty{ Easy, Normal, Hard, ... }

enum ff{ Normal, Realistic, }

enum slaught{ On, Off, }

enum spawnfactor{//Not know about the exact value, But player numbers will have influences on mob count 1-2players, 3-4players, ... }

enum...//if there are other influencing factors, We have to address them

enum change {//all challenges that ranked servers have None, Asbi, Asbi2, ... }

//now We havedefine all possible combinations of virtual players' elo score Float* ai_elo_scores[map_count][difficultiy_mode_count=5][ff_mode_count=2][slaught_mode_count=2][challenge_count][...];

ai_elo_scores.setall(1000)//set initial value, This only Needs to be set only once unless we want to reset the lb

inlune float estimated_score(elo_score_player, elo_score_opponent){ Return 1.0/( 1.0+ pow(10.0, (elo_score_opponent - elo_score_player)/400.0) ); }

Elo(game_result) { Float ai_score_old = ai_elo_scores[game_result.maps][ game_result.difficulty][game_result.ff][game_result.slaught][game_result.challenge][...];

Float player_score_old = game_result.player.get_elo_score();//or we can use team average Instead.

Float ai_estimated_score = estimated_score(ai_score_old, player_score_old);

Float player_estimated_score = estimated_score(player_score_old, a8_score_old);

Float player_score_new, ai_score_new;

player_score_new = player_score_old + k*(gameresult.result -player_estimated_score); Rewrire player_score_new to database; //ai score is similar to player's //k is an const coefficient. }

mithrand0 commented 1 year ago

In my feeling you are listing pseudo code for what we already have coded two years ago, only the numbers are slightly different.

Maybe you misunderstand the full code, or I misunderstand your pseudo code. Let's keep the discussion here to a minimum here. Left or right, I am already convinced, I like the idea of elo. If the team agrees it's worth implementing, and someone is willing to write the code in c++, you have my vote.

jhh8 commented 1 year ago

he means that by default assume all map and challenge variations as same difficulty, they will have 1000 elo each. then also by default players will have 1000 elo each. then as games play out if team starts losing a lot then map's and challenge's elo will grow while player's elo will decrease, if winning then the opposite

calibration of map and challenge combinations to correct difficulty will take years, with less popular maps probably decades. there will also be less reason to play unpopular maps or challenges because by default they will be considered easy. higher skilled players tend to play only hard map+challenge combinations and lower skilled players to play easier combinations, it will take a very long time to have accurate elo's

ywgATustcbbs commented 1 year ago

Sorry that i have to save draft now and then to prevent from losing ut. Now i finished it.

To the calibration problem, i think there will never be a perfect calibration. If the elo score of a specific map conbination changes within a reasonable range, This will be OK.

If playerA ONLY plays very hard maps, While playerB only plays very easy maps and they all begins from 1000. It is definitely expected that A's score is liwer than B's. But This won't happen if a starts playing easy maps, He will "stole" points from easy maps and "give" It to hard maps.

The ranked servers have many players. Players will try to gain as much points as they can,at least part of them will. They will find the under rated map combination and quickly re-ballance the elo points. This will keep the map elo in a dynamic balancing state.

Another possible reason for the previous elo system is numerical rounding.

ywgATustcbbs commented 1 year ago

Maybe you misunderstand the full code, or I misunderstand your pseudo code. Let's keep the discussion here to a minimum here. Left or right, I am already convinced, I like the idea of elo. If the team agrees it's worth implementing, and someone is willing to write the code in c++, you have my vote.

Perhaps i can try if given api doc

mithrand0 commented 1 year ago

Perhaps i can try if given api doc

I have shared everything I have, that includes shared code that is working.

As for api, for the SM concept, I used:

If implementing directly in the game, the api's for Steam are here:

A list of events I found useful as well, was this:

I found above enough to get a concept working back then.

ywgATustcbbs commented 1 year ago

Thank you, i will try, But Needs some tine to learn