Inspiration

In 2019 we flew from London to San Francisco for the OpenAI Five Finals, the first competition between professional Dota 2 players and the AI that OpenAI trained on Dota 2. Inspired by OpenAI's work we built bota: an autonomous Dota 2 agent powered by GPT-OSS-20B and vLLM.

What it does

Our bota agent plays Dota 2 in 1v1, which is a mode typically used for players to develop their skills on new heroes and to practice combat scenarios. Our agent plays the game similarly to a human being and displays the model reasoning in the in-game chat. The agent can move the hero, attack, use items as well as abilities.

bota in action

How we built it

Our agent is written in Python and interacts with Dota 2 via 2 mechanisms: a socket to receive the observed game state and the LUA bot API to execute actions. We use the vLLM inference engine to run GPT-OSS-20B locally. The model is used without fine-tuning, in combination with a custom prompt to generate actions that the LUA bot API understands.

Architecture Diagram

Be sure to check out our GitHub for more details and a deep dive into the code: https://github.com/AmandineFlachs/bota

Challenges we ran into

We ran into multiple challenges to interact with Dota 2. First, the game needs to be run with a variety of custom - sometimes undocumented - arguments. Analyzing the game state serialized with Protocol Buffer sent on a socket was also challenging as a lot of things are undocumented and there is no reference implementation. Using the LUA bot API to send actions to the game is also constraining. Any mistakes meant you had to stop and restart the game, which is quite time-consuming, especially in such a competition where time is precious. We encountered a lot of bugs and edge cases in Dota 2 because implementing bots for this game is not very common. The public documentation for the bot API is outdated and new features implemented in the game are not supported by the bot API.

Accomplishments that we're proud of

We made it work even though Dota 2 was very reluctant to let our bot play the game. Scoping a project for a hackathon can be an art, and while there is still a lot of work to be done to cover all aspects of the game, the heroes, abilities and actions we choose to focus on for the hackathon have been successfully implemented.

What we learned

GPT-OSS-20B was very simple to steer to play the game the way we wanted and followed instructions well compared to other models we tried out of curiosity. It was very interesting to examine the reasoning traces generated by the model, as well as the mistakes the model sometimes makes.

What's next for bota

  • We would like to see if increasing the reasoning effort of the model would improve bota's performance. Unfortunately, as it is a synchronous system, when we tried with our RTX 5090 we encountered very slow inference time, which meant the agent was not reactive enough to play the game.
  • We would also like to expand Bota to more Dota 2 heroes and set up a livestream, similar to ClaudePlaysPokemon, where viewers can watch the agent’s reasoning unfold in real time and even interact with the game to guide its decisions.

Built With

Share this project:

Updates