Slay the Spire is one of my favorite video games and combines elements of rogue-like dungeon crawlers with deck building. Having just completed a deep learning course in my final year of university, I thought Slay the Spire would be a great platform for my first machine learning project.

Deck Building is a Hard Problem to Solve

Choosing which cards to add to your deck is one of the most important strategic decisions in Slay the Spire. Players need to add good cards, remove bad cards, and upgrade important cards to improve their deck and defeat the increasing difficult enemies and bosses in a run. Determining the best card to add your deck in different situations is extremely difficult and the best players in the world still struggle to know what the right choice is all the time.

Image for post

Various enemies in Slay the Spire. Image Source: Slay the Spire Discord

To further add to the problem of evaluating which card is better to add to your deck, different cards perform better against different enemies. Typically, a card that attacks all enemies is better in a fight with multiple enemies than in a fight against a single enemy. Additionally, the strength of cards relative to the other cards in a player’s deck changes throughout a run. For example, mediocre attack cards are often a player’s main source of damage in hard fights early in the game, and therefore, are fairly valuable. However, these same cards are a lot worse relative to the other cards in a player’s deck later in the run when the player has acquired better sources of damage.

Image for post

Playable characters: Ironclad, Silent, Defect, Watcher. Image Source: Slay the Spire Discord

Each playable character has a different set of 75 unique cards which can be combined in numerous ways, creating a variety of decks and play styles. Evaluating a card based on the average damage reduced in a fight if a player adds the card to their deck, is an unbiased approach to create decks relative to these deck sets. Providing this metric to player’s helps them make the best possible choice at each decision node.

Introducing Slay-I

Slay-I is a mod available on the Steam Workshop that predicts how much damage you will take in a fight in Slay the Spire and evaluates adding, upgrading and removing cards from your deck according to average damage reduced in a fight. This encompasses post-battle card choices where player’s can choose 1 of 3 cards to add to their deck, upgrading cards at campfires and events, and removing cards at shops and events.

Image for post

Predicting damage taken this fight vs actual damage taken. Image by author

Image for post

Evaluating adding a new card to the deck.

#game-development #tensorflow #keras #machine-learning #deep-learning #neural networks

Bringing Deep Neural Networks to Slay the Spire
2.40 GEEK