Overall workflow of the framework
1. Dota 2 is running.
2. Every game tick, a Lua addon reads the current game state and writes it in a JSON file.
3. A web API processes the game state and sends it to the Python 5v5 framework.
4. Here, your python bot receives the game state info, “thinks”, and triggers actions for all 5 Radiant heroes.
5. These actions are sent back to the running game via Web API and Lua addon.
Setting all up
Note: due to a Dota 2 Workshop Tools restriction, this framework only works on Windows.
Here’s a video tutorial that summarizes the installation process and initial setup process.
Follow these steps to get all components ready:
1. Install Dota 2 from Steam: https://store.steampowered.com/app/570/Dota_2
2. Install Dota 2 Workshop Tools from the installed game on Steam.
3. Download the 5v5 framework https://github.com/ellakk/5v5dota2ai-framework
4. Download the addon https://github.com/ellakk/5v5dota2ai-addon
5. Copy the files located in the Dota2 AI Addon folder and put them in SteamLibrary/steamapps/common/dota2 beta.
6. Install any Python environment of your choice. E.g. Visual Studio Code or PyCharm.
Launching the framework
1. Play Dota 2 with the Launch Dota 2 – Tools option
2. On the Workshop Tools window, look for the dota2ai addon, and launch it! This will play Dota 2. Wait until the main menu screen shows up and leave it running in the background.
3. Open the Console (Vconsole2) from the asset browser.
Running your own bot!
1. Run the 5v5 framework from your Python environment.
NOTE: In the current version you don’t need to list your bots’ classnames as parameters. This is now done in the project’s settings file.
2. On VConsole2, run the following command:
dota_launch_custom_game dota2ai dota