[SM Plugin] Emp Stats

Discussion in 'Coding' started by Mikleo, May 13, 2017.

  1. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    Plugin that stores basic stats about players

    !empstats [optional target]
    shows player wins, player time, total points and current level

    !commstats [optional target]
    shows comm wins, time commanded, time played and upvotes.

    !emprank [optional target]
    !commrank [optional target]

    !comminfo
    shows the current comms stats or during the vote shows all the candidates stats.

    !upvotecomm / !upc

    !predict [optional minutes 0-50, defaults to 5]
    Predicts the chances of a team winning based on mmr. predict 0 predicts who is expected to win if the game ends now. predict 10 predicts who is expected to win if the team composition stays the same for the next 5 minutes.

    Teambalance
    Teambalance prevents a player joining a team that would increase the difference in team MMR above a certain threshold.
    es_teambalance 1
    es_teambalance_margin 100
    It is up to server owners to decide what that margin should be. I recommend somewhere between 100(64% win chance) and 200(76% win chance)

    es_teambalance_playerratio 0.4
    The percentage of players allowed on teams without teambalance. This means that if players get in early enough they guarantee they can play with friends who have a similar MMR.

    By downloading this plugin you agree to the terms of use.

    TERMS OF USE
    1. You must use the official remote database that I provide. Do not use your own.
    2. You must not manipulate stats or edit the plugin in any way that would affect stats.
    2. You must not expose or publish the following variables: MMR

    INSTALLING
    Before you can use the plugin you will need to send me a steam message or forum pm. If you have a serious empires server and are trustworthy I will send you a config for your databases.cfg file with your username password etc.

    I will try to keep backups of the database, but it would also be cool if server owners also kept backups.

    As always this is early stages, there will be bugs and there are still things yet to be implemented.

    Depends on emputils

    Git repo: https://git.empiresmod.com/sourcemod/EmpStats
     
    Last edited: Oct 7, 2017
    Neoony and D.D.D. Destroyer like this.
  2. Paradox

    Paradox I am a gigantic asshole who loses people's hard wo

    Messages:
    6,926
    Likes Received:
    148
    Trophy Points:
    0
    hows the mmr calculated?
     
  3. Thexa4

    Thexa4 Developer Staff Member Moderator

    Messages:
    304
    Likes Received:
    98
    Trophy Points:
    0
    Starting from 2.13.1 we're collecting stats from all servers through the stats_collector. Might be useful not to duplicate effort. What are you trying to achieve?
     
  4. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    I mean you can understand what I'm trying to achieve. It's pretty obvious that I was not aware of this, nor anyone I have spoken with. Is it posted anywhere publicly?
     
  5. Thexa4

    Thexa4 Developer Staff Member Moderator

    Messages:
    304
    Likes Received:
    98
    Trophy Points:
    0
  6. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    I mean all I see there is one line that says "Better statistics tracking".
    How does anyone see these stats?

    The thing I'm trying to achieve is that players can know who is a competent commander, they can track their wins and see who is a nub etc. They can upvote the comm if they want to.

    No one mentioned this in the commander rating system thread, which is the main basis for this plugin. This was the first plugin I was going to work from the start, I have told numerous people about it and they also weren't aware of this.
     
    Last edited: May 13, 2017
    Neoony likes this.
  7. Paradox

    Paradox I am a gigantic asshole who loses people's hard wo

    Messages:
    6,926
    Likes Received:
    148
    Trophy Points:
    0
    Wait wait wait, mikleo basicly did your job and now theres this passive agressiveness cause he finished before you guys did?
     
  8. flasche

    flasche Member Staff Member Moderator

    Messages:
    13,299
    Likes Received:
    168
    Trophy Points:
    0
    how is he passive aggressive?
     
  9. Thexa4

    Thexa4 Developer Staff Member Moderator

    Messages:
    304
    Likes Received:
    98
    Trophy Points:
    0
    It currently doesn't have any way to view the stats, it's currently running to collect statistics to try and improve team balancing. We can probably add a way to get info out of it.

    So basically you want to show a commander rank?

    Sorry, I think I didn't see that thread.

    Maybe it's useful if we chat about how we can help each other? I'm online on the discord.
     
  10. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    MMR is not yet implemented. I have researched into it and have a few ideas. but it will always be hidden and completely based on wins. It is only used as part of the team balancing part of this plugin. The teambalanncing part will prevent players from joining a team if it would unbalance the average MMR by too high of a degree.
     
  11. Paradox

    Paradox I am a gigantic asshole who loses people's hard wo

    Messages:
    6,926
    Likes Received:
    148
    Trophy Points:
    0
    Word usage sounded passive agressive, might be wrong, but since Its emp forums i concluded it was passive agressive
     
  12. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    I mean you can add me on steam if you want: http://steamcommunity.com/profiles/76561198336525047/
    Generally though I don't plan on refactoring to use that system. It does track a lot of data etc. And it would be totally cool if some of this functionality was implemented into the actual game. time commanded, wins etc, like on the comm vote screen.

    This plugin is pretty basic and has very little overhead anyway. It just loads stats when clients connect and reports them when they leave or map is changed.
     
  13. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    v0.2
    Added experimental MMR system based on ELO and average team ratings over time.
    Added !predict command
    Added teambalance settings.
    Hopefully fixed commander time
    Small details like colors
     
    Neoony likes this.
  14. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    I have also been asked why i slightly bias the average MMR to players playing later in the game. So I thought I'd try to show you why I did this with a thought experiment.

    We are the MMR system. We know with 100% certainty that the game has lasted 60 minutes.

    There are two groups of players, group A plays for the first 30 minutes and then leaves, group B then joins and plays for the next 30 minutes and the game is won.

    Are these two groups both equally responsible for winning the game?
    I would argue that group B is more responsible. They are the ones who actually closed the game out. Yes the mmr of group A is still important but I would argue the mmr of group B is more important in deciding who is expected to win.

    lets say that one of the groups is full of nubs and the others pros. once again we know with 100% certainty that the game lasted 60 minutes.

    do you think its more likely for nubs->pros to win the game or pros->nubs to win a game. It's much more likely for the nubs->pros team to win right.

    That is why my belief is that in deciding what team is expected to win, the mmr of the players towards the end of the game are slightly more important than the mmr of the players at the start.

    Its only a slight bias but I believe in it.
     
    D.D.D. Destroyer and Neoony like this.
  15. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    When discussing the team balance one thing that has been brought up is this strange idea that you should be allowed to stack the team that is losing.

    This is one of the terrible parts of empires that I hope this system can actually address. Let me set the scene. There are two teams that are very evenly matched that play for 30 minutes. It's a really good game and BE gets a slight lead either through a little bit of luck or some mistakes from the enemy. Its been a long fought game and they gain the upper hand and control 66% of the map. Now several vets decide they should join the team that is losing, they don't assess the skill levels of the players on each team before they decide to join and so these players overly stack the losing side in an attempt to turn the game around. They quickly turn the game on its head and win the game. Pretty much all the effort that BE put into the start and mid game was pointless. These players might as well of played worse so that these vets would join their team instead. This turnaround is artificial, a kind of challenge these guys set themselves, "can we turn the game around" they would say. It effectively ruins the game for the players on the wrong end of it and usually results in them quiting the game.

    In my opinion players should not be allowed to overly stack a team just because its losing. The teambalance part prevents you from joining a team if it would upset the balance of MMR by too wide a margin.
     
    Last edited: May 18, 2017
    Neoony likes this.
  16. Kidpaler

    Kidpaler Member

    Messages:
    738
    Likes Received:
    58
    Trophy Points:
    0
    You said the first 40% of players get to join whatever team. Lets say it starts off as a REALLY bad stack. What happens then? I only ask because most games are horribly stacked right off the bat with vets joining vets and noobs somehow always joining noobs. I get what the mmr would do, but thats a LOT of skill to make up if the first 40% of a 64 player match stack.

    Edit: And this will make people conscious and care about their ranks, IE not wanting to play on a team they think will lose.... to an extent. Some will probably care a ton.
     
    Last edited: May 18, 2017
  17. Sgt.Security

    Sgt.Security Member

    Messages:
    3,137
    Likes Received:
    140
    Trophy Points:
    0
    Here's what I have against "MMR being more biased toward late game".

    Expect more because we should take it very seriously if you want to use this MMR for actual team balancing.

    First, late game is not necessarily more important than early game.
    There's this thing called "snowball", usually, you require a lot more effort in late game to recover a tiny defeat in early game,
    For a lot of games(I am not gonna say most because I don't have statistics), even with "fairly balanced teams", the result is pretty obvious at 10 mins mark.

    I am not gonna deny that a late game mistake could throw the game as well, but you can't really say it's more important than an early game mistake.

    Second, this one I didn't bring up, late game bias will encourage early ragequits.

    If you have enough map/tactical awareness, you can see your team losing the game eventually, like, literally 20 minutes before your CV blows up.
    I am not talking about 100% defeat, I am talking about "winrate has gone lower than 10%". And that 10% is mostly about "ninjaing/rushing enemy CV", if you take that away the winrate is almost zero.

    I am gonna give you some actual examples here, you SHOULD quit if you want to prevent "unnecessary MMR loss" :
    https://www.dropbox.com/s/83vqi4n1aqzyi3y/MMRex1.jpg?dl=0
    https://www.dropbox.com/s/kfcvhv6j5v1unow/MMRex2.jpg?dl=0
    https://www.dropbox.com/s/rx0unzcy6z65ggw/MMRex3.jpg?dl=0
    https://www.dropbox.com/s/h9p4yvseqdncls3/MMRex4.jpg?dl=0
    https://www.dropbox.com/s/e5fhyc5w3v2sd65/MMRex5.jpg?dl=0
    If you look closely, for these examples, you don't even need to be in spec to know that one of the teams will most likely lose, it's just so obvious.

    If players figured out that they will most likely lose in the end, they are being encouraged by this late game bias to quit early on.
     
    Last edited: May 18, 2017
  18. Mikleo

    Mikleo Member

    Messages:
    155
    Likes Received:
    98
    Trophy Points:
    0
    First I'm in no way saying that the late game is more important the early game in general. All I'm saying is that in assessing who is most likely to win the players in the late game are more important. The reason why this is the case is that we would expect a certain % of games to have already ended before this later game position. This effectively means the chance that early game players have an effect on the result is lower because a certain percentage of games would have already ended.

    If you take the pros->nubs example. There is a very high probably that this game would have ended before we hit 30 minutes. The very fact that we did hit 60 minutes means its much more likely that the nubs->pros group will win.

    I completely understand that players can leave the game early. They could do this whether there was a bias or not. If they see next to no chance of winning they shouldn't drag the game out longer anyway. There should be a surrender option really. After players leave, if the winning team can close the game out quickly they will gain a lot of MMR, If it drags on they will gain much less. It would actually be unfair to players who don't ragequit if there was no bias, who would lose a lot more MMR because the system expected them to do better.

    But really they have no reason to want a higher MMR. It is just a handicap with no benefits, nobody can see it and it doesn't help you. Nobody is going to go out of their way to get themselves more of a disadvantage when it comes to winning real games.


    The 40% thing is so that friends can play together. After that 40% if it is totally stacked the teambalance will pretty much not allow good players on the stacked team or nubs on the unstacked team. So there is 60% to try and address that balance. But if it is crazy stacked it might not be possible like you said. But that is something that can easily happen without teambalance as well. The stacked team gains very little mmr from winning and the unstacked team loses very little mmr from losing. However if the unstacked team wins they will gain crazy mmr.

    And why would anyone want a higher mmr? Can you explain that to me? The whole point behind my system is that it is hidden. By attempting to artificially raise your MMR you are decreasing the percentage of games you will be likely to win.

    I guess I need to remind everyone that the reason why I created the MMR system was for the purpose of teambalance. It wasn't for the purpose of creating some crazy ranking system that would distract players from winning the game the way hlstats does.

    One major consequence of this system which it has in common with a lot of other MMR systems is that the percentage of games you will win will tend towards 50%. There are probably a few good vets out there who are used to having 70%+ win rates by either being so much better than the competition or stacking against nubs. But even if your winrate goes down these games should be more challenging and rewarding. I can also bet a lot of new players have < 30% win rates which prevents them from enjoying the game or playing it longer.
     
    Last edited: May 18, 2017
  19. Neoony

    Neoony Member

    Messages:
    1,366
    Likes Received:
    106
    Trophy Points:
    0
    My surrender plugin basic features are like 80% done btw.

    Just to say :P
    Might finish it soon.
    Dont think X wants to include it on his server though.
     
  20. Xyaminou

    Xyaminou Member

    Messages:
    1,369
    Likes Received:
    156
    Trophy Points:
    0
    Make a thread so we can talk about it.
     

Share This Page