How to predict Counter-Strike games using AI

Counter-stripe Pick'ems system inside the game

This Sunday the 17th will see the start of one of the game’s most important international championships, a special one because it’s the first after the launch of its new version, CS2.

I took this opportunity to try and predict the championship matches using an LLM.

TL;DR

I have used OpenAI’s GPT4 to predict all the games in 2024 CS2 PGL Major Championship. For each round I provided the matchups, articles and stats and then asked which team would win that match.

In the table below we can see the results:

ClassificationChallenger StageLegends Stage
1st (3 wins - 0 losses)ENCEFaZe
2nd (3 wins - 0 losses)Cloud9Spirit
3rd (3 wins - 1 losses)TheMongolZVitality
4th (3 wins - 1 losses)FURIAENCE
5th (3 wins - 2 losses)ApeksMOUZ
6th (3 wins - 2 losses)HeroicImperial
7th (3 wins - 2 losses)ImperialNAVI
8th (3 wins - 2 losses)Eternal FireVirtus.pro

There are three stages in this championship: Challenger, Legends and Playoffs. The table shows the 8 teams advanced to the next stage and their classification.

Later, I rerun the analysis this time using a better mechanism to get recent news and articles for each team:

ClassificationChallenger StageLegends Stage
1st (3 wins - 0 losses)Eternal FireFaZe
2nd (3 wins - 0 losses)SAWMOUZ
3rd (3 wins - 1 losses)Cloud9Spirit
4th (3 wins - 1 losses)ImperialVirtus.pro
5th (3 wins - 2 losses)HeroicVitality
6th (3 wins - 2 losses)ENCEG2
7th (3 wins - 2 losses)TheMongolZEternal Fire
8th (3 wins - 2 losses)ApeksHeroic

In both analysis, the playoff semi-finals included these 4 teams:

  • FaZe
  • Spirit
  • MOUZ
  • Vitality

Finally, Spirit is predicted to be the champion against FaZe in both runs.

You can check the full results here: first run and second run.

EDIT MARCH 16

GamerLegion will replace 9 Pandas in the championship. This is a re-analysis of everything considering it.

ClassificationChallenger StageLegends Stage
1st (3 wins - 0 losses)ENCESpirit
2nd (3 wins - 0 losses)Cloud9Vitality
3rd (3 wins - 1 losses)Eternal FireMOUZ
4th (3 wins - 1 losses)SAWFaZe
5th (3 wins - 2 losses)FURIANAVI
6th (3 wins - 2 losses)ApeksCloud9
7th (3 wins - 2 losses)HeroicG2
8th (3 wins - 2 losses)TheMongolZENCE

The same playoffs with those teams will happens but this time Vitality is predicted to be the champion against Spirit. Here are the full results

Methodology

To predict a game with precision, we need to feed the LLM as much information as possible.

This is the data and statistics we provided to the LLM when asking it to predict a game winner:

  • Context: Explaning the championship swiss stage, match format and each team performance so far.
  • Latest articles mentioning the team.
  • Overview Stats: K/D ratio and Win rate.
  • Event history.
  • Previous matchups between the two teams.

Prompt

In the end, this is how our prompt looks like:

Prompt of a game between FURIA and Eternal Fire in the 1-0 round in the Challengers stage of PGL CS2 Major Championship:

SYSTEM:

You are an expert at choosing winning Counter-Strike teams in a “pick ems” competition. The teams are playing in a championship called “PGL CS2 Major Championship”. This championship is divided in three stages: Challenger, Legends and Playoffs. We currently are in the challenger stage in which 16 teams face each other in a Swiss format. The top 8 teams are classified to the next stage and the bottom 8 are eliminated. Elimination and advancements matches are in a Best of 3 format where the others are in a Best of 1 format. This is going to be a Best of 1.

This is just for fun between friends. There is no betting or money to be made, but you will scrutinize your answer and think carefully.

The user will provide you a JSON blob of two teams of the form (for example):

{ "home": "FURIA", "away": "Spirit" }

Your output will be a JSON blob of the form:

{ "winningTeam": "FURIA", "losingTeam": "Spirit" }

You will evaluate the statistics and articles and explain step-by-step why you think a particular team will win in match. After you choose your winner, criticize your thinking, and then respond with your final answer.

In this championship, this is how both teams are performing:

Championship results

Teamwinslosseswin overloss over
Eternal Fire10TheMongolZ
FURIA10Legacy

Here are some stats to help you:

Team Stats

TeamWin rateKill death ratio
Eternal Fire61.016949152542374%1.07
FURIA54.54545454545454%1.02

World ranking

TeamWorld Ranking
Eternal Fire#14
FURIA#16

Event History

TeamPGL CS2 Major Copenhagen 2024 Europe RMR A
Eternal Fire6-8th
TeamPGL CS2 Major Copenhagen 2024 Americas RMR
FURIA1-2nd

Here are some possibly relevant news articles to help you:


MAJ3R: “Wicadia played like a padre”

Eternal Fire, led by MAJ3R, has qualified for the PGL Major Copenhagen, with a notable performance from young player Wicadia. The team has improved significantly after finding the right balance in player roles and has reached a peak world ranking of No. 11. MAJ3R cites a lack of experience and composure as areas for improvement against top-tier teams. The team’s strong work ethic and MAJ3R’s dedication are highlighted as reasons for their success. MAJ3R is optimistic about Eternal Fire’s potential to win a Major, aiming high for the upcoming tournament.


FURIA beat Liquid, Imperial trounce M80 in Monterrey

FURIA overcame an early deficit against Team Liquid to join the 2-0 pool at the Americas RMR, with arT and chelo leading the first half. Despite Liquid’s initial lead in the second half, FURIA’s economic recovery and clutch plays by KSCERATO and yuurih were decisive. The article highlights FURIA’s resilience and the individual prowess of their players as key to their victory, which could be significant in their pursuit of a spot at the Copenhagen Major.


Here are this same matchup results from the past:

Higher seed teamLower seed teamWinner of the matchEvent
Eternal FireFURIAEternal FirePARI Please 2023
Eternal FireFURIAFURIARoobet Cup 2023

The team name you choose MUST be one of the following:

  • FURIA
  • Eternal Fire

Remember to explain step-by-step all of your thinking in great detail. Use bulleted lists to structure your output. Be decisive – do not hedge your decisions. The presented news articles may or may not be relevant, so assess them carefully.

Notice that we use some Prompt Engineering concepts like Chain of thought when we ask the LLM to “expain step-by-step all of your thinking” and Self-refine when we ask it to “After you choose your winner, criticize your thinking, and then respond with your final answer.”.

Responses

Here are some interesting analysis the LLM did.

Challengers Stage: Ence vs Legacy

When evaluating the potential outcome of a match between ENCE and Legacy in a Best of 1 format at the PGL CS2 Major Championship, several factors need to be considered:

  • World Ranking: ENCE is ranked #10 in the world, while Legacy is ranked #33. This significant difference in ranking suggests that ENCE is the stronger team on the global stage.
  • Win Rate: ENCE has a win rate of 55.21%, which is higher than Legacy’s 48.31%. Although the difference is not huge, it still indicates that ENCE has a better track record of winning matches.
  • Kill Death Ratio: Both teams have an equal kill death ratio of 1.01, which means that neither team has a distinct advantage in terms of in-game performance based on this metric alone.
  • Recent Performance: ENCE has had a mixed performance in recent events, with notable placements such as 2nd at IEM Cologne 2023 and a playoff run at IEM Katowice 2024. Legacy, on the other hand, has had less exposure to top-tier international competition, with their best recent result being a 1st place finish at CBCS 2023 Season 3, which is a regional event.
  • Team Dynamics: ENCE has recently undergone a roster overhaul, including the addition of gla1ve as IGL. This change seems to have had a positive impact, as indicated by their victory over Astralis and qualification for the PGL Major Copenhagen. Legacy has also made changes, recalling b4rtiN and putting coldzera on the AWP, which could affect their team dynamics either positively or negatively.
  • Map Pool: In a Best of 1 format, the map choice can be crucial. ENCE’s performance on certain maps like Vertigo and Ancient has been strong, as seen in their matches against Astralis. Legacy’s map performance is less documented in recent international events, which could be a disadvantage.
  • Mental and Emotional Factors: ENCE’s articles suggest a team that is finding its footing and improving under new leadership. Legacy’s articles, while showing some resilience, also highlight issues with consistency and the need for composure at the Major.

Based on these factors, ENCE appears to be the stronger team going into this match. They have a higher world ranking, a better win rate, recent success in international events, and a potentially revitalized team dynamic with gla1ve as IGL. Legacy’s recent changes and less consistent performance at the international level make them the underdogs in this matchup.

However, it’s important to criticize this thinking by acknowledging that upsets can and do happen in esports, especially in a Best of 1 format where a single map can dictate the outcome. Legacy could surprise with a strong performance, particularly if their recent roster changes have quickly gelled into an effective playstyle. Additionally, ENCE’s recent roster changes, while seemingly positive, could still be in a period of adjustment, which might be exploited by Legacy.

Despite these considerations, the analysis still leans towards ENCE as the likely winner due to their stronger overall profile and recent form.

The LLM mentions the map pick, which is crucial in a best of 1 match and which is impossible to know minutes before the match starts.

We can also see its using the Self-refine, when it criticizes its own decision but still stays with it.

Challengers Stage: paiN vs Lynn Vision

To determine the winner between paiN and Lynn Vision in a Best of 1 format, we need to analyze various factors such as recent performance, team statistics, world ranking, event history, and relevant news articles. Here’s a step-by-step analysis:

  • Recent Performance: paiN has shown a mixed performance in recent events, with placements ranging from 2nd to 9-16th. Lynn Vision, on the other hand, has had a strong showing in Asian tournaments, with multiple 1st place finishes
  • Team Statistics: paiN has a higher win rate (61.33%) compared to Lynn Vision (58.70%), and a slightly better kill-death ratio (paiN: 1.09, Lynn Vision: 1.03)
  • World Ranking: paiN is ranked higher (#37) than Lynn Vision (#41), which could indicate a stronger overall performance on the international stage.
  • Event History: paiN’s event history shows they have experience in both regional and international tournaments, with consistent top placements. Lynn Vision’s history is primarily within the Asian circuit, with strong results but less exposure to international competition.
  • News Articles: The articles about paiN suggest that they have undergone significant roster changes, which could impact team synergy. However, the team has qualified for the Copenhagen Major and has shown resilience in recent matches. Lynn Vision’s articles highlight their qualification for the Major and strong performances against regional teams, but also note some weaknesses, such as their struggle with the map Vertigo.

Based on this analysis, paiN seems to have a slight edge due to their higher win rate, better kill-death ratio, higher world ranking, and experience in international competition. However, Lynn Vision’s strong regional performance and recent qualification for the Major cannot be overlooked. The Best of 1 format can be unpredictable, and Lynn Vision’s adaptability and map pool (excluding Vertigo) could give them an advantage in a single map scenario.

The LLM understands that even though Lynn Vision has won a lot of regional tournaments, this fact doesn’t translate to a good international championship performance.

Challengers Stage: TheMongolZ vs Cloud9

When analyzing the potential outcome of a match between Cloud9 and TheMongolZ in a Best of 3 format, several factors need to be considered to make an informed prediction. Here is a step-by-step analysis of the factors that will influence the decision:

  • World Ranking: Cloud9 is ranked #9 in the world, while TheMongolZ is ranked #18. The higher ranking of Cloud9 suggests they generally perform better against a wider range of teams.
  • Win Rate and K/D Ratio: The win rate for Cloud9 is 55.26%, and their kill-death ratio is 1.03. TheMongolZ has a slightly higher win rate at 64.49% and a kill-death ratio of 1.04. These statistics are quite close, indicating that both teams are competitive, but TheMongolZ has a slight edge in terms of raw performance.
  • Recent Performance: Cloud9 has had a mix of results in recent tournaments, with placements ranging from 5-8th to 21-28th. TheMongolZ, on the other hand, has shown strong performances in regional tournaments, with multiple first-place finishes. However, Cloud9’s experience in more competitive international events may give them an advantage.
  • Map Pool and Strategy: The articles suggest that Cloud9 has had issues with their map pool and strategy, particularly with the absence of a dedicated AWPer. TheMongolZ seems to have a more consistent approach to their game, which could be beneficial in a Best of 3 series.
  • Team Dynamics: Cloud9 has undergone recent changes, including Boombl4 taking on the primary AWPer role. TheMongolZ appears to have a stable roster with a clear focus on refining their playstyle. Team stability can be a significant factor in high-pressure matches.
  • External Factors: Preparation time, recent bootcamps, and the mental state of the teams can also influence the outcome. Cloud9 has had nine days to prepare for the Major, while TheMongolZ’s preparation included a European bootcamp, which could have provided valuable experience against a variety of playstyles.

Based on these factors, Cloud9’s higher world ranking and experience in international events are significant, but TheMongolZ’s recent form and slight statistical advantage cannot be overlooked. The decision is challenging, but the analysis leans slightly towards TheMongolZ due to their consistent performance and strategic stability.

This one exemplifies the ability of the LLM to grab external information that can influence the result of the match, such as TheMongolZ doing a bootcamp in Europe, plus the fact of Cloud9 does not have a dedicated Sniper player.

Article summary

Articles cannot be feed in full into the LLM otherwise the prompt would be huge since we are selecting around 20 articles for each matchup.

So, before asking for the match winner, we run each article into the LLM to retrieve its summary:

Prompt

You are an expert e-sports analyst for understanding news articles about the Counter-Strike. Currently you are analyzing how team NAME, a Counter-Strike professional organization works, what is its playstyle and how well they are performing lately.

The user will provide a sports article and you will summarize the article into 5 sentences or fewer. Your summary will highlight any team NAME positions and players that may be mentioned and relevant to the upcoming game. You need to identify key elements that can make team NAME win or lose a next match. Mentions of things like trades or stats MUST BE included. Make every word count.”

Summary example

Excerpt of HLTV article where the title says: "ROPZ: "IT DOESN'T FEEL REAL TO BE IN THE TOP 3 NEXT TO ZYWOO, NIKO" and its thumbnail is player ropz with FaZe uniform.

For this article ropz: “It doesn’t feel real to be in the top 3 next to ZywOo, NiKo”, the LLM returned:

Summary: FaZe Clan, with ropz recently named the third-best player, is adjusting to roster changes after Twistzz’s departure and frozen’s arrival. The team had a strong start in CS2 but now faces Vitality as a key rival. FaZe is preparing for the BLAST Spring Groups, aiming to qualify for the Spring Final and avoid the Showdown. Ropz looks forward to playing against his former teammate Twistzz in Liquid. The team’s main objective is to excel at the upcoming Major, with careful planning to prevent burnout during the intense event lineup.

Analysis: The article discusses FaZe’s current state and expectations, focusing on ropz’s perspective. FaZe started CS2 strongly but faced a roster change with Twistzz leaving and frozen joining. Ropz, recently named the number three player and Closer of the Year, feels confident despite the team’s break from official matches. FaZe is adjusting to frozen’s integration, with position swaps among karrigan, rain, and frozen, while ropz and broky maintain their roles. The team aims to qualify directly for the BLAST Spring Final, avoiding the Showdown. Ropz anticipates a match against Twistzz’s new team, Liquid, and acknowledges Vitality as a formidable opponent. FaZe’s primary goal is to perform well at the upcoming Major, with steps including the RMR and Katowice. The team is focused on avoiding burnout during a busy event schedule.

Article fetching

For each team, we went into its page on HLTV and grab the list of latest articles in the News Tab. Example for Team Spirit

HLTV Team page for Spirit with the "News" tab selected that shows a list with the articles mentioning the team.

Filtering articles

For articles, I used two different approaches:

  • On the first run, I simply grabbed the last 10 articles that can have any mention to the team in question
  • On the second run, I looked for the last 10 articles that explicity mention the team or its members in the title.

World ranking

In the same team page, we can see what is its World Ranking position. Example for FURIA:

HLTV Team page for FURIA highlighting its world ranking, which is #16.

Stats

General Stats

In the HLTV stats page, we can see what their general statistics. Example for NAVI:

HLTV stats page for team NAVI, highlightig its K/D Ratio and Win Rate.

Recent events results

HLTV also keeps track of past championships. Example for NAVI:

HLTV team events page for team NAVI, displaying the latests events this team participated and in which position they ended with. The first row says they got a 3-5th position in PGL CS2 Major Copenhagen 2024 Europe RMR A.

Recent events results

It is also possible to search the history for all the matchups between two teams. Example for FaZe versus NAVI:

HLTV results page for matches between FaZe and NAVI. There's three matches in the list. FaZe won NAVI in IEM Sydney 2023, NAVI won FaZe in ESL Pro League 18 and NAVI also won in IEM Cologne 2023.

An 8-month filter is applied for all of these stats.

Open Source code

The information above is scraped from HLTV website using Playwright and it uses the OpenAI API to interact with GPT4 engine.

All the code of this blog post is available here. You can run our own version and tweak any metric provided to the LLM.

Next steps

I’ll update this post after the championship ends to evalute the precision of these predicts.