leonhard-s / auraxium

A high-level Python wrapper for the PlanetSide 2 API.
https://auraxium.readthedocs.io/
MIT License
28 stars 8 forks source link

weapon datasheet 'max' and 'min' damage are meaningless due to API quirks #44

Open EllyArd opened 3 years ago

EllyArd commented 3 years ago

Apologies, I'm too rusty to fix this myself, though I can find the right values. Take this as a suggestion/warning to others trying to use this for damage calculation tools as much as a bug.

Important: This may only apply to infantry weapons, as I haven't looked past that.

Introduction:

Lets say we're looking at the NS-11A. The weapon datasheet from auraxium yields this snippet: damage=143 damage_min=75 damage_max=225

That can't be right.

Lets look at the ps2 wiki query for the NS11-A's page))))&c:join=weapon_datasheet^inject_at:ammo&c:join=item_category^on:item_category_id^to:item_category_id^inject_at:category&c:join=item_attachment^on:item_id^to:item_id^list:1^inject_at:attachments(item^on:attachment_item_id^to:item_id^inject_at:attachment(zone_effect^on:passive_ability_id^to:ability_id^inject_at:attachment_effects^list:1(zone_effect_type^on:zone_effect_type_id^to:zone_effect_type_id^inject_at:attachment_effects_description)))>)

The damage ranges have the same quirk. still 143, 75, 225. This is the same across all the infantry weapons I've looked at. Reddit knows the API way better than I do, most of my knowledge of it is from stumbling through them.

Correct values

But when we look under firemodes, each firemode does have the correct values

"max_damage": "143",
"max_damage_range": "10",
"min_damage": "125",
"min_damage_range": "65",

The weapons with different damage per firemode (underbarrel grenade launcher, godsaw, etc) will be edge cases, this can likely be preëmpted by using the description field, and only grabbing semi-auto

Proposed directions:

Ideally, fixing these as the default, or at least making a flag for it.

In my experience, the non-recoil stats most important for comparing weapons on paper are: max_damage max_damage_range min_damage min_damage_range fire_rate_ms (time per bullet, not bullet per time as the wiki goes)

Having a method that just outputs these, would help a lot for people new to programming to be able to make tools to compare infantry weapons on paper, instead of the spreadsheets they currently use.

Thanks again for making this! The API is labrynthine and I know everyone is busy, this serves as much as a heads up as an issue.

EllyArd commented 3 years ago

I realize in retrospect that this is technically under https://github.com/leonhard-s/auraxium/issues/18, but I think the fact that the datasheet itself is formatted badly (and also where most people would first look? Unless I'm missing some docs that expose the structure of this much more than I've found)

Maybe this is an issue of naming though -- When I saw datasheet, I expected a summary, which daybreak has filled wrong, and isn't the app's 'fault', but it might be good to have a similar summary thing that spits out comparison-relevant statistics.

leonhard-s commented 3 years ago

Hey, thanks for the report!

There is not much to add to your elaboration I think - that table has been flaky for years though, so adding a big "warning: this could be nonsense" banner to the docs would be helpful.

I generally avoid hard-coding my own data types around the API's since this makes the app's code API version specific (and DBG seems to have abandoned versioning the API, unfortunately). It also risks cutting out some weird edge case where you need a specific API key that only works correctly for some entries. Maybe we also just misunderstand that key's purpose; maybe this is a certain minimum damage amount that cannot be further reduced by armour?

Either way, I agree that reports are the best solution for this. Auraxium can provide a few stock ones (including a replacement for the unreliable weapon datasheets), and users can then use the report system to add custom ones if their app needs them.