barrett777 / Heroes.ReplayParser

A C# library for parsing Heroes of the Storm replay files (.StormReplay)
MIT License
223 stars 95 forks source link

Not able to get hero deaths for most replays #3

Closed barrett777 closed 9 years ago

barrett777 commented 9 years ago

The current way I am getting hero deaths isn't very good. It is accurate, but only for older replays. In the current patch 35360, this method only works for 'Garden of Terror' replays.

Currently I am getting deaths from a replay.game.event cutscene event, which I believe is the screen shatter effect playing when a hero dies. I'm not sure why this is only in 'Garden of Terror.'

The best way to track hero unit deaths would be using the in game tracker event for unit deaths - unfortunately there is a known issue in Starcraft 2 which I believe is applying to hero units here:

"There's a known issue where revived units are not tracked, ..." (https://github.com/Blizzard/s2protocol)

The hero units in Heroes of the Storm do have a death event for the hero's first death, and as the above comment suggests, they no longer receive born/position/death events after their first death.

Until Blizzard fixes that, there may be another replay.game.event we can use for tracking deaths, but I haven't found it yet.

jawnv6 commented 9 years ago

Hi, I've been poking at the replay parser over the past few days. I hit the same snag that you did on this, I can pull out the monsterID vInt on the first death but it doesn't happen after that. That same monster ID only pops up in other death event fields (when they get kills/assists I suppose?).

The camera events are where I started trying to track birth/death. I've got a few replays which don't contain any Cutscene events though, which is why I started looking into the tracker events. As far as I could tell, there was only 1 bit being stored for cutscene game events. Have you sussed out what that indicates (i.e. shatter cutscene or return-to-regular)?

barrett777 commented 9 years ago

The cutscene events also store text. As far as I know this is the only 'cutscene event' type being used, and as I mentioned in the current build it is only being used on Garden of Terror. The text for this event is "Loop Start", which is pretty generic, so it is probably something they are/were using internally.

GuillaumeCR commented 9 years ago

"I can pull out the monsterID vInt on the first death but it doesn't happen after that."

Could that be because respawning generates a new monsterId for the hero? Maybe the death event also contains the id that will be used from now on.

barrett777 commented 9 years ago

Unfortunately no :( The hero units still have the same ID after their first death, because I can still find replay.game.events targeting them.

The problem is Blizzard stops recording replay.tracker.events for these hero units after their first death.

barrett777 commented 9 years ago

Fixed! :D Not sure if it is a permanent solution, but I've found a way to track deaths. I'll push changes later once I update my 'Match Details' page

pkonecki commented 8 years ago

An other way to look at the problem is to keep track of the unit health and deduce the death of a unit when the health reaches 0. However I don't think the replay contains any health data at all so the only solution would be to compute the health of a unit at each tick by keeping track of health regen, max health depending on team level, any events of any unit damaging the unit etc. HOTS is a determinist game after all so this would be the only way of getting all information. It is a huge undertaking, not only for the initial implementation but also in keeping track of any patches that modifies any gameplay mechanic value at any point in time. The game itself already takes a lot of time to seek forward in a replay so what I'm proposing here seems downright impossible to do in an environment processing thousands of replays every hour.

barrett777 commented 8 years ago

Yeah it would be pretty much impossible that way. The replay file pretty much just records user actions, so for example I can see if a user tries to use an ability, but I don't know if they hit anything or if they were interrupted, etc