#1 - Aug. 20, 2012, 1:26 p.m.
But is it really necessary to put so many long strings into each profile/hero json? Especially the skill descriptions, simpleDescriptions, quest names and even some slugs (quests) produce a lot of traffic without providing profile/hero relevant data.
Of course it makes the json more human readable, but it's a programming interface, not for humans. And a 20 KB hero json is neither comfortable nor efficient.
If the applications UI is non-english, you can't even use the descriptions ... :-(
My suggestions is to use short IDs like simple integers, "q2" or "quest3" and provide for each language separate jsons for the real texts (d3_api_en.js, d3_api_de.js, ...):
{ "quests": ["The Fallen Star", "q2": "The Legacy of Cain", "quest3": "A Shattered Crown", ...],
"skill_descriptions": [...],
"skill_simple_descriptions": [...],
"runes": [...] }
They could even contain the long-awaited killer ids and killer locations (for all languages, please).
There's another problem with the progress data. Let's say you need the highest of all consecutively completed quests. Since uncompleted quests are omitted, no unique keys are used and the position and order are undetermined, it is very complicated to iterate through the array. The script needs an own array of the slugs and has to compare each value to identify the quest ... :-(
Combined with the first suggestion to use short ids, I would love to see the progress data in a shape like this:
"progress": {
"normal": { "act1": [1,1,1,1,0,0,0,1,1,1], "act2": [1,1,1,0,0,0,0,0,0,0], "act3": [0,0,0,0,0,0,0], "act4": [0,0,0,0]},
"nightmare": ...
}
Or give the quests short keys:
"act1": {"q1": 1, "q2": 1, "q3": 1, ...
Or with booleans:
"act1": [true,true,true,true,false,false,false,true,true,true]
Or put all quests of a difficulty in one array ...
Anything thats easier to iterate is welcome! :)