barrett777 / Heroes.ReplayParser

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

Ana Q hit rate calculator #82

Closed paviad closed 5 years ago

paviad commented 5 years ago

Hi, how would I go about calculating the hit rate of Ana's q from a replay? I'm a veteran C# programmer, a few tips should be enough

koliva8245 commented 5 years ago

Calculating hit rates with abilities isn't possible. The replays keep track of actions/events, so in this case the it will keep track of when Ana's abilities is used but you won't know if it hit anything.

paviad commented 5 years ago

I can correlate heals with Q's at least that's the intention also I can calculate the heal target based on hero locations at the Q event and the Q direction

barrett777 commented 5 years ago

This unfortunately probably isn't possible for a few reasons. You can find some more info here: https://github.com/Blizzard/heroprotocol/issues/27

As kolivia mentioned, the replay file keeps track of user actions. You may be able to see if Ana tries to use her 'Q' ability (though that is a big problem by itself), and you would know what direction she tries to cast it. That's about it though, as that is all the replay file needs in order to replay the game.

You probably won't know if she casts it successfully, for example if she was stunned when trying to cast it or something. You probably won't know if it hits another hero, as hero locations aren't very precise in the replay file (at least how my library is tracking them). They are good enough general location, but not enough that you can pick out which hero is hit by an ability like this.

paviad commented 5 years ago

So the problem is recreating the game state based on replay data? In theory can we use the existing game DLL's to do that?

barrett777 commented 5 years ago

Maybe, though you're getting into uncharted territory. You may find more info in the Starcraft 2 community as well. HotS replay format and game engine are based on Starcraft 2's engine, and they've had many more years of trying to pull more data from the replay file. Good luck :)

paviad commented 5 years ago

What about running the entire game through a debugger and monitoring the memory?

barrett777 commented 5 years ago

That's beyond my expertise, so I can't really help with that. Be careful though, that sounds like it would be against Blizzard's terms of service.