SFTtech / openage-masterserver

Lobby and matchmaking server for openage in Haskell
https://openage.dev
Other
52 stars 12 forks source link

wrote a small elo calculation module #9

Open chocoladisco opened 6 years ago

chocoladisco commented 6 years ago

not sure where exactly to place it, still needs documentation

typical usage would be calling the win and lose functions and then save the new score in the DB

chocoladisco commented 6 years ago

Will require Database integration, however I have never worked with PostgreSQL on Haskell so I haven' t touched the Database Module to add to the schema.

TheJJ commented 6 years ago

When I think about it, it may be better to use the https://en.wikipedia.org/wiki/TrueSkill algorithm, because openage will barely have 1vs1 matches. If I understood right, ELO is only suitable for those. What do you think?

chocoladisco commented 6 years ago

@TheJJ, one problem would be that TrueSkill is patented and as such not usable for this project. ELO can be generalized to multiple players by basically splitting a match into multiple matches. Let's say we have a 3v3 Game with Team1 = {p1, p2, p3} and Team2 = {p4, p5, p6}

what we then do is calculate the results of the following matches;

{
(p1, p4),
(p1, p5),
(p1, p6),
(p2, p4),
(p2, p5),
(p2, p6),
(p3, p4),
(p3, p5),
(p3, p6)
}
chocoladisco commented 6 years ago

Haven't read it completely but the following post seems interesting and we could steal some ideas from CSGO on how to implement this: https://steamcommunity.com/sharedfiles/filedetails/?id=312582297

chocoladisco commented 6 years ago

We should however probably hide the ratings internally so people with high ratings don't get discouraged from playing due to being afraid of losing it.

chocoladisco commented 6 years ago

Another possibility would be doing ELO between the Teams then somehow calculate the Shapley Value of each Player to determine how much they contributed to their team and as such divide the gained and/or lost ELO points between the players. Would get interesting on losses however as then we would have to calculate the "inverse shapley value".

simonsan commented 5 years ago

@TheJJ Let's ask in the Siege Engineers community (so around us, basically) if some people from the machine learning group and some other ppl. e.g. from rec analysis and so on are willing to develop an algorithm that scales to AoE needs. If they maybe can work out something for Openage, how to judge the skill especially of an AoE player. I think something like this could really be derived from all that replays and it's analysis that is existing and by the knowledge of this beautiful nerdy community! There might be much different factors than just win or loose and to disappoint the prediction of an algorithm (Trueskill) - is it really just win or loose? What's with a civ-win, how should boar laming affect the numbers, how about killed units/better army compositions, researched upgrades etc. In my understanding of AoE this will get a somewhat "complex" (not "real" complex) function we can still play with, instead of taking something from Xbox and Microsoft.

Now it gets philosophic: I mean isn't it all about experience that people get over the game. Playing to perfection. I really think we should take a look at this before we just add numbers together. This could be influencing the basic fun and long-time motivation of people coming new to the game. And as it's a a reimplementation, everyone is basically new. Also the question for a matchmaking algorithm will be a big one. These both algorithms will be a main factor, better be good!

What do you think?

TheJJ commented 5 years ago

Sure! I'd be glad if we had really good matchmaking someday :)

simonsan commented 5 years ago

Here is a small update after talking to n_brain:

He was recommending us to take a look for the glicko rating system. There is also a pdf-File with mathematical explanations. n_brain said it would be best in combination with a community-based fairness reward system. Sounds like a really good approach to me, not reinventing the wheel and still practicable for our purpose. I would like to help implementing it in the future.

EDIT: It is also implemented by CS:GO, so what @chocoladisco linked in his comment (saved with waybackmachine) is a good read, too. For the actual implementation see the pdf in this comment.