Closed awexandrr closed 1 year ago
I am gonna look at it, but from the first look it seems to be a bug that is not easy to find, the code loops over all damage events and calculates them correctly. I will update here if i find some news about this
thanks! very much appreciated!
edit: the same problem occurs on headshot counts,
formula: headshots = ( headshots / (headshots + bodyshots + legshots) ) * 100
but for some reasons, the value calculated is also not as accurate as from tracker.gg
Hi, i ran some loops to get each individual damage events for all players and it seems like the result that i got is better now.
code snippet:
for rounds in data.get('data')[0].get('rounds'):
for damage in rounds.get('player_stats'):
if damage.get('player_puuid') == puuid:
dmg += float(damage.get('damage'))
results:
player | damage_made | calculatedADR | trackerADR | damage_loop | loopADR |
---|---|---|---|---|---|
iSee#PRO | 3069 | 128 | 133.2 | 3197 | 133.2 |
PssyHunter#ezpz | 2796 | 116 | 120.2 | 2884 | 120.17 |
Starzie#4fun | 3059 | 127 | 99.2 | 3379 | 140.79 |
Somet#olo | 2526 | 105 | 114.2 | 2740 | 114.17 |
Miyu#2045 | 2360 | 98 | 102.7 | 2465 | 102.71 |
Awexander#007 | 3032 | 126 | 126.3 | 3032 | 126.33 |
mandylindley#00000 | 4654 | 194 | 110.7 | 4654 | 193.92 |
el diavolo#daisy | 4166 | 174 | 178 | 4271 | 177.96 |
NamT#88888 | 3507 | 127 | 150.2 | 3604 | 150.17 |
Awaken#4279 | 4260 | 178 | 177.5 | 4260 | 177.50 |
edit: upon a closer look, i found that the report included damage / die from spike which is 999dmg, screenshot:
so i looping through all the damage_events:
for rounds in data.get('data')[0].get('rounds'):
for player in rounds.get('player_stats'):
if player.get('player_puuid') == puuid:
for dmg_event in player.get('damage_events'):
if dmg_event.get('receiver_puuid') != puuid:
dmg += float(dmg_event.get('damage'))
this snippet had fix mandylindley#00000
's and Starzie#4fun
's adr which excluding the dmg from spike
Update: I pushed a fix that should address the issue. Could u maybe verify that it's working now as intended?
Hi, I tested the update and so far for 2 games, the report is good and accurate. thanks for the fix!
API URL : https://api.henrikdev.xyz/valorant/v2/match/d633c23b-0b51-44fa-86a6-51db4df04afc REGION: ap
Im using your api to get a match report every time i finished my game and generate combat report based on it.
based on my code, formula for ADR is
ADR = damage_made / round_played
.but, sometimes the value reported from your api is not as accurate with the value that i got from ingame report or tracker.gg report. here is the report that i made,
here is from tracker.gg,
here is the response from api for
iSee#PRO
,At first, im thinking maybe the problem was with the compiler rounding float numbers but the value was far off from the actual one. is there any work around for this ?