Mass Token Gen

· by Alli Grant · Read in about 4 min · (714 Words)
programming games magic the gathering mass token gen javascript

My favorite format of Magic the Gathering is Commander, formally known as EDH. For a quick rundown, in normal Magic the Gathering, you can typically play up to four of any card (outside of some specific restrictions) and your deck is typically 60 cards. In Commander, you have a 100 card deck that may only have one of each individual card. In addition, it has one (again, specific exceptions) special card known as your commander, and you can only play cards that share a color identity with your commander.

I have a few separate commander decks that are complete, a few in progress, and a few ideas for them. There’s a deck based around Nicol Bolas, one around Alesha, one around Ayli, but my favorite of all of these is a mono-green deck around Oviya Pashiri, Sage Lifecrafter. She’s from the Kaladesh block, and well, she’s really neat.

There’s a lot that I like about her. Her flavor text (the italics at the bottom of her card) is… well, it’s something I agree with. As a character, in the story, she’s a little old lesbian who became a revolutionary leader after her wife was killed and is a mentor to one of my other favorite characters. Mechnically, her card is just wonderful, but it’s the source of needing this tool. Oviya has two abilities, making a small Servo or making an increasingly large Construct creature.

My deck featuring her is called Oviya’s Workshop, and it has a lot of combo pieces that are built around the idea of making more and more creatures/artifacts so that she can continue to make more and more (bigger) creatures and use them in interesting ways. What makes Oviya unique as a commander is that she’s easy to always play, she doesn’t die quite as easily as others as easy to play as her, and most importantly, she encourages «go big» and «go wide» strategies unlike Rhys the Redeemed or Ghave, Guru of Spores.

All this to say, I need a LOT of tokens to make this deck work. Typically, you have a few options–get the actual official token cards, use dice, use other things… But none of those quite work here. Oviya makes variably sized creatures, and the official card only tracks them as an X/X (and they are set when they’re created!). So if I was to put counters on them, well, that would require tracking the original size and current size separately. There’s also enough different token types that it’s difficult to keep track of which is which (or even if they’re tapped!), both of which are very important to the Workshop’s core themes.

So I wrote a tool!

Mass Token Gen (yes, I’m creative) is a tool that only uses Javascript, local storage, and some really basic CSS to generate «mini American» sized tokens. It’s a great size for them unlike the official tokens, since very large numbers of them easily fit into the deck. They’re very light in the visual complications department, perfect for mass printing in a laser printer. It gives you some pretty free-form capabilities of tracking the token’s color, types, power, toughness, ability text, and can be used to even print tiny proxies of cards that duplicate themselves like Myr Propagator!

Proper Magic symbols are easily used because of a great font that renders things written in the official Magic format of {g} through use of ligatures. Local storage lets you not need to re-enter the token data every time and makes the app entirely usable offline, in addition to giving an easy place to store tokens that you don’t need to print for this run but still want to keep around.

Elle has made a -fantastic- alternate stylesheet that I’m going to add as an option as well that generates some high fidelity token frames that look far more like the official tokens and are still laser printer friendly, or just a great use of a few really fancy tokens.

Upcoming features include «import card from Scryfall,» «a better token editor,» and «multiple card sizes.» It’s been a lot of fun for having put only a little bit of time into it, and making scrappy little code that I need to refactor gives me a fun project for later.