{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Analysis of Multiple Games\n", "First run `HotS replays to dataframe.ipynb` to form `hero_died_all.csv` and `building_position_all.csv`" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\pandas\\compat\\_optional.py:138: UserWarning: Pandas requires version '2.7.0' or newer of 'numexpr' (version '2.6.9' currently installed).\n", " warnings.warn(msg, UserWarning)\n" ] } ], "source": [ "import pandas as pd\n", "import plotly.express as px\n", "import base64\n", "\n", "from replay_to_dataframe import *" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "# import data\n", "hero_died_all = pd.read_csv(\"hero_died_all.csv\")\n", "building_position_all = pd.read_csv(\"building_position_all.csv\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "-------\n", "### Calibrate points to map\n", "\n", "Mannually look at the map and the building poition of forts and spawn location " ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [], "source": [ "map_axis_scaling_df = pd.DataFrame(columns=['map_name','xmax','ymax',\n", " 'xaxes_translate', 'xaxes_scale',\n", " 'yaxes_translate', 'yaxes_scale'])\n", "\n", "map_axis_scaling_df.loc[:,\"map_name\"] = list(set(hero_died_all.map))\n", "map_axis_scaling_df.loc[:,[\n", " 'xaxes_translate', 'xaxes_scale',\n", " 'yaxes_translate', 'yaxes_scale']] = [0, 1, 0, 1]\n", "\n", "for map_i in map_axis_scaling_df.index:\n", " building_position = building_position_all.loc[building_position_all.map_name == \n", " map_axis_scaling_df.loc[map_i,\"map_name\"]]\n", " \n", " # set axis max\n", " map_axis_scaling_df.loc[map_i, [\"xmax\", \"ymax\"]] = [\n", " max(building_position.x) + min(building_position.x),\n", " max(building_position.y) + min(building_position.y) \n", " ]" ] }, { "cell_type": "code", "execution_count": 309, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | map_name | \n", "xmax | \n", "ymax | \n", "xaxes_translate | \n", "xaxes_scale | \n", "yaxes_translate | \n", "yaxes_scale | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "Tomb of the Spider Queen | \n", "247 | \n", "198 | \n", "0 | \n", "1.33 | \n", "1.5 | \n", "0.83 | \n", "
1 | \n", "Garden of Terror | \n", "248 | \n", "216 | \n", "-0.5 | \n", "1.07 | \n", "3.5 | \n", "0.74 | \n", "
2 | \n", "Volskaya Foundry | \n", "248 | \n", "187 | \n", "-0.05 | \n", "0.98 | \n", "-2.8 | \n", "0.92 | \n", "
3 | \n", "Alterac Pass | \n", "248 | \n", "215 | \n", "0.35 | \n", "1.182857 | \n", "-1.5 | \n", "1.15625 | \n", "
4 | \n", "Sky Temple | \n", "247 | \n", "205 | \n", "-0.25 | \n", "0.99 | \n", "5.75 | \n", "0.9 | \n", "
5 | \n", "Infernal Shrines | \n", "248 | \n", "192 | \n", "-0.9 | \n", "1 | \n", "6.65 | \n", "0.9 | \n", "
6 | \n", "Towers of Doom | \n", "247 | \n", "181 | \n", "0 | \n", "0.96 | \n", "1 | \n", "0.91 | \n", "
7 | \n", "Dragon Shire | \n", "248 | \n", "194 | \n", "-1.1 | \n", "1 | \n", "1.15 | \n", "0.94 | \n", "
8 | \n", "Cursed Hollow | \n", "248 | \n", "215 | \n", "-1 | \n", "0.98 | \n", "-0.25 | \n", "0.84 | \n", "