QW-Group / ktx

KTX: a QuakeWorld server modification
GNU General Public License v2.0
51 stars 47 forks source link

[BUG] value "todie" is set to 99999 when 100% efficiency is met #100

Open rakasunka opened 4 years ago

rakasunka commented 4 years ago

Describe the bug The value todie is set to 99999 when 100% efficiency is met

To Reproduce Steps to reproduce the behavior: Win a game without dying.

Expected behavior No idea what value of todie should be when a game is played without a death.

Screenshots https://imgur.com/a/G7cxJML 100eff.zip <- mvd

Environment(please complete the following information):

Additional context Game was played on getquad official server.

deurk commented 4 years ago

Well, 0 wouldn't make any sense, 99999 is just a silly value as well. What do you propose we put? Just "todie: N/A"?

meag commented 4 years ago

match_duration * 60?

deurk commented 4 years ago

I thought todie was total damage taken divided by number of deaths?

meag commented 4 years ago

Ah sorry, I thought it was time-based... although that wouldn't work either.

Can we change it to be total damage taken divided by (number of deaths + 1)? So it's average damage taken per life?

deurk commented 4 years ago

Well, you're not technically dead at the end if you have any health. Should we remove health left and just divide by deaths? No deaths would mean todie = _damagetaken

meag commented 4 years ago

Think this is one for @andrestone ...

andrestone commented 4 years ago

I think it would be nice to display a distinguishable information. Total damage taken would be my second choice.

deurk commented 4 years ago

"undead"? 😄

andrestone commented 4 years ago

Setting like that... How about NaN? Since it would be a division by zero? We don't have infinity symbol in the charset, do we?

deurk commented 4 years ago

Well, if we take the extreme case where several players end up with no death, taken damage will be the way to see who actually deserves the survivor trophy, so I think with no death, displayed value should be _damage_taken - healthleft

mushis commented 4 years ago

there's one more possible bug on the stats: did you took 1 rl during the whole game?

rakasunka commented 4 years ago

I didn't take any RL at all during the game, blood dog dropped rl packs.. there was maybe 7-8 rl packs dropped that i took..

deurk commented 4 years ago

Well, if we take the extreme case where several players end up with no death, taken damage will be the way to see who actually deserves the survivor trophy, so I think with no death, displayed value should be _damage_taken - healthleft

Actually _damage_taken + healthleft

deurk commented 4 years ago

Realized calculation was wrong.

If player died at least once: todie = damage taken / number of deaths (we're not tracking damage taken during the last life if not dead at end of match though so value is a bit higher than it should) If player did not die: todie = damage taken + remaining health + remaining armor (because it would have taken at least this amount of damage to kill the player and that's all we can guess)

andrestone commented 4 years ago

Yeah, if we want to consider a never dead player as someone who is dead at the end of the game. The armor + health math isn't that straight forward, though. 150 RA + 10h isn't the same as 150YA + 10h, for example.

On Sun, May 3, 2020, 10:23 Alexandre Nizoux notifications@github.com wrote:

Realized calculation was wrong.

If player died at least once: todie = damage taken / number of deaths (we're not tracking damage taken during the last life if not dead at end of match though so value is a bit higher than it should) If player did not die: todie = damage taken + remaining health + remaining armor (because it would have taken at least this amount of damage to kill the player and that's all we can guess)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/deurk/ktx/issues/100#issuecomment-623073762, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4W4RTVARZGP5C2B7SLKKLRPUSZLANCNFSM4MXPRSHQ .

meag commented 4 years ago

Good news: there's a function the bots use that will give you that.

TotalStrength (client->s.v.health, client->s.v.armorvalue, client->s.v.armortype)

Bad news: it'll return 1000 if the match is already over (match_in_progress), and it'll need moved out of the BOT_SUPPORT section

andrestone commented 4 years ago

Copy/pasta FTW!

On Sun, May 3, 2020, 10:50 meag notifications@github.com wrote:

Good news: there's a function the bots use that will give you that.

TotalStrength (client->s.v.health, client->s.v.armorvalue, client->s.v.armortype)

Bad news: it'll return 1000 if the match is already over (match_in_progress), and it'll need moved out of the BOT_SUPPORT section

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/deurk/ktx/issues/100#issuecomment-623076742, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4W4RVFLGSIX2HVFGD23ALRPUV4JANCNFSM4MXPRSHQ .