It’s a popular trope: A player gets a free card, then a competitor plays it back.
But what if it could be used to win?
A team of researchers led by Yuval Warshavsky at the Technion Israel Institute of Technology and his colleagues have discovered that using a computer algorithm to play a game like the popular Magic: The Gathering card game can beat the best players in real life.
This is the first time that such a system has been used to play real-life card games.
“This is the world’s first real-world demonstration of using a strategy to beat the players of a real-time game,” Warshajsky says.
The team tested the system against two different strategies that used the same card-trading algorithms.
One strategy was to use the algorithm to trade cards, while the other was to play the game with a strategy that focused on the cards in the deck.
The first strategy, called “deterministic trading”, uses a “topological” approach to determine how many cards are in the opponent’s deck and then “decides which cards are better than the other.”
The second strategy, which the researchers call “non-deterministical trading”, is “a brute-force approach to play.”
This means that the team needed to find the best strategy for the game in each game.
To do this, the researchers randomly generated three possible decks of cards: four red cards, two blue cards, and two green cards.
The deck of cards had to have at least two “common cards,” meaning that the deck contained the same number of cards as in the previous game.
After each game, the algorithm found out which strategy it could beat using the card data, which can then be used as the basis for a new strategy.
“The algorithm used to predict the winning strategy for each game is a single-state algorithm,” Wreshavsky says in a statement.
“However, the system we used was deterministic.”
The team first tested its method on the Magic: the Gathering card trading algorithm in the paper, “Decision-Making in the Magic Trading Game,” published in the Journal of Computer-Mediated Communication.
Then they used a machine learning algorithm to run the simulation on a set of real-players and players of the Magic card trading game.
When the algorithm was used to beat a deck of 20 different cards, it beat both the best player of the real-player deck and the best card of the deck, Warshawas says.
“We also found that it outperformed the best computer strategy in real-game competitions,” he adds.
The researchers hope to use this approach to create new games.
In future research, the team plans to use similar methods to train computer algorithms to predict what kind of cards the best deck of a game contains.
“If you’re playing a game that has a high number of common cards, then you want to know which cards to trade and which ones to not trade,” Washavsky tells Ars Technica.
“In Magic, we are interested in the best cards, so we want to be able to find out what kind the best decks are.”
He adds that the algorithm has also been used in other games to make decisions in chess, which uses a similar algorithm.
“There are a lot of chess players who are very good in chess and they are very motivated to beat each other,” he says.
This article originally appeared on the IEEE Spectrum.