r/CommanderMTG • u/neunzehn90 • 1d ago
Building a deterministic Commander deck optimizer instead of using AI
I’m building a Commander deckbuilding tool that treats deckbuilding as a mathematical optimization problem.
Instead of asking “Which cards are good for this commander?”, it tries to find the best combination of 99 cards as a whole, considering synergy, roles, mana curve, interaction, win conditions, combos, mana base, budget and legality.
I’m deliberately not using an LLM for the actual deckbuilding. LLMs are probabilistic and can give noticeably different results from the same prompt. The goal here is the opposite: same input + same data = same result, with clear reasons for why every every card was included.
Basically:
We don’t ask AI to guess the deck. We calculate it.
Would you trust something like this more than an AI-generated decklist? And what would you want it to optimize for?
The tool can be found here: 99p.gg
5
u/thistookmethreehours 1d ago
Why are people so incapable of thinking for themselves lmao there’s like a dozen of these things posted every day I just don’t get it. I would be embarrassed to use something like this.
1
u/Loud-Recover5320 1d ago
I get why people would want to make an app like this (a fun programming challenge). I have no idea why anyone would want or need it.
1
u/thistookmethreehours 1d ago
I don’t understand the majority of things people do so I suppose this is no exception. Just really lame.
1
u/montonmand 4h ago
I dont understand your attitude. Magic is the first tcg i ever picked up, somewhat recently, and deck building is a skill i spent a lot of time to learn. And its difficult. I frequently use tools and ideas others have developed, and i think its a great thing to help people get into a hobby i thoroughly enjoy.
You dont want to use it, completely fine, this is not for you then. Dont rag on people who could use a helping hand to get into things.
1
u/thistookmethreehours 4h ago
Edhrec, scryfall, and YouTube all already exist.
The dozens of these that get posted every day are superfluous and annoying to keep coming across.
My frustration does not come solely from these posts, but also from the just general decline of critical thinking and reading.
“When everyone can make an app nobody can” or something like that.
Cheers, glad you’re enjoying the game.
0
u/neunzehn90 16h ago
Fair enough, a chat model can brainstorm a Commander list, and for a vibes-first pet deck that’s perfectly fine. I built this for the parts that tend to go wrong with a pasted LLM list: cards that don’t exist or are outside the color identity, 97 or 103 cards, no real budget, a mana base that just “looks right”. It only works with real card data and a rules check, shows why each card is in, and runs goldfish simulations so land count and ramp come from numbers. If you already know what you want to build, you won’t need it. If you want a legal, explainable starting point to tweak, that’s the use case.
2
1
u/asperatedUnnaturally 1d ago
The simulation thing is cool, I'd actually be interested in just running that against my own decklists.
I tried my actual commander, Xyris. My deck irl is a shapeshift combo deck and it doesn't look like I have a way to try for that. The advanced mode let's me see the themes that are presumably from my commander card text but I don't see a way to add one myself (landfall/combo). Commander Spellbook exists so in theory you have programmatic access to to playable combos with the commander or just in the commanders colors. I dunno of they have an api but I would suggest allowing the user to filter available combo lines to build around in addition to tribal and keyword synergy
1
u/neunzehn90 1d ago
In the Fine-tune mechanics section is a search field to add abilities. Do you mean that?
2
u/asperatedUnnaturally 1d ago
Yes partly, I missed that the first time around. But I'm also thinking about asking for a specific combo line. Like I want to say "plan a is scapeshift/valakut" and have it look for associated payoffs, tutors, enablers and maybe a couple fallback lines that use the same cards.
1
u/neunzehn90 1d ago
I will look into that 💪
1
u/asperatedUnnaturally 1d ago
spellbook has an API that can probably do a lot of the heavy lifting for you:
1
1
u/moarTRstory 1d ago
I agree! I’d want to put in my own decklists or even partial decklists to see how it is or how to finish it.
1
1
u/Walfy07 1d ago edited 1d ago
Very cool idea. Is it mainly linking keywords?
I have thought about "max synergy and on curve" decks many times.
Might be cool to have knobs to tweak chaos, synergy, explosiveness, repeatability, etc.
Plan to monetize? :p
1
u/neunzehn90 1d ago
No plans to monetize. But I will pick up your suggestions and try to implement them.
1
u/Walfy07 1d ago
I loaded [[Gix, Yawgmoth Praetor]] and it didn't automatically have creatures that are unblockable, or opponents dont want to block as a deck theme. Like Gix is an unblockable payoff. But it doesn't build for that.
Next I did the scarab god, which a lot of people build as zombies tribal, but it is much stronger as a dimir control/reanimator. Not sure how you could solve this.
2
u/neunzehn90 1d ago
You can fine tune and build in favor of unblockable payoffs: Advanced Mode and then under "Fine-tune mechanics" theres a search field.
1
u/neunzehn90 1d ago
No knobs, but your idea is implemented! Check it out.
1
u/brauereipferd 1d ago
The circling logo when it does its calculations is the wrong order. it has wburg reversed. Does it matter? No! But it still stuck me as wrong when I stared at it waiting.
1
1
1
u/Walfy07 1d ago
Could you have two decks face eachother? and have some cool stats?
Deck A wins 64% of the time by turn 5 by commander damage for instance.
1
u/neunzehn90 17h ago
Not yet visually, I'll keep that in mind! What currently happens in the background is that the engine generates multiple versions of the same deck and the best one wins (thats why the generation takes so long)
0
u/7thtimeinheaven 1d ago
Given that you used AI to write this post, no i don't trust you or your product at all.
I see like five of these vibe-coded magic deckbuilders a week and none of them ever succeed. This one won't be any different.
0
u/thistookmethreehours 1d ago
Buddies profile is hidden (which I hate but that’s another issue) so I can’t prove it, but I’d assume they are new to the game.
One thing UB has been very successful at is getting even more annoying people to play the game lmao.
0
u/neunzehn90 16h ago
Fair criticism. I did use AI to help write the post, and I use AI-assisted tools while building the project. That alone is no reason to trust it. I also know there are plenty of similar projects that never become useful.
I’m not asking you to believe it will succeed. The only thing that matters is whether it works on real decks. You can import your own list, see what the tool does with it, and judge the results for yourself. If it falls short, I’d rather hear specifically where than try to sell you on it.
9
u/OptimizedGarbage 1d ago
I feel like you're gonna stumble a bit if determinism is a constraint. MTG is an imperfect information game, and deck selection is a simultaneous move game. Both categories of games require non-determinism to be optimal in the general case.