Showing Posts For Dr Ishmael.9685:

API errors & bugs

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

  • Haratis Hinterland, Bloodtide Coast and Blazeridge Steppes contain no landmarks, except for the ones of instancied areas (nothing if region 8 is skipped)

If you open the API in your browser and search, you’ll see that those zones have 2 entries – the first one has all landmarks, while the second one only has 1 landmark. Both of them have the same key (since that’s the map_id), so when it goes through a JSON parser, the second one overwrites the first one and you only see 1 landmark.

I already noted that bug here:

https://forum-en.gw2archive.eu/forum/community/api/API-Bug-map-floor-multiple-entries-per-map/first#post2265573

[Maps API] .zip'd tiles possible?

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

That portion of the map doesn’t exist in the world, that’s why it looks like that.

Exactly. It’s the “doesn’t exist in the world” part that I didn’t know how to process. If you re-read what I wrote:

The fg textures have some odd stuff on them outside of zone boundaries, but this gets masked out when the game composites the fg onto the bg.

[…]

I never figured out how the masking worked.

[API Bug] map_floor: multiple entries per map

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

I’ve already created a widget on GW2W.EN: http://wiki.guildwars2.com/wiki/Widget:Zone_map

And while floor 2 does seem to not have this issue, the problem is that in maps.json, the explorable zones specify default_floor = 1. So if you’re building a map dynamically based on a map name, you’re going to use the default_floor value, and floor 1 is screwed up currently.

[API Bug] map_floor: multiple entries per map

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Right, I forgot to mention that I was looking at floor=1.

Event Details API location coordinates

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

On caveat that I forgot about, ozma caught me on it in a PM: the Y coordinates are inverted between map and continent. So you have to take the complement of the delta ( 1 – delta ) in the Y equation.

This attachment shows just the final equations for X and Y without the derivation I showed above.

(How do you show an image inside your post? The IMG tags don’t seem to work.)

(edited by Dr Ishmael.9685)

[API Bug] map_floor: multiple entries per map

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

In map_floors.json, some maps are returning as 2 separate entries under “maps”. E.g., under the “Shiverpeak Mountains” region, the first maps are:


"maps":{
    "26":{
        "name":"Dredgehaunt Cliffs",
        "min_level":40,
        ...
    },
    "26":{
        "name":"Dredgehaunt Cliffs",
        "min_level":40,
        ...
    },
},
...

The problem is that these two maps entries are not identical in terms of the PoIs, Tasks, Sectors, etc. that they list. The first one lists everything (I think), but the second one doesn’t (the only landmark is Falooaloo, the only sector is Wyrmblood Lake, etc.).

Since these two entries have identical keys (“26”), when the JSON is parsed, the second entry will overwrite the first one. This is happening for multiple maps, not just Dredgehaunt – I noticed yesterday that Blazeridge Steppes and Harathi Hinterlands were not displaying any PoIs on my pan-Tyria map.

This is definitely a problem for anyone trying to show all objectives in a zone, like I’m trying to do on the wiki.

(edited by Dr Ishmael.9685)

[API Suggestion] Event Details

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

@Ozma: The new event_details API has a flag for GroupEvent.

@Rodadams: Location→center is starting location, per the documentation post. The rest of the location→ attributes (→radius for type:“sphere”, →points for type:“poly”, etc.) define the 3D volume around the center within which a character can participate in the event.

Event Details API location coordinates

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Yep, you’re using the exact same equations I posted.

Event Details API location coordinates

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

It’s basic algebra and coordinate translation.

Attachments:

[Maps API] .zip'd tiles possible?

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

I’ve been able to extract the map textures from Gw2.dat and use the corresponding PIMG (paged image) metadata files to reconstruct complete maps, but I never figured out how the masking worked.

The map textures from the DAT look normal if you delete the alpha channel from the image (at least in the ones I experimented with).

I know about the alpha channel, that’s not what I was talking about. Check file ID 474252: http://i.imgur.com/whFjBog.png (last time I extracted these was last December, so it may look different now).

[API Suggestion/RFE] Event API wishlist

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

[API Suggestion] Maps API

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Would anyone mind if there would be one array, e.g. points, wich contains all point data (like the current points_of_interest array) instead of 4 arrays?

PoIs, tasks, and sectors use three different ID sequences, i.e. a PoI and a Task could share the same ID. You couldn’t make it an ID-keyed hash if you combined them.

[Maps API] .zip'd tiles possible?

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

The official map tile service is not the same as the Gw2.dat textures. The textures are split between background and foreground – bg being the base map that you see prior to discovering a zone/area, fg being the detail that appears when you discover it. The fg textures have some odd stuff on them outside of zone boundaries, but this gets masked out when the game composites the fg onto the bg.

By contrast, the map tile service presents a complete composite map.

I’ve been able to extract the map textures from Gw2.dat and use the corresponding PIMG (paged image) metadata files to reconstruct complete maps, but I never figured out how the masking worked.

[API Suggestion] Maps API

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Only have two suggestions at the moment, I’m sure other people will have more:

  1. Some kind of name for skill challenges. Unfortunately, I expect this falls under the same caveat as Cliff mentioned in the map_floor.json documentation: “Dynamic content, such as vendors, are not currently available.”
  2. Polygons for sectors. I spent almost two months re-exploring Tyria with a new character, taking screenshots of the map after discovering each sector, then manually drawing the boundaries to make maps for the wiki. It’s a kitten keeping those updated with new areas (guild puzzles) and other game changes, so being able to access the actual sector boundaries would be a great time-saver.

Other than that, I’m pretty happy with this API. I took Cliff’s example jsFiddle, expanded it, and turned it into a #widget for the wiki.

API errors & bugs

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

The repeated sectors are for personal story maps. Nemeton Grove, specifically, is also within “A Different Dream” and “Shadow of the Tree”, besides where it normally appears within Brisban Wildlands.

[API Suggestion] Items, Recipes, and Crafting

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

As far as icons go, I’d be perfectly happy with a simple icon_file_id. I’ve already got GW2DatBrowser to extract the files, so I don’t need the file itself presented through the API or on a cloud server or anything like that.

[API Suggestion/RFE] Event API wishlist

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

The difference between 90% and 10% health can be 5 seconds for most event “bosses”. The difference between 10% and 90% complete for many “fill-up” objectives can also be very short, if there’s only 1 player there and he turns in 50 items at once. In other words, snapshots of progress bars are unreliable indicators of the true situation, and would require constant polling to keep them meaningful.

Issue in Color API

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

That’s as intended. Before Cliff removed the non-dye colors (character hair/eye colors, mostly), many of those colors had different base_rgb values. Dyes, however, seem to have been defined more uniformly, and they all use the standard base_rgb.

[API Suggestion/RFE] Event API wishlist

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Cliff has said that the current infrastructure doesn’t support mapping to meta events, unfortunately.

matches.json empty?

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

[API Suggestion] Guilds

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

I’d also love to see the ability to change the rank as I have a automated script running on my website that lets users choose between ranks and let me know they are active.

Showing and interacting with guild chat is not so important, but would be a neat feature.

[…] I would really want to be able to read the message of the day, and if possible even change it. […] Transfer gold/silver/copper between bank slots, aswell as items./ order items.

I highly doubt that Anet is going to introduce any writeback functionality in the API, i.e. it’s going to remain read-only. In the past, they mentioned releasing a mobile app that would let you participate in chat, but we haven’t heard anything about that since release.

matches.json empty?

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Yep, the WvW APIs are wigged out right now.

[API Bug?] Item buff description missing

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

On one hand, you could say that if there’s no description, then there’s no use knowing the skill_id. On the other hand, you could say that it’s still worth knowing that there is a buff of some sort on the item. I don’t know which way is best.

In any case, it’s still good to know that this is normal/intentional and not a bug in the API so we can work around/with it.

[API Suggestion] Map Completion

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Wait, if all you want is a static image overlay, then that’s not related to the API at all.

[API Suggestion] Map Completion

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

No, this API is not one that ties directly into the game client. It’s merely a set of web-based JSON interfaces for accessing game data, and none of the current interfaces support that kind of data.

However, there are plans for implementing OAuth2, meaning you can log in to the API to access account/guild data. Once that’s in place, they might release an API for character-map data, which someone could use to write an overlay program.

[API Suggestion] Items, Recipes, and Crafting

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

I made a spreadsheet of all the LearnedFromItem recipe details and added the item_id of the consumable that unlocks it, as well as the name of the output_item_id.

https://docs.google.com/file/d/0B5NobLNMdY89TnpzVC00Zm1vemc/edit?usp=sharing

Looks like the majority of the recipes with an unlisted Unlock are where the recipe sheet is purchased for karma, although there are still some Bulk and Feast recipes with an unlisted Unlock even though you get those recipe sheets from the Mystic Forge.

[API Suggestion] Items, Recipes, and Crafting

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

And now it’s obvious that there are a lot of recipe sheets missing. Both of the ones I linked above (Eggs Beetletun, Atzintli’s Spear) are missing, as is Eda’s Apple Pie Recipe. Some of the recipes are listed (recipe_ids are 2968 for Beetletun Omelette and 2903 for Eda’s Apple Pie) and they have the LearnedFromItem flag, but the items API discovery mechanism still has some big flaws.

[API Suggestion] Items, Recipes, and Crafting

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Unlocks now list the color_id/recipe_id they unlock. Whoo!

[API Suggestion] Items, Recipes, and Crafting

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

There is currently no way for me to link one to the other, short of doing fancy regex matches.

Even that wouldn’t work all the time. Example: Recipe: Atzintli’s Spear teaches the recipe for Quetzal Harpoon. Some others aren’t quite as bad (Recipe: Eggs Beetletun teaches Beetletun Omelette), but there are a lot like this.

I second this request.

JavaScript Lib for Guild Emblem generation

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Hmm, they look better than I expected. Good job! Here’s a few things I noticed:

Based on the background ID numbering, you used my original texture archive to generate your SVGs. Moturdrn discovered that background ID 9 doesn’t exist, so everything 9 and up needs to be incremented by 1 (such that the last background is 28).

I think you might have an error in the SVG for foreground 44. I get the three dots and the center of the triskelion, but the outer arms are simply missing.

An enhancement for the form would be to split the emblem details into separate text boxes, to make it easier to change the individual values and to prevent a user from mucking up the JSON structure.

[API Bug?] Item buff description missing

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Found another one: Sonic Tunneling Tool
https://api.guildwars2.com/v1/item_details.json?item_id=42664

[API Bug?] Item buff description missing

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

https://api.guildwars2.com/v1/item_details.json?item_id=20268

This item, “Boxing Gloves,” has a buff listed in the infix_upgrade with only a skill_id, no description. I’m not sure if this is actually an error, or if it’s intentional, but it’s certainly unexpected.

Normally the buff looks like this:

          "buff":
            {
              "skill_id":"[number]"
              "description":"[string]"
            }

match_id: How do you get it?

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Check out the API/Libraries page on the wiki, there are a few Python libraries listed there that other people have already written.

[API Suggestion] Aera names

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

The English term is “region”, and it’s a static property of each zone. There’s really no need for this to be in the API.

  • Ascalon:
    • Plains of Ashford
    • Diessa Plateau
    • Fields of Ruin
    • Blazeridge Steppes
    • Iron Marches
    • Fireheart Rise
  • Shiverpeak Mountains:
    • Wayfarer Foothills
    • Snowden Drifts
    • Lornar’s Pass
    • Dredghaunt Cliffs
    • Timberline Falls
    • Frostgorge Sound
  • Kryta:
    • Queensdale
    • Kessex Hills
    • Gendarran Fields
    • Harathi Hinterlands
    • Bloodtide Coast
    • Southsun Cove
  • Maguuma Jungle:
    • Caledon Forest
    • Metrica Province
    • Brisban Wildlands
    • Sparkfly Fen
    • Mount Maelstrom
  • Ruins of Orr:
    • Straits of Devastation
    • Malchor’s Leap
    • Cursed Shore

JavaScript Lib for Guild Emblem generation

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Could you link to an example SVG output (or one converted to PNG) from your script? I’m guessing that, because you’re using SVG approximations of the game textures, it’ll simply have flat colors in the different color zones and ignore any shading/alpha characteristics. Still, some guilds may prefer a stylized emblem for use on their forum/website instead of a game-accurate representation, and this would be just the thing for them.

[API Bug] Bonuses Missing (Closed)

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

I noticed that too. I’d actually expect that to appear as infix_upgrade→buff (similar to sigils) or maybe as a new element under infix_upgrade.

API implementation library "master list"

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Looks great!

[API Suggestion] Items, Recipes, and Crafting

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

That’s the “type” element in recipe_details.json. Mystic Forge recipes are not included in the API at this time.

Request for example code for "beginners"?

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Why reinvent the wheel if you can get one for free

Because it’s fun

That’s exactly why I wrote my Perl module, even though everyone else uses PHP or Python for script-monkeying these days.

API implementation library "master list"

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Go right ahead. This was actually already discussed on the wiki, but the user who brought it up never followed through. The best place would probably be a subpage, e.g. “API/Libraries”. Maybe “API/Player-written libraries”? Or maybe that’s a bit much.

[API Suggestion] Guilds

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Both parameters, $hslbc and $base are given through the API call. In fact, you don’t even need to calculate the RGB values anymore, since Cliff added them to the API yesterday.

Cliff also said specifically that the static RGB value is not for use with guild emblems:

You still need the more detailed information if you want to apply dyes against textures yourself, such as for guild emblem compositing.

To save your CPU, you could split the function into one that builds the conversion matrix and one that applies it to an RGB value. I haven’t done that yet because I had hoped to get the image composition working first.

[API Suggestion] Guilds

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

How are you creating the “2 parts with the base colours added”? I think that’s the step I’m not getting right.

[API Suggestion] Guilds

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Well, I’ve got something that almost works for creating emblem images. I’m probably doing something wrong when applying the alpha masks.

In-game emblem:
[img]http://i.imgur.com/2HjBl4j.jpg[/img]

My version:
[img]http://i.imgur.com/EtHfAnR.png[/img]

(those aren’t working in preview, will they work when I save? edit: nnnnnnnope)

Emblem ID: 58 (textures: base color, primary color mask, secondary color mask)

Foreground primary color ID: 617 “Green”
Foreground secondary color ID: 139 “Violet”

My Perl script: @GitHub

The most obvious error is the hard edges between the two color zones, but there’s also some odd shading within the secondary color zone (middle of the octopus’s head). Anyone have any idea how this is supposed to work?

Multiple Parameters

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

https://api.guildwars2.com/v1/events.json?world_id=2102&event_id=03BF176A-D59F-49CA-A311-39FC6F533F2F

You’re welcome. (Hint: ‘?’ begins the parameter string, then you have to use ‘&’ between parameters.)

Edit: except the forum escapes the ‘&’ in that url. You’ll have to copy/paste to make it work.

[How To] Colors API

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Smiley, I think you just need to change your bgrVector (line 82) from a single-row matrix to a single-column matrix. Then swap the order in the matrix multiplication, so it matches Cliff’s order.

[API Suggestion] Guilds

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Ah, okay. I hadn’t checked through every background, I just assumed the pattern would hold after the first 3. Never expected there to be a gap.

[API Suggestion] Guilds

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

The foreground and background IDs for this match the order on the wiki (http://wiki.guildwars2.com/wiki/Gallery_of_guild_emblems). Do you know if the IDs returned by the API will match these or will there be another order for them?

The numbers I assigned to them for the wiki are simply sequential based on their file ID order within Gw2.dat. I seem to remember that this matched the order that they appear within the in-game emblem designer, so it may very well match up to the in-game IDs (although I wouldn’t count on it).

Turns out that YES, the emblems are displayed at the Emblemer in the order of their internal ID, and since my numbering matched the display order, the numbers on the wiki match the internal IDs.

Unfortunately, when I numbered the backgrounds, I forgot to account for the “blank” background, so the numbers on the wiki are (ID – 1) instead of matching the ID exactly. Still, it’s a systematic difference.

I’ve zipped up the game textures (converted to PNG) with the correct IDs, and you can grab them over here (File->Download or Ctrl+S to download). Use in conjunction with colors.json to build guild emblem wizards!

Edit: see Moturdrn’s post below for download with background IDs corrected – bg ID 9 doesn’t exist

(edited by Dr Ishmael.9685)

[How To] Colors API

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

I also created a javascript version of our internal color shifting algorithm here: http://jsfiddle.net/cliff/jQ8ga/ . This example code uses the sylvester javascript matrix library for math.

The way it works is pretty different than the processes previously described — it calculates a transformation matrix which is then applied to the color in one pass.

I was able to convert this to Perl easily. The great thing is that Perl has “native” support for matrices, i.e. just create an array of arrays. Coupled with a subroutine for matrix multiplication from my Perl books, and I’m able to reproduce all of the pre-calculated RGB values. Thanks, Cliff!

[How To] Colors API

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Yeah, some official confirmation would be nice at this point.

From the looks of Rhino’s code, and the documentation he quoted, it looks like iOS handles all of these corrections internally and silently. I’m going to go with correcting S/L before the final RGB conversion.

[How To] Colors API

in API Development

Posted by: Dr Ishmael.9685

Dr Ishmael.9685

Okay, final question (I think). Looking at Smiley’s Gist code (post #2 in this thread), he’s not correcting the S/L values before converting HSL back to RGB, and instead just correcting the final RGB values. If I follow that method, I can produce an exact match of his HTML page.

However, that doesn’t make sense. If S > 1 is outside the HSL colorspace, wouldn’t that result in an invalid conversion back to RGB? Shouldn’t we be correcting S and L to 1 before the final RGB conversion?

Example: color 1220 Shamrock (default). Smiley’s result is (0, 255, 0), but if I correct S/L first, I get (0, 220, 37).

(edited by Dr Ishmael.9685)