News for hackers. Stuff that matters.
Re:Generating Magic cards using deep, recursive neural networks by derefr on Wednesday June 10, 2015 @10:05PM (#9697039)
Reminds me: it feels to me like MTG card text (excluding flavor text) obeys a formal grammar of some sort. Does it?

If it does, the NN's could possibly be made a lot more powerful if you put a "parser" in front of its input end (so it was being fed ASTs instead of text) and a "code generator" on the output end (to convert confabulated ASTs back into text).

Re:Generating Magic cards using deep, recursive neural networks by wlphoenix on Wednesday June 10, 2015 @11:44PM (#9697368)
I'm not sure if it's officially a formal grammer, but there are definitely correct and incorrect phrasings for certain effects, and those are changed over time with official rewordings posted for old cards.

It's one of the ways that unofficial card spoilers are judged. If there are phrasings that sound "out-of-style" for the effect, its usually judged as a fake from the first pass.

Re:Generating Magic cards using deep, recursive neural networks by careersuicide on Wednesday June 10, 2015 @11:55PM (#9697410)
My understanding (based on some old blog posts[1]) is that while there's no (published) formal grammar there's definitely a set of internal rules that WoTC uses for determining how things are phrased. What is considered "technically correct" has changed somewhat over the years. I believe Sixth Edition was the first attempt to standardize and make consistent card text. Generally though cards that do the same or very similar things are going to follow consistent word ordering.

For example take Shrewd Hatchling[2] and Coral Reef[3]. Both are fairly different cards, but notice the wording of the first part of their respective card text:

> Shrewd Hatchling enters the battlefield with four -1/-1 counters on it.

and

> Coral Reef enters the battlefield with four polyp counters on it.

Cards with that sort of ability are (almost) always going to have it phrased in a way that fits the pattern of "<card name> enters the battlefield with <n> <type> counters on it."

Lots of other sorts of common mechanics are the same. Additionally, there are the so called "Golden Rules"[4] which are important to take note of when parsing the text of a card.

While Googling for links for this reply I found Gleemin[5], a "rules engine that aims to fully and correctly implement the game's tournament rules, an AI player programmable with expert knowledge and an interpreter for the game's language (the rules text on the cards)"! Seems you're not the first person to think about this!

[1]: http://archive.wizards.com/Magic/Magazine/Article.aspx?x=mtg...

[2]: http://gatherer.wizards.com/Pages/Card/Details.aspx?multiver...

[3]: http://gatherer.wizards.com/Pages/Card/Details.aspx?multiver...

[4]: http://mtgsalvation.gamepedia.com/Magic_Golden_Rules

[5]: https://github.com/stassa/Gleemin