Improved Dota2 lineup recommendation model based on a bidirectional LSTM

Lei Zhang, Chenbo Xu, Yihua Gao, Yi Han, Xiaojiang Du, Zhihong TianTsinghua 2020 · DOI

Abstract

In recent years, e-sports has rapidly developed, producing large amounts of standardized data that are easily accessible. This data wealth allows for the application of data mining and deep learning methods to guide players and develop winning strategies. As a premier global e-sports event, Dota2 features a complex hero system where victory is often determined by team composition. However, players frequently struggle to select the optimal lineup. This paper presents an improved bidirectional Long Short-Term Memory (LSTM) neural network model for Dota2 lineup recommendations. The system utilizes a Continuous Bag Of Words (CBOW) model to generate hero vectors, treating a lineup as a sentence and heroes as words. By analyzing the first four heroes selected, the model recommends the final hero to optimize the team's chances of success.

TL;DR

Researchers have developed an improved recommendation system for Dota2 that suggests the optimal final hero for a team lineup using a Bidirectional Long Short-Term Memory (Bi-LSTM) network. By treating hero selections like words in a sentence and incorporating a mathematical "restraint index" to calculate counters, the model achieves a 78.32% accuracy rate in predicting winning picks, outperforming the official Dota2Plus assistant in real-world testing.

What Problem Does This Paper Address?

In the high-stakes world of Dota2—a premier multiplayer online battle arena (MOBA) game—the "drafting" phase is often where games are won or lost. With over 116 heroes, each possessing unique attributes and roles (Carry, Support, etc.), the permutations for a five-person lineup are staggering.

Players face two primary challenges: synergy (how well their heroes work together) and restraint (how well their heroes counter the enemy). While veteran players rely on intuition, existing data-driven recommendation tools often fail to capture the complex, non-linear relationships between heroes. The authors sought to bridge this gap by creating a model that understands both the "grammar" of a good team and the mathematical reality of hero counters.

Methods

The authors combined Natural Language Processing (NLP) techniques with deep learning to model game strategy:

  1. Hero Vectors (Word2vec/CBOW): The researchers treated each hero as a "word" and a five-hero lineup as a "sentence." Using the Continuous Bag of Words (CBOW) model, they mapped heroes into a multi-dimensional vector space. In this space, heroes with similar roles are mathematically "close" to one another. As shown in the architecture below, the model uses the context of the first four heroes ($C_1$ through $C_4$) to represent the lineup.
The CBOW model architecture used to generate hero vectors from a four-hero context.
  1. The Restraint Index (Log5 Formula): To quantify how one hero "counters" another, the team used the log5 formula. This doesn't just look at raw win rates; it estimates the probability of Team A beating Team B based on their respective global win rates, providing a specific "forbearance index" for every hero matchup. This allows the model to weigh specific hero advantages rather than just general popularity.
Hero advantage data used to quantify the restraint index between matchups.
  1. Bi-LSTM Architecture: Unlike standard LSTMs that process data in one direction, a Bidirectional LSTM looks at the sequence of hero picks from both ends. This is crucial because the first hero picked influences the fifth, and the fourth pick provides immediate context for the final selection.
  2. The Pipeline: The model takes the hero vectors and restraint data of the first four picks, passes them through the Bi-LSTM and a fully connected layer, and uses a Softmax function to output the probability of the 116 possible heroes for the final slot.

Datasets

The study utilized a dataset from OpenDota, a well-known third-party Dota2 data service.

  • Scope: 54,218 matches recorded between May and September 2019.
  • Consistency: The authors specifically chose this window because the game version remained stable, ensuring that hero "meta" (the prevailing strategy) didn't shift mid-study.
  • Features: The data included match IDs, radiant/dire team compositions, and the ultimate match outcome.

Key Insights and Ideas

  • Lineups have "Grammar": By using Word2vec, the paper treats team composition as a linguistic problem. Just as certain words naturally follow others to make a coherent sentence, certain heroes naturally follow others to make a coherent "draft."
  • Context is Bidirectional: In a draft, the order of picks matters, but so does the total composition. A Bi-LSTM captures the "global" feel of the draft better than a unidirectional model because it considers the relationship between the very first pick and the very last pick simultaneously.
  • Mathematical Counters vs. Raw Win Rates: A hero might have a high global win rate but be a terrible choice against a specific lineup. By integrating the log5-based restraint matrix directly into the neural network's input, the model prioritizes "counter-picking" over just picking "strong" heroes.

Key Results

The model was evaluated both against historical data and in real-world "ladder" matches:

  • Objective Accuracy: When predicting the fifth hero in winning historical lineups, the model’s top recommendation was correct 78.32% of the time. The average accuracy across its top five suggestions was 67.74%.
  • Subjective Comparison: The researchers tested the model against the official Dota2Plus assistant using five real players (with MMR/ladder scores between 2600 and 4900).
  • The Bi-LSTM model achieved a 52% win rate recommendation accuracy.
  • The official Dota2Plus assistant achieved only 48%.
  • Stability: The authors noted that Dota2Plus often recommends high-win-rate heroes that are mechanically difficult to play (like Meepo or Brewmaster), whereas their model provided more stable, role-appropriate suggestions.

Limitations and Future Work

The authors identify a few hurdles:

  • Ambiguous Roles: The model struggles with "non-standard" matches where teams don't follow the traditional "one carry, one solo, one offline, two supports" structure. These "ambiguous role" matches lower the overall prediction accuracy.
  • Player Skill: The model currently assumes all players can play all heroes equally well. It does not yet account for an individual player's specific "hero pool" or mastery level.
  • Future Directions: The authors suggest that future iterations could incorporate real-time game state data or expand the recommendation to include item builds (itemization) to further assist players during the heat of the match.

Summary updated

Abstract

In recent years, e-sports has rapidly developed, and the industry has produced large amounts of data with specifications, and these data are easily to be obtained. Due to the above characteristics, data mining and deep learning methods can be used to guide players and develop appropriate strategies to win games. As one of the world's most famous e-sports events, Dota2 has a large audience base and a good game system. A victory in a game is often associated with a hero's match, and players are often unable to pick the best lineup to compete. To solve this problem, in this paper, we present an improved bidirectional Long Short-Term Memory (LSTM) neural network model for Dota2 lineup recommendations. The model uses the Continuous Bag Of Words (CBOW) model in the Word2vec model to generate hero vectors. The CBOW model can predict the context of a word in a sentence. Accordingly, a word is transformed into a hero, a sentence into a lineup, and a word vector into a hero vector, the model applied in this article recommends the last hero according to the first four heroes selected first, thereby solving a series of recommendation problems.
BibTeX
@inproceedings{zhang2020improved,
  author = {Lei Zhang and Chenbo Xu and Yihua Gao and Yi Han and Xiaojiang Du and Zhihong Tian},
  title = {{Improved Dota2 lineup recommendation model based on a bidirectional LSTM}},
  booktitle = {Tsinghua},
  year = {2020},
  doi = {10.26599/tst.2019.9010065},
}
Figure