Dismiss Notice
This Section is READ ONLY - All Posts Are Archived

Leaderboard NPC kills/death ratio seems way off

Discussion in 'User Interface (Including Launcher)' started by Mishikal, May 30, 2019.

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

    Mishikal Avatar

    Messages:
    1,965
    Likes Received:
    2,834
    Trophy Points:
    113
    Location:
    Brittany Estates
    The kills/death ratio calculated in the new leaderboard seems way off. I would expect it to be #kills/(#deaths+1).

    I.e., if I have 1000 kills and 0 deaths, my k/d ratio would be 1000/1, or 1000. If I died, it would be 500, etc.

    However, that's not what the leaderboard in game shows.

    For example:

    278 kills, 3 deaths, 657.2 K/D ratio (WAY OFF)
    270 kills, 2 deaths, 135 K/D ratio (incorrect by 1)

    Basically, 1 death and 0 death are treated identically, which they shouldn't. With 2 deaths, the ratio is calculated almost correctly, just off by the +1. Anything over 2 deaths the ratio gets really whacked
     
  2. jiirc

    jiirc Avatar

    Messages:
    2,853
    Likes Received:
    2,893
    Trophy Points:
    153
    Theya re aware of this and a fix is forthcoming. I haven't seen the board myself, but Chris mentioned that the some are correct but most are wrong.
     
  3. Undone

    Undone Trap Master Moderator SOTA Developer

    Messages:
    346
    Likes Received:
    848
    Trophy Points:
    43
    This was an issue with our JSON parser not reading in floats correctly. All values have hence been rounded before being injected into the DB and should show up correctly now (fixed as of this morning!).
     
    Jaesun and Mishikal like this.
  4. Mishikal

    Mishikal Avatar

    Messages:
    1,965
    Likes Received:
    2,834
    Trophy Points:
    113
    Location:
    Brittany Estates
    @Undone The kill ratio is still incorrect (off by 1) as I noted in the initial report. I.e., it treats 0 deaths and 1 death as equivalent ratio wise, etc.
     
  5. Undone

    Undone Trap Master Moderator SOTA Developer

    Messages:
    346
    Likes Received:
    848
    Trophy Points:
    43
    Cannot divide by zero. The value only shows as the "same" when deaths=0 or deaths=1. All other cases it is correct from what I have seen. The formula is in the name KDRatio = K/D.
     
  6. Mishikal

    Mishikal Avatar

    Messages:
    1,965
    Likes Received:
    2,834
    Trophy Points:
    113
    Location:
    Brittany Estates
    Right, the formula is wrong. It should be K/(D+1). Then it would be accurate. This is because normally when doing ratios you have X/Y where Y >=1. But with deaths, being "whole" means it starts at 0. Thus the formula needs adjusting.
     
    Spoon likes this.
  7. Mishikal

    Mishikal Avatar

    Messages:
    1,965
    Likes Received:
    2,834
    Trophy Points:
    113
    Location:
    Brittany Estates
    Also of interest, the "rank" is for total #of kills, it would be neat if there was a way to rank via K/D ratio as well. Like right now, the #3 player has the best K/D ratio, since they've not died 1 time.
     
    Jaesun likes this.
  8. Undone

    Undone Trap Master Moderator SOTA Developer

    Messages:
    346
    Likes Received:
    848
    Trophy Points:
    43
    This is simply incorrect. If we were to use this formula then every other KD Ratio with deaths>0 would be wrong.

    Let's just say we have 10 kills and 5 deaths. With your formula the KDRatio would be 10/(5+1)=1.6666 when we know the answer is 2. In reality if you have 0 deaths then you have an infinite KDR which doesn't quite work when you are trying to parse numbers.

    Instead of worrying about all of that I chose the simplest route of using the formula of KDR=Kills/max(1, Deaths). People are smart enough to look at the difference between those who have had 0 vs 1 deaths and decide for themselves which is "better".

    There is a dropdown that allows you to change the ranking (separate from the timespan radio buttons).
     
    Mishikal likes this.
Thread Status:
Not open for further replies.