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

Trying to extract data from a replay #108

Open
themhz opened this issue May 5, 2024 · 2 comments
Open

Trying to extract data from a replay #108

themhz opened this issue May 5, 2024 · 2 comments

Comments

@themhz
Copy link

themhz commented May 5, 2024

Hello there, I am trying to use this tools to export some data from my game replays, like hero damage per hero . For example I am looking for dataset like

Hero damage source | Hero damage destination | Damage Type | Level | Amount | TimeStamp
Muradin | Nazebo | Auto Attack | 1 | 100 | 10:56:12:10
Muradin | Nazebo | Auto Attack | 1 | 100 | 10:56:12:50
Nazebo | Muradin | Spell Damage {Frog hit} | 2 | 200 | 10:56:13:10
Nazebo | Muradin | Spell Damage {Frog hit} | 2 | 200 | 10:56:14:10
...

This for every hero to every hero per level in the match

I have exported the gamevetns.json but I cant figure how this file is structured. I mean its json but what does it actually mean? is there a documentation?

@koliva8245
Copy link

What you want isn't possible. The event you're probably looking for is the NNet.Game.SCmdEvent event. This event is for when an ability is used. Though there isn't a way to map the m_abilLink to determine the actual ability. Things like damage numbers are not stored in the replay, only actions are.

{'_bits': 264,
 '_event': 'NNet.Game.SCmdEvent',
 '_eventid': 27,
 '_gameloop': 7898,
 '_userid': {'m_userId': 3},
 'm_abil': {'m_abilCmdData': None, 'm_abilCmdIndex': 0, 'm_abilLink': 26},
 'm_cmdFlags': 1048832,
 'm_data': {'TargetUnit': {'m_snapshotControlPlayerId': 12,
                           'm_snapshotPoint': {'x': 524308, 'y': 454650, 'z': 48640},
                           'm_snapshotUnitLink': 1310,
                           'm_snapshotUpkeepPlayerId': 12,
                           'm_tag': 780140580,
                           'm_targetUnitFlags': 111,
                           'm_timer': 0}},
 'm_otherUnit': None,
 'm_sequence': 986,
 'm_unitGroup': None,
 'm_vector': None}

See also #27 and #28.

@MKokeshi
Copy link

MKokeshi commented Aug 8, 2024

The gameevents.json file you’ve exported from heroprotocol is indeed in JSON format, but it can be a bit complex. Here’s a quick breakdown to help you understand it:

Understanding gameevents.json

  1. General Structure: The file generally consists of a series of game events that happened during the replay. Each event might include details about actions, timings, and sometimes specific game mechanics.

  2. Event Types: Look for keys like "event", "timestamp", "source", "target", etc. These will tell you what kind of event happened, when it happened, and which heroes were involved.

  3. Damage Events: For damage data, you might find events related to "Damage" or "Combat" actions. The specifics can vary, but these are usually the sections where you’ll see details about who dealt the damage, who received it, and how much was done.

  4. Levels and Types: Details about hero levels and damage types might be nested within the events. You might need to look for additional keys or values inside each event to extract this data.

Steps to Extract Data

  1. Identify Relevant Events: Start by identifying which events are related to damage. You might need to sift through a lot of data to find the right ones.

  2. Parse the JSON: Use a JSON parser or a script to iterate through the data. Look for patterns in the event types and their structure to pull out the relevant info (like hero names, damage values, etc.).

  3. Transform the Data: Once you’ve identified the relevant events, you’ll need to transform this data into your desired format. This might involve aggregating information by timestamp, hero, or damage type.

Documentation

Blizzard doesn’t have official documentation for heroprotocol that’s widely available, but you can find a lot of community resources and tools online. Forums, GitHub repositories, and communities like the Heroes of the Storm subreddit might have some insights or tools to help with parsing this data.

Tools

You might want to look into existing tools or libraries that handle heroprotocol files. There are some open-source projects out there that can simplify this process for you.

If you need more help with parsing or if there’s a specific part of the JSON that’s confusing, feel free to share more details! I’d be happy to dive into it with you. 😊

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