Magic: The Gathering engine Arcana stalls on Liliana's exponential Zombie emblem

The essay is a first-person account by the developer of Arcana, a Magic: The Gathering rules engine. The author calls Magic remarkably complex, even Turing complete, and lists complaints about existing software. Arena, made by Wizards, has an incomplete card catalog, poor ranked matchmaking and weak performance when the stack is large. MTGO fixes the catalog but has low adoption and an outdated interface. Forge, an independent implementation, has poor AI play, buggy multiplayer, an unintuitive interface and performance that is better than Arena's but still not ideal.

The author began theorizing about better AI play of Magic as early as 2024 and started implementation work only in mid 2026. After evaluating Forge, the author decided it was not feasible to get it to a performance level suitable as an experimentation environment for reinforcement learning on Magic, and wrote Arcana instead, designed for multiplayer from day one. The central difficulty, the author says, is that abilities in Magic can compound exponentially, and the number of checks needed to make sure no further side effects go on the stack grows exponentially too.

The essay first sets up a deck the author once devised around Scute Swarm, a card that doubles its copies whenever a land is played. Combined with cards that gain life for each creature entering, a token doubler and a life-gain doubler, it makes life totals explode. Below six lands a Scute makes only an ordinary 1/1 Insect; with six or more it makes a copy with the same landfall ability. With Soul Warden and Essence Warden in play (each gives one life per new Scute, so four per arrival with the life-gain doubler), the author's short loop shows that eight land drops from one Scute yield 6,561 Scutes and 26,240 life gained. Players start at 20 life, and the author's own highest life total in a paper game, playing other decks, is around 150. Arcana does not yet support Scute Swarm, deliberately. The trouble came from another card.

That card is Liliana, the Last Hope. Her ultimate creates an emblem that stays for the rest of the game even if the planeswalker is removed. At the beginning of each of its controller's end steps, the emblem's ability counts the Zombies that player controls and creates that many more, plus two. With six Zombies, it creates eight and leaves fourteen. Starting from no Zombies and one emblem, with nothing else adding or removing Zombies, eight resolutions give 510 Zombies. Unlike Scute Swarm, destroying the Zombies does not stop the growth: the emblem remains and the next resolution produces two more. Arcana implements the rule directly: it counts matching Zombies, sets x to two plus that count, and loops x times, pushing a separate CreateToken effect for each new Zombie. The engine must then process every arrival, including rules checks and the abilities each one triggers.

The stall surfaced during a test campaign. The author had 64 Pioneer decks and a list of 37 cards with known rules issues, and wanted to decide which gaps to fix next. The 64 decks make 2,016 distinct pairs; each pair played twice, once with each deck going first, gives 4,032 games. As something like fuzzing, the author scheduled that whole lineup another 100 times, each with a different random seed and with both players choosing actions at random, to look for panics, crashes or stalls. The roughly 400,000 independent games ran on a cluster. Nine jobs hit their two-hour limit.

The random seed and the two decklists let the author replay one stalled game on a laptop and time its steps. In that game a player activated Liliana's ultimate on turn 34. Once the army had grown into the thousands, a single resolution of the emblem took 35 seconds, and that was one engine step. Before either player could decide again, Arcana had to put every new Zombie onto the battlefield and check what its arrival triggered. The essay starts to walk through one such check: evolve, an ability that can give a creature a +1/+1 counter when a creature with greater power or toughness enters under its controller's control. The engine's code for it is a walk over the whole battlefield, filtering for creatures with evolve that qualify. The text breaks off while the author is explaining that walk.

Key facts

  • Arcana is the author's own Magic: The Gathering rules engine, written after judging Forge not feasible as an RL experimentation environment; implementation work began in mid 2026.
  • Liliana, the Last Hope's emblem creates Zombies equal to the current count plus two each end step: 510 Zombies after eight resolutions from none, and destroying the Zombies does not stop it.
  • A test campaign of about 400,000 random-play games (64 Pioneer decks, 2,016 pairs, 4,032 games per lineup, repeated another 100 times) left nine cluster jobs hitting their two-hour limit.
  • Replaying one stalled game on a laptop showed a single emblem resolution, with thousands of Zombies in play, taking 35 seconds after Liliana's ultimate on turn 34.
  • The author's Scute Swarm example yields 6,561 Scutes and 26,240 life gained after eight land drops under stated assumptions; Arcana does not yet support that card.

Why it matters

The essay is a concrete case of why a complete, fast Magic engine is hard. The author's point is that a game's rules can let one ability compound exponentially, and every new object then triggers more checks, so a rules engine that is correct on paper can still grind to a halt. Here that was a single Liliana emblem: the Zombie count roughly doubles per resolution, and the work to process the arrivals grows with the army. The motivation is machine play: the author wants an engine fast enough to serve as an experimentation environment for reinforcement learning on Magic, which needs very large numbers of games.

Who it affects

Mainly people building game rules engines or simulators, and those who want to run Magic at scale for AI or RL research. It is also relevant to anyone who watches the existing clients: the author criticises Arena's performance with a large stack and its incomplete catalog, MTGO's dated interface, and Forge's AI play and multiplayer. Ordinary players are not affected by the essay's findings, which concern the author's own engine.

How to use it

There is no product or release to use; Arcana is the author's own engine, and the visible text gives no download, licence or price. The practical takeaways are about method. The author tested by running random-play games across many decks and seeds on a cluster, looking for panics, crashes and stalls. Because each game is determined by a random seed and two decklists, one stalled game could be replayed on a laptop and its individual steps timed. The author also used the games to count how often cards from a list of known-issue cards came up, to decide which rule gaps to fix next.

How solid is it

This is a personal essay with self-reported measurements, not a benchmark or a peer-reviewed result. The arithmetic is checkable: the recurrence gives 2, 6, 14, 30, 62, 126, 254 and 510 Zombies over eight resolutions, and the Scute figures follow from the stated loop. The 35-second figure is a single measurement on the author's laptop from one replayed game. The source text is cut off mid-explanation, so the final cause of the 35-second step, any fix, and the author's conclusions are not visible.

Risks and caveats

The growth figures hold only under the author's stated assumptions: nothing else adds or removes Zombies or changes the token count, and for Scutes a specific set of cards and six or more lands. The games used random play by both players, so a game reaching turn 34 with Liliana's ultimate and thousands of Zombies is an artifact of that testing setup, and the essay does not claim it reflects real play. Arcana does not yet support Scute Swarm, so that example was worked out on paper, not run. The essay starts describing the evolve check but does not say that it caused the 35-second step. Cluster size, laptop specifications and the exact Zombie count at the slow step are not given beyond 'into the thousands'.

“exponential behavior is an enemy of us mere mortal computer scientists”

— the essay's author