

Replays are log files that enable the user to watch and analyze games.īefore Replays were introduced with Patch 1.08 there have been no options for players to review a match. These can be saved manually after a game or being recorded automatically with the help of third party software. Replays are files generated by StarCraft Brood War's engine with the extension.
#Dota replay player how to

Player_2_obs_log = data # first five players are Radiant.ĭf = pd.om_dict(player_2_obs_log) # transform it into a pandas DataFrame. To work with this object, we'll first need to read it through Python with requests: import requests In the player's object, you'll see the nested objects from within like this: "players": [ To better view this, you'll need some sort of JSON viewer tool. To replicate the figure above, we'll need to go to the API documentation where you'll end up using the Matches endpoint where you'll see a response schema that returns a JSON object.
#Dota replay player code
We can replicate this setting (minus the filters) with some Python code and using the API. If you go through the vision tab on the website, you'll find the total ward placement of the map, with the option to filter by the minutes, by which the hero placed it, as well as sentries. When you provide a match through the website interface, you can get some interesting match statistics (if they are parsed), for example, ward placement. We'll be looking at API documentation to pull some statistics using Python and libraries typically found in Anaconda as well as comparing it to the web version. From having a replay parser to an API provider. That's where the OpenDota Project comes in, a Community-maintained open-source Dota 2 data platform. Some interesting statistics can pop up by reviewing the game, like ward placement over time, or how much damage each hero's spells do over the entire match? However, some statistics need to be viewed by watching the replay of the match and some people don't have time for that. This includes a variety of data that help players recognize what they might have done right or wrong in a typical pub of DotA 2.

If you ever played Dota2, you might have tinkered with statistics in the post-game screen.

Image from Liquipedia article " Observer Ward".Īn introduction to OpenDota and how to extract data from parsed replays from its API using Python. Brandon Lizarraga | Tuesday, October 19th, 2021 |
