Rankings based on wins and losses.

Discussion in 'Plugin Development' started by zonedabone, Jun 17, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    zonedabone

    I need some algorithm for ranking players based on their wins and losses against other players. Specifically for the new Duels plugin I'm working on. I need it to be relatively simple,preferably just based on how many wins, losses, and total games they're played. If this won't yield accurate rankings, I could keep a database of records, but I'd prefer not to. Any ideas on algorithms that I could use?
     
  2. Offline

    wwsean08

    as for their ranking, maybe you could do an average of winning, the highest average is number 1 and so on. as for storage, i'm learning about hashmaps right now and they may be a good option as you can write them to a file pretty simply.
     
  3. Offline

    garbagemule

    I'm thinking zero-sum would be the easiest and most "daring" ranking system, especially for duels. If you want to make the statistics available through scoreboards somehow, and you don't like the idea of presenting negative numbers, you can just use zero-sum with an offset of score + |lowestScore|.

    Zero-sum is great because it encourages players to challenge the highest ranks, just to throw them off the throne (even if the challenger is much lower ranked). It's bad because it doesn't reward a high amount of total duels. To make up for this, you could modify the offset so the actual score is zero-sum-value + total-duels. You'd need to keep track of both the totals and the zero-sum values, and make the score a simple function of the two.

    You wanted simple, but if you feel like extending the equation, you can add perfect knock-outs (player wins with full health), close calls (player wins with ½ heart), and duel-duration (hello Scheduler). With this, I would weigh it as perfect knock-outs > short duel-duration > close calls. Extend a win to be +10 points, a loss to be -10 points, perfect knock-outs +5, short duration +3, close call +2.
     
  4. Offline

    zonedabone

    I could make the score be the winning person,s HP. ELO is zero-summed so I'm going to go with that. I think I'll skip on duel timing, because it'll add extra work and then your opponent could dally to avoid losing points.I do agree that a scaled version instead of just win/loss would be good, because winning be a thread isn't really winning. Maybe I'll make it an option whether it's weighted or just 1/0. I'm storing it in a yaml file. Each player has a record that looks like this:
    Code:
    zonedabone:
        duels: 2
        losses: 1
        rating: 1000
        wins: 1
    
    I'm starting at 1000 because that's where it starts in chess. It actually works just like it's at 0, but 100 looks nicer. Also, the yaml gives me a great human-readable format that anyone can edit.

    EDIT: Here's an idea I came up with relating to your weighted ranking system. I'll have a parameter in the settings called RANKING_WEIGHT. When a player wins by the other player dying, I'll take the winner's health as a decimal between 0 and 1. I'll then take it to the power of 1/RANKING_WEIGHT, divide by 2, and add that to .5. This result will mean that with a weight of 0, it'll be winner takes all. With 1, it'll be linear, and with anything else, it'll have a curve that can be fine tuned. This is really easy to implement. I think it's perfect, because it allows for every option in a nice understandable number.

    EDIT: I used 1/RANKING_WEIGHT to have roots, but having the 0th root works while having the 1/0th power doesn't. Use the root function instead.
     
    garbagemule likes this.
Thread Status:
Not open for further replies.

Share This Page