dblock / slack-gamebot

Ping pong, chess, pool and other games bot for Slack.
MIT License
129 stars 103 forks source link

Support for single and team elo #135

Open michael-pratt opened 7 years ago

michael-pratt commented 7 years ago

Many of our users have expressed interest in tracking single and team elo separately. The idea is that when you record a score with only a single opponent, everyone's 'single' elo gets updated. When you record a score with multiple opponents, everyone's 'team' elo gets updated. The rankings would then display both elo values.

dblock commented 7 years ago

I like this idea. Happy to help implement if anyone is interested in jumping on it.

michael-pratt commented 7 years ago

I'd love to take a stab at this, but will definitely need some oversight :) My first thought is to keep the existing elo and elo_history fields in the user object and interpret them as single elo, and then add two new fields:

I think I can figure out how to store the two elo types and associated history fairly easily, but not so sure how this affects rankings, etc. I've cloned the repo and can start a branch with my first set of changes if that helps?

dblock commented 7 years ago

Initially I thought about this as a setting where you decide whether you want to track elo for user and team together or separately, but maybe that's not necessary.

Current elo is combined elo, just leave it as is.

Add user_elo and team_elo, along with their history.

When elo is calculated do all the combined one and the user/team separately. Then it's just about showing the right thing. It might be possible to recalculate user and team elos based on match data, but I wouldn't worry about it.

Finally maybe you can make the current combined elo dynamic based on user and team elo and kill the field, but I wouldn't worry about it because it's useful for, say, sorting.

dblock commented 7 years ago

Related, I wonder whether by team elo people want to see the elo of an actual team. For example if Bob plays with John and then Bob plays with Mary in a team, maybe those are two teams and they should have separate elos? That is more work, but maybe makes more sense here? You would need to create teams dynamically when matches are recorded with an elo on the team.

If you feel like this is an even better model I'd rather do this. It provides better granularity and the idea of "teams" is something I feel could open many new possibilities.