Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/v2/characters/:id/heropoints is not showing HoT heropoints if all are unlocked. #619

Open
darthmaim opened this issue Apr 13, 2018 · 2 comments

Comments

@darthmaim
Copy link
Contributor

darthmaim commented Apr 13, 2018

If a character has all HoT heropoints unlocked, they are not showing up in /v2/characters/:id/heropoints.

Examples:

  • Kyrix has all HoT points, not showing up.
  • Archomeda only has 4 HoT points and do show up

The disscussion about this on gitter starts here: https://gitter.im/arenanet/api-cdi?at=5ad0c4d0270d7d3708c3ba93

@apoch
Copy link
Contributor

apoch commented May 8, 2018

So this turns out to be a little complicated.

In GW2, hero points (and many other things) are implemented using a bitmask system. Each hero point you can unlock is one bit - off for locked, on for unlocked.

One of the features of the system is that it will compress itself - if you set every bit in the mask, we simply store a flag that says "yep, you got all the bits." If there are hundreds of bits, we basically eliminate all but one of them from storage. This is a super useful efficiency savings and we rely on it a lot.

The API endpoint for base GW2 works by coincidence or some kind of crazy luck. There are more bits in the mask than actual hero points you can unlock for base GW2. The result is that when you have 100% of the hero points, the bitmask is not compressed yet because there are unset bits still. This enables the API to look at every bit you have set and dump a list of hero points.

I bet you can see where this is going.

When we look at HoT hero points, the mask has exactly as many bits as obtainable hero points. This means that when you 100% HoT hero points, the mask gets collapsed/compressed to a single "everything is done" bit.

Here's the painful part: the API implementation doesn't have the data to understand how to go from "yep, you have all the bits!" to a comprehensive list of those bits, because that data is uniquely accessible to the game servers themselves.

We can and probably will add plumbing to make this work, but it's a decent-sized lift and in competition with a lot of other priorities at the moment.

@BenLubar
Copy link

Could you return some value to signify that all the bits are set? Like just a "1" for HoT and a "2" for PoF? It's already possible to find the hero challenge IDs associated with each expansion pack through the API:

https://gopherjs.github.io/playground/#/6-GtZYtFQb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants