Bungie-net / api

Resources for the Bungie.net API
Other
1.22k stars 92 forks source link

Question: Where to find fireteam lists for historic activities #151

Closed CrunchyWizard47 closed 6 years ago

CrunchyWizard47 commented 6 years ago

So I see I can get previous activities from /Destiny2/{membershipType}/Account/{destinyMembershipId}/Character/{characterId}/Stats/Activities/ and there's a fireteamID object there, but I'll be darned if I can find any way to query the API for the players in that fireteam. My goal is to monitor Clan activities - our clan requires that each clan member play in at least one fireteam with another clan member each month so we can keep an active clan and remove any accounts where the player isn't being a good clan-member. Before anyone asks, we allow for notice when members get deployed or life happens and they can't be active for a time. I'd also like to collect stats on clan activities (where two or more clan members participate), which requires being able to identify the fireteam.

It's probably something obvious, but I have spent a couple hours searching before I posted so I'm not being lazy, just probably a little thick. Thanks in advance for any nudges, pushes or shoves in the right direction.

vthornheart-bng commented 6 years ago

Ah, unfortunately you've found a bit of a hole in our API - we don't actually have information that you can grab from the API for a fireteamID. The fireteamID is a "transient" ID, in that once the Fireteam disbands the ID is no longer relevant - and we don't really have a way to get historical information from them, at least at this time.

Sorry about that! What you can do is go back and periodically query for the state of each of your teammates, and see if their fireteamIDs happen to match: if so, then they're playing together. But that could suck in that you'd have to be querying when they happen to be playing. If you did it once every 10-15 minutes or so, the odds would be high that you'd catch them together in a Fireteam: and since there's no more than 100 people in a clan, that would be a very reasonable amount of queries to perform over a 10-15 minute time period.

You could also use the historical stats APIs to go back through matches and see when membership IDs of people in your clan played together - that might actually be the more rock-solid way to do the test.

ckhicks commented 6 years ago

That last line is a really cool idea...I'm visualizing a git-tree-style map of players who have all intersected at various times. o.O

CrunchyWizard47 commented 6 years ago

I'll take a look at that - talking GetHistoricalStats and GetHistoricalStatsForAccount? I know there's a way to get it - DestinyTracker does a good job of presenting that and I doubt they are constantly monitoring things... Thanks for the nudge in the right direction!

roscroft commented 6 years ago

Imagine that tree map used to determine optimal crucible teams and raid teams - you could come up with a measure of how players in a clan affect other players, by observing how their average stats change when playing together!

vthornheart-bng commented 6 years ago

I love that idea @ckhicks!

Hmm, it could be a bit of a pain now that I'm looking at it... but definitely feasible. Use GetActivityHistory to find out a user's recent matches, and then GetPostGameCarnageReport to find out who they played with. I forgot it was a two-step process to get at that data unless you happen to be scraping every PostGameCarnageReport (as some sites, like DestinyTrialsReport, do)

vthornheart-bng commented 6 years ago

Seeing cool use cases like this makes me wish it was easier to query for this information without having to do the two-step process. An improvement we'll have to think about for the future.

CrunchyWizard47 commented 6 years ago

Happy to help. Also, having nightmares about building trees and displaying them. :)

Thanks, as usual, vthornheart!!

vthornheart-bng commented 6 years ago

^_^;;

CrunchyWizard47 commented 6 years ago

FWIW - that's working manually, now to get to coding. Thanks again!

vthornheart-bng commented 6 years ago

Phew, that was quick, good stuff! Glad to hear it!