heroprotocol icon indicating copy to clipboard operation
heroprotocol copied to clipboard

How to map from m_abilLink to the actual hero ability?

Open crorella opened this issue 10 years ago • 10 comments

Hello,

I'm trying to retrieve abilities casted by heroes, in gameevents I see a SCmdEvent is created every time a hero uses an ability:

{'_bits': 264,
 '_event': 'NNet.Game.SCmdEvent',
 '_eventid': 27,
 '_gameloop': 108,
 '_userid': {'m_userId': 9},
 'm_abil': {'m_abilCmdData': None, 'm_abilCmdIndex': 0, 'm_abilLink': 173},
 'm_cmdFlags': 256,
 'm_data': {'TargetUnit': {'m_snapshotControlPlayerId': 12,
                           'm_snapshotPoint': {'x': 849167,
                                               'y': 420404,
                                               'z': 32304},
                           'm_snapshotUnitLink': 938,
                           'm_snapshotUpkeepPlayerId': 12,
                           'm_tag': 46137345,
                           'm_targetUnitFlags': 111,
                           'm_timer': 0}},
 'm_otherUnit': None,
 'm_sequence': 1,
 'm_unitGroup': None}

Is there any way to determine what ability was the hero using?

Thanks in advance

crorella avatar Feb 12 '16 22:02 crorella

That index is a relative index into that specific build's ability data. To map it properly you would either need to read the ability data from that build, or we could add the mapping into the replay file (which could unfortunately increase the replay file size in a non trivial way). Thanks for bringing it up though I don't have much useful suggestions at the moment.

tenarsis avatar Feb 19 '16 06:02 tenarsis

Thanks for the reply. Instead of adding the mappings to each replay, why not just create a file and place it on the website or here at github? Thanks

crorella avatar Feb 19 '16 19:02 crorella

@tenarsis can you please explain how to get this info?

crorella avatar Apr 18 '16 19:04 crorella

@tenarsis any update?

crorella avatar Jul 21 '16 01:07 crorella

@tenarsis I was finally able to get the list of abilities for each build in an automated way. Can you please explain how to create the mapping?

crorella avatar Mar 25 '17 23:03 crorella

@crorella Did you ever figure out how to relate ability lists to the m_abilLink ID? There's a bunch of parsers that will output ability lists nowadays, but I can't find any information on what the IDs actually signify or how to derive them.

Sancus avatar Oct 31 '18 02:10 Sancus

You can get an array of all heroes by parsing ConfigData (mods/heroesdata.stormmod/base.stormdata/gamedata/configdata.xml) and iterating the <HeroArray value=""/> values, I'm assuming that's how it determines the load order for m_abilLink.

In SC2, you can use the map editor to export a balance data file, which has all of these links.

neptuwunium avatar Oct 31 '18 12:10 neptuwunium

Yeah that seems roughly correct, but very roughly. m_AbilLink index numbers do correspond with the order abilities appear in each of the XML files at mods\heroesdata.stormmod\base.stormdata\gamedata\heroes. However, the loading order seems more complex than the list in ConfigData.

"New" heroes(the ones in mods/heromods rather than mods/heroesdata.stormmod) seem to be tacked on in a different order. For example, Valeera comes right before Valla('demonhunter'), but her Sinister Strike is 953. Valla's Q is 307, Xul, being an old hero who comes after Valla, has the much lower indices, using 490 for his 1(Bone Shield). There are also some generic things not in these XML files, such as Mount(Z) which is 112, and loading order+xml files for these non-specific-hero abilities are not listed in that ConfigData either.

Sure would be nice if we had an easy way to export like SC2 :)

Sancus avatar Nov 01 '18 08:11 Sancus

@koliva8245 has done a lot of great work making an easy, automated way of parsing all this with https://github.com/koliva8245/HeroesDataParser. I don't see m_AbilLink specifically but koliva might be willing to explain how to get it from the parsed output and/or add it.

MGatner avatar Nov 01 '18 13:11 MGatner

Sorry can't, no easy way. I think the way it was done for StarCraft 2 was that the map editor had an export data option or something. So either blizzard would have to export the data or maybe someone could import all the Hots data in the SC2 editor and export it.

koliva8245 avatar Nov 01 '18 14:11 koliva8245