Hacker News new | ask | show | jobs
by JRandomHacker42 776 days ago
MTG Arena, the new digital client for the Magic the Gathering trading-card game, uses CLIPS to implement the actual game-rules based on the English text of the cards. Magic cards are written using a very standardized language (look at custom-card communities and discussions around "templating"), but the fact that they've had such success with this approach is incredibly impressive to me.

It also leads to some really funny bugs that arise from grammar ambiguities - things like a card that says "[...] then put them into your hand" and the game losing track of what "them" refers to and putting _all_ the cards into your hand.

1 comments

Holy moly. I had my suspicions Magic would be a good candidate for something like CLIPS when it comes to software implementation. Do you have a source for that info? What an amazing bug.
The source for them using CLIPS is a conversation I had with Arena team lead Ian Adams in a Magic-community Discord.

The source for the bug is a video WotC did that I can't find right now that featured the Arena team talking about developing Kaldheim - the bug came from the card Alrund, God of the Cosmos.

Here's an article: https://magic.wizards.com/en/news/mtg-arena/on-whiteboards-n...

> So first, a quick summary of how the rules engine works. When a game of Magic is in progress on MTG Arena, the program that is tracking the state of the game and enforcing all the rules-correct card interactions is called the Game Rules Engine (GRE). It's one of the two main programs that we work on. It's written in a combination of C++ and a language called CLIPS, which is a variant of LISP.

Thanks for sharing!