There's a bit of an open source Magic renaissance going on lately, which I find really cool.
Forge has been around forever, but we've managed to get it running in the browser via WASM with Manabrew [1]. I'm one of the maintainers, and we're mostly building it because we wanted a nicer way to play Commander with friends.
Meanwhile, Phase and Ironsmith are working on new engines in Rust, Gorge is building one in Go alongside a bot and cross-engine testing tools, and people are starting to collaborate across projects.
Magic is such a ridiculously difficult game to implement that I think it's pretty amazing how many people are tackling it in their spare time.
If you're into Magic and software engineering, come hang out with us. There's a lot going on and plenty of room for more people to get involved :)
Thanks! I actually came across Arcana not too long ago, so it's really nice to meet its author here. And bonus points for Rust
We started porting Forge to Rust ourselves, but quickly realised what we'd gotten ourselves into, so we went and built forge-wasm instead.
If you're curious, we've got a small engine spec that lets Manabrew work with different rules engines. Ironsmith (also Rust) already works, and we've got partial support for Phase.rs and Gorge. Would be fun to try Arcana too!
There's also a Discord where a bunch of us working on these engines hang out and compare notes. You should drop by sometime, I suspect we'd have quite a bit to talk about :)
We've done our homework, at least as much as a small OSS project reasonably can :D
Forge and Cockatrice have both been around for a long time and have had to navigate legal concerns around card art and Wizards' trademarks. One approach has been to avoid distributing the artwork directly and let users fetch it separately from Scryfall. Forge itself is over 15 years old at this point.
We've taken a similar approach with Manabrew. We don't bundle card art or Wizards' trade dress, the project is entirely free and open source, and people can self-host it. We're also careful not to present it as an official Wizards product.
That doesn't mean there's zero legal risk, of course. But we're not simply crossing our fingers either.
MTGO biggest drawback is you need to pay real money for the virtual cards, and sometimes they cost more than the paper cards themselves.
Endstep.cc is a newcomer to the field.. it runs the forge engine on the server and allows online play. It is now my favorite place to play my favorite format (pauper)
I've been really enjoying Tabletop Simulator for EDH with friends. It's mostly manual (some automatic stuff like turn tracking, cascading, scrying, mulligans, etc), but as fun as the paper card game
Granted, we all play bracket 3 or so. Since you're importing decks you could always bring out some crazy deck with moxes everywhere... But nobody does that because it's just low stakes fun
> need to pay real money for the virtual cards, and sometimes they cost more than the paper cards themselves.
I have stopped playing since years ago but it used to be that if you collected a full digital set in MTGO you could redeem it for a physical set of cards so there was at least some value exchange there.
Yep its been a long time since that went away. That to me was the start of the decline of my engagement with the game, but planeswalkers and deliberate power creep accelerated it.
collectible bard games have been engineered specifically for that, extracting as much money as possible. Not to just have a good product and sell it, maybe even at premium, but to make sure there is constant churn of them
When a guy responsible for MTG got a gig for Valve to do their computer card game it was disaster, PC gamers got shocked by the absolute greed of the business model compared to even existing popular computer card games like hearthstone
I remember a sub community of people hoarding, buying and selling unopened boxes and a sub community of big spenders who would adjust what they were willing to pay for a box based on the number of readily available unopened boxes from a series. If the number declined others were afraid to miss out, increased their bid until the hoarders wouldn't sell anymore. The more they bid the less likely to get it.
There are at least a few ways to play for free without paying, with access to every card in the game's history. If you want to join official events and have access to a wider player base then yes, it costs.
As somebody that played back in the 90s (and gave away my cards that would be worth a $30-40k today... sigh) - it's critical to the gameplay.
If everybody has every card then the game just comes down to people grabbing the most powerful deck combinations and playing them. The work to actually acquire the cards, play with creative combinations that you come up with based on what you have available, etc is where the real fun and challenge of the game comes from. It's the "resource limiter" constraint.
I enjoyed playing one of the old iPhone versions before the latest one came out and when they wanted to kill it, they just gave everybody every card as a "gift". It went from fun and challenging to just stupid overnight.
The days of kids having binders of cards at their local comic book store and trading with each other were a great time. Now it seems like people just save up and order from somebody selling online.
> The work [and expense] to actually acquire the cards, play with creative combinations that you come up with based on what you have available, etc is where the real fun and challenge of the game comes from. It's the "resource limiter" constraint.
I respectfully, but entirely, disagree. It's _a_ source of constraints, but by no means the only one, if your playgroup's dynamic is healthy and communicative. My group is very proxy-friendly - and we all have decks that run the gamut from hyper-tuned cEDH, all the way down to meme-y "I wanted to see if I could make a deck where every card includes a pun somewhere" jank piles. Heck, every Christmas we have a themed White Elephant event where we must build a deck with value less than $15, then swap them and play.
So long as one is more focused on having fun within a game than on winning, you can always impose your own mutual "resource limiters" _without_ having to spend real money.
The real money market is not intrinsically critical to the gameplay. For instance, having infinite free booster drafts would give you the same limited-resource constraints. Or also a game where you just give everyone the same number of packs per day: that would make an even fairer playing field than the current state, which is basically pay-to-win.
But you don't need real money to make it work. Set up a community server that tracks everyone's collection and lets you trade. You buy packs for tokens you get for playing, winning and passively over time.
As a counterpoint, I played MTG as a kid and built my own jank. Then played Arena when it came out, and enjoyed it way more; I found playing a meta deck to just be so much more fun.
I don’t know if the economy has changed but when I was playing Arena you could essentially get every card you need from a set for $100 or so in packs. (Not to mention that it’s totally possible to grind up a couple cheap meta decks on F2P.)
The constrained deck building challenge you are referring to can still be had in drafts, which are also cheaper in Arena.
I do agree the social aspect is lost, which is its own thing.
That’s one part to enjoy. The other part is the game itself, which for many people (myself included) is great fun without having to worry about buying more boosters to dig for more powerful cards.
At some point I stopped enjoying the game (due to many reasons, biggest is randomness but even the lore & flavour of the game just went downhill after a certain point and nowadays I can't even stand a release video... It's the same flavour as marvel movies and sequels but in another context) but I always enjoyed the type of game it offers. If you're into it these kind of game-play/puzzles I'm working on a slightly different game, that has no randomness (my biggest issue with MtG after having played it casually over the years).
Although the web-client is fairly less enticing than arena game-play I'm working on the client and AI - https://www.youtube.com/watch?v=SswKnyrDAaE you can see the work in progress in that video - that's just a test run and the AI was completely dumb at that point it's now much more competitive already - note the original game, the rules engine and web-browser version, etc, weren't vibe-coded but I'm building this native client all with agents, and they actually play against the original server.
On the online version you can draft for free (against bots) without keeping the scrolls (playground), but I would wait a bit as I'm releasing new scrolls and hopefully the native client not too far from now. You can also play for free by going to library, making a codex and joining the queue but you probably need to find someone to join you as right now there's basically 0 players and no AI on the web version yet.
For what it’s worth, there’s a variation you can play to help with randomness; particularly the too much/not enough land dynamic that just kills at times.
Separate all lands into a separate deck and when your draw phase comes you get to choose which deck to draw from.
It’s a fun variation and seems to lead to a lot more consistency in gameplay when my friends and kids have tried it. The flip side is that your opponents also get to choose which deck when they mill you.
Oh, hey, I know you from elixir land - didn't imagine you were into MtG!
That would definitively work for mana-screw/flood but my issue is really more with the randomness. I was never into variants nor commander and such, just drafts & sealed and a bit of constructed. Maybe in the future you'll have another game to play with them :D
To me it just stopped feeling rewarding to play - I probably would enjoy a draft for the giggles with real people, but otherwise it just really stopped being something I enjoyed to play. The first deck I bought was in Ice Age (which was overall a very bad set) but the lore drew me immediately in, as a kid that also enjoyed painting warhammer figures and playing make your own adventure books. I did make a few official tournaments and we used to play at a local store FNMs, after that still went to one or two releases for sealed deck and drafting but never collected again. Then played Online sporadically and Arena did a few runs - I think Outlaws of Thunder junction was the last time I tried to play it more seriously and haven't since then. My first seriously brewed deck was an Early Harvest/Mind's Desire deck that would just have me taking turns if I didn't die in the early turns and flipping cards until brain freeze - before storm was a table stakes deck in modern. Most people hadn't seen anything like it at the time.
And that's what I really in the game, the sort of turn based game play and the brewing deck list aspects of it, specially drafts or figuring out synergies.
Yea, I can see that. I started in 4th edition so you and I got in it around the same time. I didn't really play at all after 97 and until my son showed an interest, so I have refreshed my knowledge a little bit.
Had a good time showing him the game and beating him over and over again until he got determined...and now he smokes me every time we play.
Always enjoyed the game dynamic though. Back in high school I was so deeply into it that I was analyzing card combinations late into the night trying to figure out fun decks. Definitely don't have that type of time to invest into it anymore, but I do have a lot of good memories.
I also enjoyed it but I think that anything more than a very casual hobby, it's actually detrimental - the whole thing, and more so with the digital versions, the land draw smoothing, the way it's been designed for a long-time, borders or is right out evil. To each their own, I'm happy I no longer have the slightest interest in it other than the mathematical properties and the game-design. On the other hand I would like to have a game that is similar but inherently different at the same time.
> MTGO biggest drawback is you need to pay real money for the virtual cards
Which comes hard on the heels of MTG’s biggest drawback, which is needing to pay real money for real cards, priced according to both the current meta and artificial rarity.
Most if not all edh play groups, including at the tournament level, both welcome and encourage the use of proxies. The more interesting thing is who can build the best deck, and who can pilot it well. In a multiplayer format like edh, there is also a bit of an emphasis on table politic'ing
Surely this particular problem can theoretically be (mostly) addressed by an engine that tracks the number of copies of a given card or stack of cards (card plus attached tokens, etc).
I say mostly because:
- Surely there are ways to create N token creatures with a range of counters such that there are still exponentially many different stacks.
- A fast-enough growing pile could require exponentially many bits to store (or more than exponential).
But at least the particular problem in the OP could be addressed.
Ehhh, not quite. The tokens are their own independent objects that act identical to the original, but are removed from the game if they change zones. When anything enters onto the battlefield, it has to notify every other permanent on the battlefield that it has entered, and then those permanents triggers are all put on the stack in addition to the trigger that goes on the stack with whatever enters. The main thing is that either player can respond to the stack at any point even as things are resolving and coming off of it. And there is a very important difference between static abilities (usually called replacement effects) and triggered abilities. Replacement effects don't use the stack, triggered abilities do.
Let's say I have 128 scute swarms, and play a land. That land triggers all 128 scute swarms, causing them to create copies of themselves. That doesn't just happen, instead, all 128 triggers go onto the stack. Priority then goes to the next player, who can respond (which will add another thing to the stack), before passing back to me. The top trigger on the stack resolves putting a creature on the battlefield (which might cause more triggers to be added to the stack), and then that priority passing happens again until the stack is empty.
So if my opponent has a card in play that says they gain one life whenever a creature I control enters, then that is also a triggered ability. So for all 128 creatures, they come into play 1 at a time, and notify all other objects when they do. In this example, each time one of those original 128 triggers resolves, another trigger is added and my opponent gains 1 life, that has to go onto the stack, I get the opportunity to respond to it, and then it resolves, and we continue.
And if Scute Swarm is currently in the meta, then it would make sense to have a card that gains me life whenever a creature my opponent controls enters. So it would be smart to also have a lot of cards that trigger off me gaining life. Let's say that I have two separate cards in play that do so.
So, 128 triggers on the stack, one resolves, my opponent gains a life, that resolves, two other triggers go on the stack, they both resolve. And then we continue this pattern with the other 127 triggers. And importantly as the next one resolves and puts a creature into play, there is yet another permanent that has to be checked for triggers before we can continue.
Meaning that while 128 seems somewhat doable (nevermind that that number can and willget bigger), the actual number of triggers we have to resolve is 4 times higher, and each time one resolves we have to check the state of the entire game to see if we need to do anything else before we move on.
My point is that the state is highly compressible (including the stack). And that it should be possible to have an engine operate on the compressed state by resolving multiple copies of a repeat together.
It is indeed the case that the players have opportunities to respond to each individual event, which means that a strategy can have an exponentially large branching factor: a strategy can choose to let any prefix of a repeating unit through before responding. But I bet that, if there is a stack containing a consecutive block of 100M repeats of the same thing, there are not actually 100M interesting choices of which one to respond to.
> The game is remarkably complex, even Turing complete, with intricate keywords and a daunting amount of mechanics
Software engineers can learn a lot from the way complexity exists in MTG. The number of mechanics is huge, but relatively shallow. Once you learn a pretty small set of core rules (tapping, mana, turn phases, the stack, etc), you can add new mechanics to your knowledge easily, usually be reading a small chunk of text.
You normally only have a handful of mechanics interacting with each other, and usually only need to look up one or two you're not familiar with in a game. It's sort of like a plugin system. Reminds me of Unix too.
Agreed. I was talking to a friend recently about programming languages and games, and the kind of systems that I think are good, and landed on the thought that the best systems are the ones that have the smallest number of "primitives". But really I think what I was getting at was that good systems have the smallest number of "Axioms", and all the complexity is derived from that.
To learn magic, you learn a really simple set of rules, and as long as you have that down, the rest is just playing cards and resolving abilities of said cards.
I imagine we can do better than a flat array to represent the permanents on the battlefield. Lots of cards filter permanents by type, mana cost, etc. Building a consideration for this into the data structure is a natural idea.
Every card, permanent, spell, etc. is an object in Magic. So I’m using a set multimap, with the key being the zone the card is in. Those filters you mention are actually cheap until you get unrealistic numbers like those that let you win this turn or the next one. You could create an index of the mana cost, the types, but that ends up being over-engineered.
I’ve tested using an ECS just for handling the core of the objects, but that lead nowhere event though it seemed a good fit from some perspectives.
I’m not surprised that an array is actually efficient after trying so many implementations.
> On turns 52, 54, and 56, I counted the Zombies at the start of the turn and timed the emblem when it resolved at the end. In one laptop replay those steps took 1.72, 7.78, and 35.15 seconds
I'm surprised it turns out that building a consideration for this into the data structure is a bad idea.
Does anyone know what the strongest existing AI magic player is considered to be? I’ve made one that has an 85% winrate over Forge, but am looking for any new challengers
When I read articles like this I find myself agreeing with finitists = accounting for infinities in real scenarios isn't worth it (and should be capped). This worked for Heartstone.
A friend implemented his version of MTG with the old expansions (about up to Ice Age + interesting later cards), including single player campaign, online multiplayer & play against the machine. It works quite well, but major issues during play testing was network sync and handling different resolutions for artwork and text over artwork. And the bugs in specific card implementations that could take a game down.
The "AI" will look a couple of moves ahead, but is restricted on time and CPU performance so having a 100 tokens with an ability in play that can be activated in every game phase is a challenge, like the article says.
Now he "just" needs a license from Wizards/Hasbro ;)
That's just regular software updates for an evolving game. It's not special to MTG. The problem with MTG is there are 30,000 unique cards, each possibly requiring a custom implementation and each possibly interacting with every other card in odd ways that creates a huge surface area for bugs to occur.
Another fun combo with an even higher growth rate is Exalted Sunborn [1] + Followed Footsteps [2].
After one turn, you have 3 creatures. Next turn, you have 11. Then 2059. Then 66185228434044942951864067458396061614989522267577311297802947435570493724401440549267868490798926773634494383968047143923956857140205406402740536087446083831052036848232439995904404992798007514718326043410570379830870463780085260619444417205199197123751210704970352727833755425876102776028267313405809429548880554782040765277562828362884238325465448520348307574943345990309941642666926723379729598185834735054732500415409883868361423159913770812218772711901772249553153402287759789517121744336755350465901655205184917370974202405586941211065395540765567663193297173367254230313612244182941999500402388195450053080385547.
There are many variants of this superexponential growth pattern, like Court of Vantress (https://scryfall.com/card/plst/WOC-22/court-of-vantress) repeatedly creating token copies of token-doubling enchantments like Anointed Procession, Parallel Lives or Doubling Season.
See also this Matt Parker video on the Astral Dragon, Parallel Lives and Miirym, Sentinel Wyrm combo which results in a number of tokens only (approximately) representable by a huge (beyond astronomical) power tower: https://youtube.com/watch?v=x3dE-NJ1UDQ
In the 3 Card Blind format (played with only 3 vs 3 cards, the optimal play wins, short intro: https://youtube.com/watch?v=29P243ggtU8), there exists a game in the tournament history which no one has been able to solve due to the sheer combinatorial explosion of possibilities, the Hangarback Walker game: https://youtube.com/watch?v=hdaiKwKN50U
It is also possible to represent small Turing machines with unsolved halting status ("Cryptids" https://wiki.bbchallenge.org/wiki/Cryptids) as a legally reachable board state (Example: https://web.archive.org/web/20241222020126/https://aesort.co...). It's unlikely anyone will manage to do that in a tournament, but it is conceivable that the outcome of a specific game will remain undetermined by any judge (unless the math or computer science problem it represents is solved).
In practice, what makes MtG games in common formats (especially optimally) unsolvable is the large amount of hidden information, and combinatorial "predictive firewall" of random deck shuffles and the vast card pool.
One of the coolest things about MtG is if you set up an infinite loop that is voluntary (like, able to be ended) that often puts you in a winning position. However, if it is a true involuntary infinite loop the game ends in a draw.
Bonus fun fact: If you create an optional infinite loop where you control all the parts, you can simply declare how many times the loop executes, rather than performing all the steps repeatedly. This is part of the tournament rules. Want to run the loop eleven billion times? You can!
I think that for these situations you need to create a model of execution that can understand these interactions so that it can move beyond the linear mode of going through every option.
I'm designing Aether Summon (https://aethersummon.com) and currently building the native clients to play (which have the hearthstone/arena like game play).
I haven't yet introduced complex mechanics that can lead to infinite combos or exponential triggering, but for combos my idea is to have the human/AI operator declare itself that it's going to combo, so the game/client register that intention and then "records" the actions that lead to the combo, in doing so, and for a combo to be declared, it has to do a few checks, e.g., on each full cycle of combo (that can be 1 or more sequences of actions) the state of the game had to move irrevocably to an increase in some stats (life increase, aether increase, creature count increase, etc) and the conditions to re-do the cycle are present. If this is true then it should mean that you're in a combo, as the engine is deterministic (except for some random effects, but if they don't target you then it should recognize the combo without issues, for instance if on each cycle you remove 3 scrolls out of your opponent's tome, it doesn't matter for the repeatability of the combo, it will just go down to 0 and future ones won't do any "side-effects" in practice) it means you should be able to play the same cycle as many times as you wish, so when validated the user just needs to choose how many times he wants to repeat the cycle and then things are computed based on that.
This isn't exactly the same problem as your's but it's close, if in this cycle it created X+n (where n is the number of times the cycle runs) creatures then it could calculate that if you chose to play the cycle N times, it would create a set amount of creatures and as such it could jump to the final calculation instead of going through each cycle independently and updating the state in each step.
I think something similar could be applied to the trigger stacking. You still need to take care of the other player's possibility of interactions, but these can use a similar system where you announce to the other player that player 1 entered a combo state that ends on X step, you can ignore this is the player has no meaningful way of interacting with it, but otherwise offer the same thing, let the first cycle play as usual so the player can "break" the combo, or allow him to say, on iteration Y of the X that are going to be played, give me back control.
In your case I think you should try to first derive the mathematical properties and relationships between the triggers and the state - this is easier than for an open problem because you have the state after an interaction to derive them and although almost limitless it's still limited the things that can happen in an MtG board.
#edit and regarding turing completeness or not, I think that the issue is that most of the rules and cool interactions where designed for a human to human play mode, with physical cards, time limited, etc. There's plenty of rules in magic that a toddler understands but are extremely complex to model in a program - more so because the rules, their readings and interactions kept being iterated on throughout the game history and for a long time didn't worry about consistency or its computability - that's why this only happens with older editions, new ones dont suffer from the same issues... I would imagine due to already taking into account its practical computability...
There's a bit of an open source Magic renaissance going on lately, which I find really cool.
Forge has been around forever, but we've managed to get it running in the browser via WASM with Manabrew [1]. I'm one of the maintainers, and we're mostly building it because we wanted a nicer way to play Commander with friends.
Meanwhile, Phase and Ironsmith are working on new engines in Rust, Gorge is building one in Go alongside a bot and cross-engine testing tools, and people are starting to collaborate across projects.
Magic is such a ridiculously difficult game to implement that I think it's pretty amazing how many people are tackling it in their spare time.
If you're into Magic and software engineering, come hang out with us. There's a lot going on and plenty of room for more people to get involved :)
[1] https://github.com/witchesofthehill/manabrew
This looks awesome. Will definitely check it out and see if there's anything from my little project here I can contribute!
Thanks! I actually came across Arcana not too long ago, so it's really nice to meet its author here. And bonus points for Rust
We started porting Forge to Rust ourselves, but quickly realised what we'd gotten ourselves into, so we went and built forge-wasm instead.
If you're curious, we've got a small engine spec that lets Manabrew work with different rules engines. Ironsmith (also Rust) already works, and we've got partial support for Phase.rs and Gorge. Would be fun to try Arcana too!
There's also a Discord where a bunch of us working on these engines hang out and compare notes. You should drop by sometime, I suspect we'd have quite a bit to talk about :)
Have you had legal challenges?
Are you just crossing your fingers for now?
We've done our homework, at least as much as a small OSS project reasonably can :D
Forge and Cockatrice have both been around for a long time and have had to navigate legal concerns around card art and Wizards' trademarks. One approach has been to avoid distributing the artwork directly and let users fetch it separately from Scryfall. Forge itself is over 15 years old at this point.
We've taken a similar approach with Manabrew. We don't bundle card art or Wizards' trade dress, the project is entirely free and open source, and people can self-host it. We're also careful not to present it as an official Wizards product.
That doesn't mean there's zero legal risk, of course. But we're not simply crossing our fingers either.
This looks amazing. I will definitely try it out
[dead]
Reminds me of the "deal infinite damage for 4GRU, as long as the twin primes conjecture is true" Reddit post (https://www.reddit.com/r/BadMtgCombos/comments/1feps3y/deal_...)
MTGO biggest drawback is you need to pay real money for the virtual cards, and sometimes they cost more than the paper cards themselves.
Endstep.cc is a newcomer to the field.. it runs the forge engine on the server and allows online play. It is now my favorite place to play my favorite format (pauper)
I've been really enjoying Tabletop Simulator for EDH with friends. It's mostly manual (some automatic stuff like turn tracking, cascading, scrying, mulligans, etc), but as fun as the paper card game
Granted, we all play bracket 3 or so. Since you're importing decks you could always bring out some crazy deck with moxes everywhere... But nobody does that because it's just low stakes fun
> need to pay real money for the virtual cards, and sometimes they cost more than the paper cards themselves.
I have stopped playing since years ago but it used to be that if you collected a full digital set in MTGO you could redeem it for a physical set of cards so there was at least some value exchange there.
Yep its been a long time since that went away. That to me was the start of the decline of my engagement with the game, but planeswalkers and deliberate power creep accelerated it.
collectible bard games have been engineered specifically for that, extracting as much money as possible. Not to just have a good product and sell it, maybe even at premium, but to make sure there is constant churn of them
When a guy responsible for MTG got a gig for Valve to do their computer card game it was disaster, PC gamers got shocked by the absolute greed of the business model compared to even existing popular computer card games like hearthstone
I remember a sub community of people hoarding, buying and selling unopened boxes and a sub community of big spenders who would adjust what they were willing to pay for a box based on the number of readily available unopened boxes from a series. If the number declined others were afraid to miss out, increased their bid until the hoarders wouldn't sell anymore. The more they bid the less likely to get it.
There are at least a few ways to play for free without paying, with access to every card in the game's history. If you want to join official events and have access to a wider player base then yes, it costs.
As somebody that played back in the 90s (and gave away my cards that would be worth a $30-40k today... sigh) - it's critical to the gameplay.
If everybody has every card then the game just comes down to people grabbing the most powerful deck combinations and playing them. The work to actually acquire the cards, play with creative combinations that you come up with based on what you have available, etc is where the real fun and challenge of the game comes from. It's the "resource limiter" constraint.
I enjoyed playing one of the old iPhone versions before the latest one came out and when they wanted to kill it, they just gave everybody every card as a "gift". It went from fun and challenging to just stupid overnight.
The days of kids having binders of cards at their local comic book store and trading with each other were a great time. Now it seems like people just save up and order from somebody selling online.
> The work [and expense] to actually acquire the cards, play with creative combinations that you come up with based on what you have available, etc is where the real fun and challenge of the game comes from. It's the "resource limiter" constraint.
I respectfully, but entirely, disagree. It's _a_ source of constraints, but by no means the only one, if your playgroup's dynamic is healthy and communicative. My group is very proxy-friendly - and we all have decks that run the gamut from hyper-tuned cEDH, all the way down to meme-y "I wanted to see if I could make a deck where every card includes a pun somewhere" jank piles. Heck, every Christmas we have a themed White Elephant event where we must build a deck with value less than $15, then swap them and play.
So long as one is more focused on having fun within a game than on winning, you can always impose your own mutual "resource limiters" _without_ having to spend real money.
The real money market is not intrinsically critical to the gameplay. For instance, having infinite free booster drafts would give you the same limited-resource constraints. Or also a game where you just give everyone the same number of packs per day: that would make an even fairer playing field than the current state, which is basically pay-to-win.
But you don't need real money to make it work. Set up a community server that tracks everyone's collection and lets you trade. You buy packs for tokens you get for playing, winning and passively over time.
As a counterpoint, I played MTG as a kid and built my own jank. Then played Arena when it came out, and enjoyed it way more; I found playing a meta deck to just be so much more fun.
I don’t know if the economy has changed but when I was playing Arena you could essentially get every card you need from a set for $100 or so in packs. (Not to mention that it’s totally possible to grind up a couple cheap meta decks on F2P.)
The constrained deck building challenge you are referring to can still be had in drafts, which are also cheaper in Arena.
I do agree the social aspect is lost, which is its own thing.
I do enjoy drafts for that reason. Really good time.
That’s one part to enjoy. The other part is the game itself, which for many people (myself included) is great fun without having to worry about buying more boosters to dig for more powerful cards.
At some point I stopped enjoying the game (due to many reasons, biggest is randomness but even the lore & flavour of the game just went downhill after a certain point and nowadays I can't even stand a release video... It's the same flavour as marvel movies and sequels but in another context) but I always enjoyed the type of game it offers. If you're into it these kind of game-play/puzzles I'm working on a slightly different game, that has no randomness (my biggest issue with MtG after having played it casually over the years).
Although the web-client is fairly less enticing than arena game-play I'm working on the client and AI - https://www.youtube.com/watch?v=SswKnyrDAaE you can see the work in progress in that video - that's just a test run and the AI was completely dumb at that point it's now much more competitive already - note the original game, the rules engine and web-browser version, etc, weren't vibe-coded but I'm building this native client all with agents, and they actually play against the original server.
On the online version you can draft for free (against bots) without keeping the scrolls (playground), but I would wait a bit as I'm releasing new scrolls and hopefully the native client not too far from now. You can also play for free by going to library, making a codex and joining the queue but you probably need to find someone to join you as right now there's basically 0 players and no AI on the web version yet.
For what it’s worth, there’s a variation you can play to help with randomness; particularly the too much/not enough land dynamic that just kills at times.
Separate all lands into a separate deck and when your draw phase comes you get to choose which deck to draw from.
It’s a fun variation and seems to lead to a lot more consistency in gameplay when my friends and kids have tried it. The flip side is that your opponents also get to choose which deck when they mill you.
Oh, hey, I know you from elixir land - didn't imagine you were into MtG!
That would definitively work for mana-screw/flood but my issue is really more with the randomness. I was never into variants nor commander and such, just drafts & sealed and a bit of constructed. Maybe in the future you'll have another game to play with them :D
To me it just stopped feeling rewarding to play - I probably would enjoy a draft for the giggles with real people, but otherwise it just really stopped being something I enjoyed to play. The first deck I bought was in Ice Age (which was overall a very bad set) but the lore drew me immediately in, as a kid that also enjoyed painting warhammer figures and playing make your own adventure books. I did make a few official tournaments and we used to play at a local store FNMs, after that still went to one or two releases for sealed deck and drafting but never collected again. Then played Online sporadically and Arena did a few runs - I think Outlaws of Thunder junction was the last time I tried to play it more seriously and haven't since then. My first seriously brewed deck was an Early Harvest/Mind's Desire deck that would just have me taking turns if I didn't die in the early turns and flipping cards until brain freeze - before storm was a table stakes deck in modern. Most people hadn't seen anything like it at the time.
And that's what I really in the game, the sort of turn based game play and the brewing deck list aspects of it, specially drafts or figuring out synergies.
|>waves in Elixir
Yea, I can see that. I started in 4th edition so you and I got in it around the same time. I didn't really play at all after 97 and until my son showed an interest, so I have refreshed my knowledge a little bit.
Had a good time showing him the game and beating him over and over again until he got determined...and now he smokes me every time we play.
Always enjoyed the game dynamic though. Back in high school I was so deeply into it that I was analyzing card combinations late into the night trying to figure out fun decks. Definitely don't have that type of time to invest into it anymore, but I do have a lot of good memories.
Age doesn't forgive as they say...
I also enjoyed it but I think that anything more than a very casual hobby, it's actually detrimental - the whole thing, and more so with the digital versions, the land draw smoothing, the way it's been designed for a long-time, borders or is right out evil. To each their own, I'm happy I no longer have the slightest interest in it other than the mathematical properties and the game-design. On the other hand I would like to have a game that is similar but inherently different at the same time.
You're right and wrong. Most edh (even the tournaments) not only allow for but encourage proxies.
> MTGO biggest drawback is you need to pay real money for the virtual cards
Which comes hard on the heels of MTG’s biggest drawback, which is needing to pay real money for real cards, priced according to both the current meta and artificial rarity.
Most if not all edh play groups, including at the tournament level, both welcome and encourage the use of proxies. The more interesting thing is who can build the best deck, and who can pilot it well. In a multiplayer format like edh, there is also a bit of an emphasis on table politic'ing
Surely this particular problem can theoretically be (mostly) addressed by an engine that tracks the number of copies of a given card or stack of cards (card plus attached tokens, etc).
I say mostly because:
- Surely there are ways to create N token creatures with a range of counters such that there are still exponentially many different stacks.
- A fast-enough growing pile could require exponentially many bits to store (or more than exponential).
But at least the particular problem in the OP could be addressed.
Ehhh, not quite. The tokens are their own independent objects that act identical to the original, but are removed from the game if they change zones. When anything enters onto the battlefield, it has to notify every other permanent on the battlefield that it has entered, and then those permanents triggers are all put on the stack in addition to the trigger that goes on the stack with whatever enters. The main thing is that either player can respond to the stack at any point even as things are resolving and coming off of it. And there is a very important difference between static abilities (usually called replacement effects) and triggered abilities. Replacement effects don't use the stack, triggered abilities do.
Let's say I have 128 scute swarms, and play a land. That land triggers all 128 scute swarms, causing them to create copies of themselves. That doesn't just happen, instead, all 128 triggers go onto the stack. Priority then goes to the next player, who can respond (which will add another thing to the stack), before passing back to me. The top trigger on the stack resolves putting a creature on the battlefield (which might cause more triggers to be added to the stack), and then that priority passing happens again until the stack is empty.
So if my opponent has a card in play that says they gain one life whenever a creature I control enters, then that is also a triggered ability. So for all 128 creatures, they come into play 1 at a time, and notify all other objects when they do. In this example, each time one of those original 128 triggers resolves, another trigger is added and my opponent gains 1 life, that has to go onto the stack, I get the opportunity to respond to it, and then it resolves, and we continue.
And if Scute Swarm is currently in the meta, then it would make sense to have a card that gains me life whenever a creature my opponent controls enters. So it would be smart to also have a lot of cards that trigger off me gaining life. Let's say that I have two separate cards in play that do so.
So, 128 triggers on the stack, one resolves, my opponent gains a life, that resolves, two other triggers go on the stack, they both resolve. And then we continue this pattern with the other 127 triggers. And importantly as the next one resolves and puts a creature into play, there is yet another permanent that has to be checked for triggers before we can continue.
Meaning that while 128 seems somewhat doable (nevermind that that number can and willget bigger), the actual number of triggers we have to resolve is 4 times higher, and each time one resolves we have to check the state of the entire game to see if we need to do anything else before we move on.
Indeed.
My point is that the state is highly compressible (including the stack). And that it should be possible to have an engine operate on the compressed state by resolving multiple copies of a repeat together.
It is indeed the case that the players have opportunities to respond to each individual event, which means that a strategy can have an exponentially large branching factor: a strategy can choose to let any prefix of a repeating unit through before responding. But I bet that, if there is a stack containing a consecutive block of 100M repeats of the same thing, there are not actually 100M interesting choices of which one to respond to.
> The game is remarkably complex, even Turing complete, with intricate keywords and a daunting amount of mechanics
Software engineers can learn a lot from the way complexity exists in MTG. The number of mechanics is huge, but relatively shallow. Once you learn a pretty small set of core rules (tapping, mana, turn phases, the stack, etc), you can add new mechanics to your knowledge easily, usually be reading a small chunk of text.
You normally only have a handful of mechanics interacting with each other, and usually only need to look up one or two you're not familiar with in a game. It's sort of like a plugin system. Reminds me of Unix too.
Agreed. I was talking to a friend recently about programming languages and games, and the kind of systems that I think are good, and landed on the thought that the best systems are the ones that have the smallest number of "primitives". But really I think what I was getting at was that good systems have the smallest number of "Axioms", and all the complexity is derived from that.
To learn magic, you learn a really simple set of rules, and as long as you have that down, the rest is just playing cards and resolving abilities of said cards.
I imagine we can do better than a flat array to represent the permanents on the battlefield. Lots of cards filter permanents by type, mana cost, etc. Building a consideration for this into the data structure is a natural idea.
Every card, permanent, spell, etc. is an object in Magic. So I’m using a set multimap, with the key being the zone the card is in. Those filters you mention are actually cheap until you get unrealistic numbers like those that let you win this turn or the next one. You could create an index of the mana cost, the types, but that ends up being over-engineered.
I’ve tested using an ECS just for handling the core of the objects, but that lead nowhere event though it seemed a good fit from some perspectives.
I’m not surprised that an array is actually efficient after trying so many implementations.
I'm looking at the line:
> On turns 52, 54, and 56, I counted the Zombies at the start of the turn and timed the emblem when it resolved at the end. In one laptop replay those steps took 1.72, 7.78, and 35.15 seconds
I'm surprised it turns out that building a consideration for this into the data structure is a bad idea.
Does anyone know what the strongest existing AI magic player is considered to be? I’ve made one that has an 85% winrate over Forge, but am looking for any new challengers
When I read articles like this I find myself agreeing with finitists = accounting for infinities in real scenarios isn't worth it (and should be capped). This worked for Heartstone.
I feel like this is probably my only opportunity on HN to post this classic:
https://www.youtube.com/watch?v=AGXG5rNe_tI
A friend implemented his version of MTG with the old expansions (about up to Ice Age + interesting later cards), including single player campaign, online multiplayer & play against the machine. It works quite well, but major issues during play testing was network sync and handling different resolutions for artwork and text over artwork. And the bugs in specific card implementations that could take a game down.
The "AI" will look a couple of moves ahead, but is restricted on time and CPU performance so having a 100 tokens with an ability in play that can be activated in every game phase is a challenge, like the article says.
Now he "just" needs a license from Wizards/Hasbro ;)
The problem with MTG is that it's like a computer program that is constantly evolving its own instruction set and business logic.
Building a rule system that can capture MTG means building a rule system that can modify itself.
That's just regular software updates for an evolving game. It's not special to MTG. The problem with MTG is there are 30,000 unique cards, each possibly requiring a custom implementation and each possibly interacting with every other card in odd ways that creates a huge surface area for bugs to occur.
I am referring to a single session of play.
Another fun combo with an even higher growth rate is Exalted Sunborn [1] + Followed Footsteps [2].
After one turn, you have 3 creatures. Next turn, you have 11. Then 2059. Then 66185228434044942951864067458396061614989522267577311297802947435570493724401440549267868490798926773634494383968047143923956857140205406402740536087446083831052036848232439995904404992798007514718326043410570379830870463780085260619444417205199197123751210704970352727833755425876102776028267313405809429548880554782040765277562828362884238325465448520348307574943345990309941642666926723379729598185834735054732500415409883868361423159913770812218772711901772249553153402287759789517121744336755350465901655205184917370974202405586941211065395540765567663193297173367254230313612244182941999500402388195450053080385547.
It gets out of hand quickly.
[1] https://scryfall.com/card/eoe/15/exalted-sunborn
[2] https://scryfall.com/card/cn2/111/followed-footsteps
There are many variants of this superexponential growth pattern, like Court of Vantress (https://scryfall.com/card/plst/WOC-22/court-of-vantress) repeatedly creating token copies of token-doubling enchantments like Anointed Procession, Parallel Lives or Doubling Season.
See also this Matt Parker video on the Astral Dragon, Parallel Lives and Miirym, Sentinel Wyrm combo which results in a number of tokens only (approximately) representable by a huge (beyond astronomical) power tower: https://youtube.com/watch?v=x3dE-NJ1UDQ
Fun both both cost 3 + 2, so very very hard to pull off, no?
Off-topic: Thought it was gwern's website for a second
It’s a finite state machine, it’s very expressive.
related, Magic the Gathering is Turing Complete.
Which to me suggests that one will encounter the halting problem in theory if not in practice.
In the 3 Card Blind format (played with only 3 vs 3 cards, the optimal play wins, short intro: https://youtube.com/watch?v=29P243ggtU8), there exists a game in the tournament history which no one has been able to solve due to the sheer combinatorial explosion of possibilities, the Hangarback Walker game: https://youtube.com/watch?v=hdaiKwKN50U
It is also possible to represent small Turing machines with unsolved halting status ("Cryptids" https://wiki.bbchallenge.org/wiki/Cryptids) as a legally reachable board state (Example: https://web.archive.org/web/20241222020126/https://aesort.co...). It's unlikely anyone will manage to do that in a tournament, but it is conceivable that the outcome of a specific game will remain undetermined by any judge (unless the math or computer science problem it represents is solved).
In practice, what makes MtG games in common formats (especially optimally) unsolvable is the large amount of hidden information, and combinatorial "predictive firewall" of random deck shuffles and the vast card pool.
One of the coolest things about MtG is if you set up an infinite loop that is voluntary (like, able to be ended) that often puts you in a winning position. However, if it is a true involuntary infinite loop the game ends in a draw.
Bonus fun fact: If you create an optional infinite loop where you control all the parts, you can simply declare how many times the loop executes, rather than performing all the steps repeatedly. This is part of the tournament rules. Want to run the loop eleven billion times? You can!
I think that for these situations you need to create a model of execution that can understand these interactions so that it can move beyond the linear mode of going through every option. I'm designing Aether Summon (https://aethersummon.com) and currently building the native clients to play (which have the hearthstone/arena like game play).
I haven't yet introduced complex mechanics that can lead to infinite combos or exponential triggering, but for combos my idea is to have the human/AI operator declare itself that it's going to combo, so the game/client register that intention and then "records" the actions that lead to the combo, in doing so, and for a combo to be declared, it has to do a few checks, e.g., on each full cycle of combo (that can be 1 or more sequences of actions) the state of the game had to move irrevocably to an increase in some stats (life increase, aether increase, creature count increase, etc) and the conditions to re-do the cycle are present. If this is true then it should mean that you're in a combo, as the engine is deterministic (except for some random effects, but if they don't target you then it should recognize the combo without issues, for instance if on each cycle you remove 3 scrolls out of your opponent's tome, it doesn't matter for the repeatability of the combo, it will just go down to 0 and future ones won't do any "side-effects" in practice) it means you should be able to play the same cycle as many times as you wish, so when validated the user just needs to choose how many times he wants to repeat the cycle and then things are computed based on that.
This isn't exactly the same problem as your's but it's close, if in this cycle it created X+n (where n is the number of times the cycle runs) creatures then it could calculate that if you chose to play the cycle N times, it would create a set amount of creatures and as such it could jump to the final calculation instead of going through each cycle independently and updating the state in each step.
I think something similar could be applied to the trigger stacking. You still need to take care of the other player's possibility of interactions, but these can use a similar system where you announce to the other player that player 1 entered a combo state that ends on X step, you can ignore this is the player has no meaningful way of interacting with it, but otherwise offer the same thing, let the first cycle play as usual so the player can "break" the combo, or allow him to say, on iteration Y of the X that are going to be played, give me back control.
In your case I think you should try to first derive the mathematical properties and relationships between the triggers and the state - this is easier than for an open problem because you have the state after an interaction to derive them and although almost limitless it's still limited the things that can happen in an MtG board.
#edit and regarding turing completeness or not, I think that the issue is that most of the rules and cool interactions where designed for a human to human play mode, with physical cards, time limited, etc. There's plenty of rules in magic that a toddler understands but are extremely complex to model in a program - more so because the rules, their readings and interactions kept being iterated on throughout the game history and for a long time didn't worry about consistency or its computability - that's why this only happens with older editions, new ones dont suffer from the same issues... I would imagine due to already taking into account its practical computability...
[flagged]
[flagged]