Pretty good! All of the cards I saw were reasonably balanced - not unlike looking through random cards in a new set. Makes me think there could be a game type online where all cards are automatically generated. Or, perhaps a player could fine-tune their generator and play with totally novel cards that fit their preference or play style.
There was a very popular Twitter account that was tweeting out a similar concept (starting way back in 2015, even!) https://twitter.com/RoboRosewater
LoadingReadyRun, a very popular MTG YouTube channel, even did a cube draft using only cards that were generated by RoboRosewater that I thought was funny to watch https://youtu.be/UuG5YLbwsQk
My husband and I play MTG (and do some speculative card investments on the side) and have been cracking up while slowly making our way through the LRR vod for this new AI Masters cube. So much great stuff.
Oof, now there's a name I have not heard in a long while! Has it really turned into a MTG channel? It used to be first and foremost a sketch comedy group that would occasionally do gaming videos.
LoadingReadyRun frequently has done RoboRosewater and other AI MTG card segments during their Desert Bus telethon for charity.
There is nothing so funny as seeing these folks, sleep deprived and loopy, trying to read out these cards without being incapacitated with laughter. I've seen double and triple takes from just looking at the card combined with what the AI called it, and once they did a segment called 'Is It Playable Or Is It Not' off these cards that was very special... riffing straight-faced about pro strats on how the cards are played, except the cards are gibberish, so some offhand remark corpses the whole room...
Hey, a few months back I trained a NN to generate MTG cards. I submitted a post to the MTG subreddit but it got blocked as spam and I never managed to get the mods to approve it.
My question was whether natural language generating networks could be used as a tool to assist game design. I must say I'm quite impressed with the results. Many cards could be legit with minor tweaks and some balance.
The point isn't to produce fully procedural content, but to assist designers to produce better content faster. Honestly I think people should start taking these tools seriously in the procedural content generation world.
Guardian of Chains
Counter target spell. It deals 4 damage to any target
Orchid's Fury
Target Vampire creature gets +1/+0 until end of turn
Surveyor's Arch
Untap target player. It deals 3 damage to that player. You lose 1 life
Partisans of the Undying
Search your library for a basic land card, reveal that card, put it
into your hand, then shuffle
Caravan Ritual
Enchant creature When caravan Ritual enters the battlefield, return
target creature to its owner's hand. Activate only during your upkeep.
Equip {2}
Brahms of the Grave
When Ithabadi Troghr enters the battlefield, return target creature
card from your graveyard to your hand. It gains haste until end of
turn'
Sleeping Dread Knight
Flying (This creature can't be blocked except by two or more creatures
card types.) Whenever Sleeping Dread Knight deals combat damage to a
player, creatures you control get +X/+X until end of turn
Genswurm, the Flesh Orchard
When Gnojscos, God of Vampires enters the battlefield, sacrifice a
land. {5}{G}{G}, Sacrifice Genswurm: Draw a card
Storm Call
Choose up to two target lands. You gain 1 life. An opponent has "{T},
Sacrifice Storm Call: Regenerate this permanent, then create a token
with "{T}, Sacrifice Storm Call: Add up to X +1/+1 counters."
Wandering Hollow
{T}: Create a red and white Zombie artifact creature token with base
power and toughness 5/5. Illus. Angel Albatross on the battlefield
(This creature enters the battlefield with X +1/+1 counters on it.
When it dies, return it to the battlefield under your control.)
I had another tool to generate images of the AI-generated cards but unfortunately using Wine + Magic Set Editor on Linux is very fussy. I might revisit it someday.
Also you found an error. “Your opponent” is not valid in the language of M:TG it needs to be “target opponent” because “your opponent” is not well defined outside of two-player games.
I swear I also remember some burn spells that target a creature and then also deal damage to that creature's controller. I'd guess the wording came from trying to combine that with something else.
This is really cool! I noticed a few things you might be interested in:
It looks like there might be issues rendering mana costs that have, e.g., 1GG where it does not render the second G. That is to say, it's rendered but only the barest left edge can be seen. This appears to only be the case if the card's name is sufficiently long (I noticed this with "Bethen, Cenn's Heavenly Sleep").
That being said, I have no idea how powerful Bethen, Cenn's Heavenly Sleep really is as a 4/4 flyer because it's CMC is "at least 3" because I can't see the full mana cost. The mana costs that I can see seem to suggest that the card's strength matches the mana cost pretty well, though, so I'd guess Bethen's cost was 4 or 5.
The text can sometimes say some weird things (from a 2/2 Zombie creature that costs 1 B(lack) called Null Slayer; also Zombie Human Clue is my new favorite creature type):
> (1 B(lack), Exile this card from your graveyard: Create a token that's a copy of it, except it's a black Zombie Human Clue [it's amusing to me that the reincarnated token gains the Human type] with no mana cost. Exile it at the beginning of the next end step or if it would leave the battlefield [the latter half is redundant with it being a token]. You gain life equal to the life lost this way [good to know?].)
It's still really impressive the effects it comes up with!
I'm having too much fun with this. I just generated Pyromancer's Purge[0] (it doesn't do anything and I can't stop giggling to myself; I want more of these that seemingly do something but then actually just nothing):
1R
Instant
This spell costs 1 less to cast if you control a creature with power 4 or greater.
Scavenge 1R (1R, Exile this card from your graveyard: Put a number of +1 / +1 counters equal to this card's power on target creature. Scavenge only as a Sorcery.)
>Exile it at the beginning of the next end step or if it would leave the battlefield [the latter half is redundant with it being a token].
It's not necessarily redundant or useless, there are some cards that will trigger off exiling permanents, or count the number of permanents that have been exiled during the turn to change how powerful an ability is, so if it was destroyed in battle or kill-spelled and instead exiled, it would be more useful than it simply being destroyed unexiled since it would trigger the ability or increase the count of permanents exiled that turn.
Not quite, it actually does fully exile, and even exists very briefly in the exile zone, but then fizzles once state based actions are checked again, which is usually very quickly.
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.
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.
EDH less so though due to the bigger deck size and 1 copy per card limitation. This means you end up with bigger groups of cards with common synergies vs specific sets of cards you need to draw in regular 60-card.
Exactly - the landscape of decks is extremely chaotic and I can't imagine gradient descent having any real power to discover the few towering singularities of super-exploit power-decks when changing a 3 to a 2 in the middle of the effect description of one card would render the same deck just meh. You don't really find exploits by approaching them slowly from a distance.
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.
>”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.
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.
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.
Drafts for new set releases are definitely some of my fondest memories.
Everyone opening new cards with no idea what they're going to get. You had to be extremely adaptable and there were different strategies to employ within the metagame of the format.
Illustrations are impressive, but text seems very fragile. I generated in sequence from names:
Ice Lake
Land - Islanders
T: add U or R
Tiger Lake
Land
Tiger Lake enters the battlefield tapped
T: add U or R
Alder Lake
Land
Alder Lake enters the battlefield tapped
T: add U or R
Cannon Lake
Land
Cannon Lake enters the battlefield tapped
T: U or R
"Rocket Lake" is completely wrong:
1R
Two-Headed Dead
Instant
Rocket Lake deals 1 damage to target creature
Comet Lake
Land
T: add 1
1,T, sacrifice Comet Lake: search your library for a basic land card, put it onto the battlefield tapped, then shuffle
Coffee Lake
Land
T: add 1
T: add U or R
Whiskey Lake is drunk:
Whiskey Lake
Land
T: add 1
1,T: add U, U, U or U, U, or U, U, or U,or U,or U,or U,or U,or U,or U, [truncated]
96 comments
[ 3.2 ms ] story [ 169 ms ] threadLoadingReadyRun, a very popular MTG YouTube channel, even did a cube draft using only cards that were generated by RoboRosewater that I thought was funny to watch https://youtu.be/UuG5YLbwsQk
https://www.youtube.com/watch?v=bbqS7PXKFhc
This was created by people on the MTG Neural Net Discord - if you're interested it might be worth checking out https://discord.gg/EH4BTDk
There is nothing so funny as seeing these folks, sleep deprived and loopy, trying to read out these cards without being incapacitated with laughter. I've seen double and triple takes from just looking at the card combined with what the AI called it, and once they did a segment called 'Is It Playable Or Is It Not' off these cards that was very special... riffing straight-faced about pro strats on how the cards are played, except the cards are gibberish, so some offhand remark corpses the whole room...
My question was whether natural language generating networks could be used as a tool to assist game design. I must say I'm quite impressed with the results. Many cards could be legit with minor tweaks and some balance.
The point isn't to produce fully procedural content, but to assist designers to produce better content faster. Honestly I think people should start taking these tools seriously in the procedural content generation world.
This is the (pretty rough) repo with my code.
https://github.com/angarg12/this_trading_card_does_not_exist
These are some examples of cards
Guardian of Chains Counter target spell. It deals 4 damage to any target
Orchid's Fury Target Vampire creature gets +1/+0 until end of turn
Surveyor's Arch Untap target player. It deals 3 damage to that player. You lose 1 life
Partisans of the Undying Search your library for a basic land card, reveal that card, put it into your hand, then shuffle
Caravan Ritual Enchant creature When caravan Ritual enters the battlefield, return target creature to its owner's hand. Activate only during your upkeep. Equip {2}
Brahms of the Grave When Ithabadi Troghr enters the battlefield, return target creature card from your graveyard to your hand. It gains haste until end of turn'
Sleeping Dread Knight Flying (This creature can't be blocked except by two or more creatures card types.) Whenever Sleeping Dread Knight deals combat damage to a player, creatures you control get +X/+X until end of turn
Genswurm, the Flesh Orchard When Gnojscos, God of Vampires enters the battlefield, sacrifice a land. {5}{G}{G}, Sacrifice Genswurm: Draw a card
Storm Call Choose up to two target lands. You gain 1 life. An opponent has "{T}, Sacrifice Storm Call: Regenerate this permanent, then create a token with "{T}, Sacrifice Storm Call: Add up to X +1/+1 counters."
Wandering Hollow {T}: Create a red and white Zombie artifact creature token with base power and toughness 5/5. Illus. Angel Albatross on the battlefield (This creature enters the battlefield with X +1/+1 counters on it. When it dies, return it to the battlefield under your control.)
Example:
Fire Bomb 2R Instant
the mana is loaded as 2R instead of 2(Mountain Symbol) and the name/type don't seem to line up with what is generated.
Is there something I am missing here or do those inputs just override what is on the card?
I also have a Colab Notebook which lets you generate cards from a trained AI on it, allowing you to specify components of cards to constrain the generation: https://colab.research.google.com/drive/1VOt090UzvltoBgMdUZm...
I had another tool to generate images of the AI-generated cards but unfortunately using Wine + Magic Set Editor on Linux is very fussy. I might revisit it someday.
That's crazy powerful for 2 mana!
[1]: https://scryfall.com/card/leg/6/clergy-of-the-holy-nimbus
[2]: https://scryfall.com/card/ymid/14/clone-crafter
[3]: https://scryfall.com/card/ugl/62/gus
"Chandra's Outrage deals 4 damage to target creature and 2 damage to that creature's controller."
I have for a long time wanted to skin MTG with the names and images from /r/bossfights
Hacker - Creature (Human Wizard) 3U Flash, Flying, Haste 2 / 2 "When it cries out, look around for prey."
It looks like there might be issues rendering mana costs that have, e.g., 1GG where it does not render the second G. That is to say, it's rendered but only the barest left edge can be seen. This appears to only be the case if the card's name is sufficiently long (I noticed this with "Bethen, Cenn's Heavenly Sleep").
That being said, I have no idea how powerful Bethen, Cenn's Heavenly Sleep really is as a 4/4 flyer because it's CMC is "at least 3" because I can't see the full mana cost. The mana costs that I can see seem to suggest that the card's strength matches the mana cost pretty well, though, so I'd guess Bethen's cost was 4 or 5.
The text can sometimes say some weird things (from a 2/2 Zombie creature that costs 1 B(lack) called Null Slayer; also Zombie Human Clue is my new favorite creature type):
> (1 B(lack), Exile this card from your graveyard: Create a token that's a copy of it, except it's a black Zombie Human Clue [it's amusing to me that the reincarnated token gains the Human type] with no mana cost. Exile it at the beginning of the next end step or if it would leave the battlefield [the latter half is redundant with it being a token]. You gain life equal to the life lost this way [good to know?].)
It's still really impressive the effects it comes up with!
1R
Instant
This spell costs 1 less to cast if you control a creature with power 4 or greater.
Scavenge 1R (1R, Exile this card from your graveyard: Put a number of +1 / +1 counters equal to this card's power on target creature. Scavenge only as a Sorcery.)
[0] https://www.urzas.ai/cards/?card_id=b85a4661-f723-4419-ae64-...
It's not necessarily redundant or useless, there are some cards that will trigger off exiling permanents, or count the number of permanents that have been exiled during the turn to change how powerful an ability is, so if it was destroyed in battle or kill-spelled and instead exiled, it would be more useful than it simply being destroyed unexiled since it would trigger the ability or increase the count of permanents exiled that turn.
Thanks for the clarification!
To explain my position a bit more, I was considering, e.g., Restoration Angel but that's still moot with your point.
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!
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.
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
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.
- 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.
Everyone opening new cards with no idea what they're going to get. You had to be extremely adaptable and there were different strategies to employ within the metagame of the format.
> Cabal Transfixion - Instant Add {B} for each opponent. “Reveal the top card of your library. You choose a card.” -- Ignore. 1 {B}
It's been a while since I played, but flavor text is not actionable, correct? Pretty funny
2/2 red flying angel with a 4R cost, a bit expensive BUT its ability is pay R and get +1/+0. Damn.
https://www.urzas.ai/cards/?card_id=82e1f185-2cfa-4b07-96b5-...
text right to cost.
effect is all mangeld up "+1+1/+0" ? "creatures you control gain control of artifcats you control"?
flavor text talks about shuffling hands.
https://www.urzas.ai/cards/?card_id=4ca04b29-f84c-4d48-95d8-...
https://www.urzas.ai/cards/?card_id=511b085d-da3a-4ab0-af20-...