Comment by JRKrause
3 years ago
There is a popular discord (PlayEDH) where people play MTG over webcam against one another. Due to the nature of MTG it's important that the deck each player is wielding be properly balanced in power level against each opponent. (For those unfamiliar, it's possible to construct highly efficient, and expensive, MTG decks that trigger game-winning infinite combos within 1-4 turns. There's a continuous scale of deck effectiveness from this point). These power levels are pre-checked by volunteers of this discord.
I had the idea of aggregating all decks + their graded power levels and training a prediction network capable of this task. The side effect being it could also tell you which cards in your deck could be changed to increase it's predicted power.
I ended up abandoning the project, largely due to the painful nature of parsing the discord logs. This reminds me of that project, primarily due to needing to generate a meaningful/compressed embedding of the cards prior to training the deck-level network. Anyways, nice work!
I don't feel like this is a good application of predictive networks, but maybe I'm wrong. Tiny changes in wording of a card can make or break an exploitable synergy. You can say "tigers basically look like this, ish" to an image recognizer, but you can't just say "decks that look kinda like this are super strong; decks that look kinda like that are super weak". I'd think the best approach here would be to have an agent just play the deck against other decks a million times with an evolving strategy. I know if you say the term "genetic algorithm" nowadays you get laughed at and branded as an old-fashioned ignoramus who doesn't understand real AI, but sometimes the answer is to get off the bandwagon.
Magic the Gathering cards have pretty standard and predictable wording and keywords. Not sure it could understand everything, but there would be easy patterns that apply to hundreds or thousands of cards.
Fun fact, the cards are standard enough that for MTG Arena, they actually parse them with feature grammars instead of neural networks.
2 replies →
I don't think GP is saying we'd have difficulty encoding the cards. I think they're saying that deck performance is very sensitive to minor changes, and dependent on a lot of interactions between sets of cards.
To add to that point, decks can be good or bad based on the ecosystem (meta) they're playing in. A deck that aims to rush you down might be great in a meta where players expect slow decks, but terrible in a meta where many decks have means of healing themselves.
2 replies →
Sometimes there's subtlety. Well it's a language unto itself, that's why everyone can play with any language cards (except Asian language cards sometimes) no problem. It's mostly image recognition, you see the image and you're like "Oh fuck, that's the last thing I wanted him to play!" And weep a little inside, from the pain of losing alone, no bets really. Never bet on the outcome of a casual game.
I created a (hopelessly incomplete) model of a MtG game and tried to use it to measure deck mana balance dynamically instead of statically. It was such a fun project but a ton of work and eventually I lost interest. I may resurrect it someday.
I had really grand visions of using it and machine learning (reinforcement learning) to have it pick its own decks.
https://news.ycombinator.com/item?id=31078151#31079186
I wonder if you could adopt AlphaZero to this. Something like:
- Train a model using MCTS to play MtG games. The model takes an MtG game state and estimates the “value” (how likely current player will win) and “policy” (ideal move for current player)
- Each “game” has 2 phases: drafting cards to create a deck, and then playing the actual deck. So the model learns to both a create deck and play its deck well
- After training, you input a state where both players have “drafted” their decks, right before the actual gameplay. The output “value” is the power of Player 1’s deck relative to Player 2: ideally you want this to be as close to 0 as possible.
As a bonus you also get a model capable of actually playing MtG.
One nuance is that the “value” are not a complete ordering: comparing the values, you could get a situation where deck A > deck B > deck C > deck A. Honestly this is probably a benefit because it forces the players to use “skill” vs choosing the right deck for the right opponent.
This is the reason I gave up on MTG in the 90s. I was a broke teen and it was clear that tournaments were won by the biggest investors in the cards. So I went back to chess.
IMO the game has been designed to fix those balance problems. There's various subsets of cards that are legal in tournament play and I think only "Legacy" includes all of the original cards. I used to occasionally attend new set release weekends and play some sealed duels or some 2HG with a buddy. It's a good time - you get a box with a few boosters and some time to craft your deck.
IMHO draft tournaments for "friday night magic" if that's still a thing were significantly better and more fun cuz of this.
1 reply →
>”For those unfamiliar, it's possible to construct highly efficient, and expensive, MTG decks that trigger game-winning infinite combos within 1-4 turns. There's a continuous scale of deck effectiveness from this point”
You been to FNM too? /s
The cool thing about this project is that, from what I could generate, these could be legitimate cards. 2/2 blue flying. 3/4 zombie. 2/6 red giant. This is actually really cool. I’d love to see an AI generated green red aggro deck from this just to see how it would play.
4G "Put +1/+1 counter on creature" sorcery. Each part is plausible, but the combination unappealing :)
I used to know what kind of deck someone was going to play by what they brought to the table. A bag of counters… yeah ok R/G. A box of “extra cards”? Black zombie or rat packs. Absolutely nothing? Mono blue counter burn.
Just wondering - why play over webcam instead of using cockatrice or untap.in with supplementary voice chat?
Pretty sure doing that would require solving the Halting Problem.