buttonmen-dev / buttonmen

Buttonmen - an online dice game
Other
16 stars 24 forks source link

Statistics for players #615

Open irilyth opened 10 years ago

irilyth commented 10 years ago

It'd be cool if there were a way to see statistics for players, e.g. win/loss records vs other players, with each button you've played, etc.

irilyth commented 10 years ago

The old page also had a "history" page for each player, showing a list of the games you'd played against each other player. I don't know if it makes more sense for that to be separate (in which case I'm happy to make a separate ticket), or to bundle that in this with in some fashion.

AdmiralJota commented 10 years ago

If the "history" you're referring to is similar to what's in the "Completed Games" section of the current overview (except moved to its own page, and maybe given some handy filtering and summary features), then I'd consider that a separate page from the general player statistics (which, on the old site, didn't list individual games, but it did break things down by button and player, with the number of games played/won/lost and percentages for each).

irilyth commented 10 years ago

Yeah, I think you're right that the stats page isn't going to have details on it, or it'd get too crowded; it should perhaps have clickable links so you can click on my name and bring up a page with the history of the games we've played against each other, but that's a different page.

We're already talking about what to do with completed games (on ... some other ticket), so I think I won't make a new one for player vs player history or whatever, yet.

blackshadowshade commented 7 years ago

So, what sorts of player stats to people actually want that they can't easily get from the History page?

AdmiralJota commented 7 years ago

One thing that the old site did was to have a big player rankings page that assigned every player a score based on their win percentage and number of games played, then showed the top N ranked players. It might be fun to have something like that again.

(I forget, did it do it for all time, or just for the last month/few months? I guess we could always do both of those things...)

(Admittedly, this wouldn't be on the stats page per se, but it would be player statistics that I assume the stats module would help with.)

AdmiralJota commented 7 years ago

I'd like to be able to see my my game count and win percentage using/against each button that I've played with/against. Especially nifty would be if it were alongside the site-wide stats. So, e.g., a big table saying "Avis from Soldiers: you've played 8 games with it, won 40% of them, them, 6 games against it, won 55% of them, and the site has seen 212 games with it, with Avis winning 49% of them". (Except in a concise tabular format, with all the buttons listed. Probably alphabetically or by group, but maybe custom sortable so you could easily see what buttons you're best/worst at, etc.)

And I suppose it would be neat to have similar data for players that I've played against as well.

irilyth commented 7 years ago

The main thing that I want is the ability to browse, rather than search: I want a list of all the buttons I've played with and against, with win/loss/pct, colored accordingly; and likewise players. All of that information is available from the History interfact, but not in a way where I can scan through it and say "oh hey, I've only played a few games with this set" or "huh, my record is really terrible with these buttons" or "wow, I really can't win against these players" or whatever.

irilyth commented 7 years ago

One thing that the old site did was to have a big player rankings page that assigned every player a score based on their win percentage and number of games played, then showed the top N ranked players. It might be fun to have something like that again.

Yeah, I liked that although I think the way the old site did it was kind of weird (it tended to reward quantity more than quality). My recollection is that there was an all-time ranking and a this-month ranking.

AdmiralJota commented 7 years ago

Yeah, I agree -- I was thinking a little bit about algorithms for that. What about something like score = (wins / total games) * sqrt(wins)? Then maybe multiply by 100 and round off, to give a nice integer score.

I did some math with it, and that would give these scores for these ratios:

1/10: 10
10/100: 32
1/2: 50
1/1: 100
5/10: 112
2/2: 141
9/10: 270
200/1000: 283
50/100: 354
90/100: 854
500/1000: 1118
800/1000: 2263

Is that still weighted too strongly in favor of quantity, do you think?

irilyth commented 7 years ago

Yeah, I think my personal intuition is that if you've played 100 games and won 90 of them, you're probably a better player than if you've played 1000 games and won 500 of them.

Unless we think winning a large quantity of games is more difficult than winning a small quantity, I'm not sure quantity needs to be in here at all, except to have a minimum cutoff below which your sample size is too small.

What about something like just sorting by win percentage, among everyone with more than 30 games this month or 100 games total?

You could also have the cutoff be a parameter you can set on the page, so you can see only people who play 100 games a month, or people who have played 1000 games overall, or something.

Or something fancy and variable, like "the cutoff is 50% of the median number of games played, among people who have played more than 30 games" or something. That sounds fiddly to me, but people might find it interesting.

dwvanstone commented 7 years ago

I agree that it would be nifty to see my personal stats on buttons: which buttons I've played with and played against in one long table, including button name and button set name sorted by button set name and then button name. (This would include buttons I've never played with or against.) Less important is to see another player's stats on buttons.

Also less important to me is to have an equivalent page saying who I've played against and who I haven't and what my stats are against each opponent. I can use the History table to find information about particular individuals.

It would be nifty to see my stats against a player on their profile page. (If this should be a separate ticket let me know.)

AdmiralJota commented 7 years ago

Unless we think winning a large quantity of games is more difficult than winning a small quantity, I'm not sure quantity needs to be in here at all, except to have a minimum cutoff below which your sample size is too small.

Hmm. Even above the cutoff, it still feels to me like it matters at least a little -- winning 200/300 seems like more of an accomplishment than winning 20/30. If nothing else, it shows that you can do it consistently. Also, it seems like if someone joins the site, starts out kinda bad, then gets really good over time, they should still have a higher ranking than someone who is brand new and started out OK. (But maybe that second point is just saying that recent games should count more than old games?)

Hmm. What if we used the percentages used for statistical confidence intervals? Like, if your number of games is such that a statistical sample with that sample size would have a confidence interval of +/- 50%, then subtract 50% from your win ratio. If your confidence interval were only +/- 5%, then just subtract 5%, etc.?

(I apologize if I'm misusing any stats terms here.)

cgolubi1 commented 7 years ago

I'm only slightly following this discussion at the moment, but i think for player/player head-to-head stats, it's important to have a number of games component, because we should reward players for being active on the site as well as for winning a lot of games. Have we reconstructed the old site's algorithm here? I definitely think it was some multiplicative function of your number of games and your win percentage in those games.

irilyth commented 7 years ago

The old site's algorithm was something like number of games times winning percentage, and thus heavily favored people who played lots of games.

I also think it would be fine to have more than one ranking, like most games played, best winning percentage, and best combinatino of those things.

It's also possible that rankings is a totally separate topic from this ticket. :^)

AdmiralJota commented 7 years ago

Wouldn't "number of games times winning percentage" just equal "number of games won"?

irilyth commented 7 years ago

Wouldn't "number of games times winning percentage" just equal "number of games won"?

I don't think so; using the numbers from your example, where the "Jota" column is your formula (wins / total games sqrt(wins) 100), and the "DHS" column is (my recollection of) the DHS formula (wins winning percentage, let's say 100 for more integral numbers), I think you'd get something like this:

wins/games Jota DHS
1/10 10 10
10/100 32 100
1/2 50 50
1/1 100 100
5/10 112 250
2/2 141 200
9/10 270 810
200/1000 283 4000
50/100 354 2500
90/100 854 8100
500/1000 1118 25000
800/1000 2263 64000

I think the DHS formula vastly overstates the importance of quantity -- a player who wins 30% of 1000 games (not pictured) would have 9000 points, more than someone who wins 90% of 100 games, despite the fact that the 90% person is almost certainly a much better player.

we should reward players for being active on the site

I'm interested to hear more about this, because it doesn't really fit my intution at all. Why do we want to incentivize people (even in a small way like these rankings) to play 100 games a month rather than 10 games a month?

AdmiralJota commented 7 years ago

Ah, you're looking at "games won times winning percentage" rather than "number of games times winning percentage".

irilyth commented 7 years ago

Ha, yes. :^)

blackshadowshade commented 7 years ago

What about we do something completely different and use a ranking like this:

Win percentage plus log2 number of games played

blackshadowshade commented 7 years ago

So, I've been thinking about @AdmiralJota's suggestion.

In this case, we're dealing with a binomial distribution since there are two outcomes: win and lose. If p is the win probability, then for n total games played, the expected number of wins is n*p, with variance n*p*(1-p).

Going roughly by Jota's idea, if we took the mean minus one standard deviation, and normalised that arbitrarily to a base of 100 games, we'd be looking at a ranking of

100 * ( np - sqrt(n*p\(1-p)) ) / n

which simplifies to

100*p - 100*sqrt(p*(1-p)/n)

Examples:

p = 0.5, n = 10: ranking = 34.1 p = 0.5, n = 100: ranking = 45.0 p = 0.5, n = 1000: ranking = 48.4 p = 0.5, n = 10000: ranking = 49.5

p = 0.7, n = 10: ranking = 55.5 p = 0.7, n = 100: ranking = 65.4 p = 0.7, n = 1000: ranking = 68.6 p = 0.7, n = 10000: ranking = 69.5

irilyth commented 7 years ago

Should we spin off a separate ticket for the ranking discussion? It obviously depends on this one, but seems tangential to it.

In particular, I don't think we need rankings in order to roll out a player-vs-player, player-with-button, and/or player-vs-button stats page, which I think is what this ticket was originally about.

blackshadowshade commented 7 years ago

I think discussion here about rankings is fine, since I don't anticipate that the basic pages need much more discussion.

blackshadowshade commented 3 years ago

Note to self: it's probably helpful to add some link from somewhere on the site to the stats that are currently being run.