Skip to content

Instantly share code, notes, and snippets.

@fenhl
Last active October 5, 2021 22:06
Show Gist options
  • Save fenhl/8d163733ab92ed718d89975127aac152 to your computer and use it in GitHub Desktop.
Save fenhl/8d163733ab92ed718d89975127aac152 to your computer and use it in GitHub Desktop.
custom booster pack generator

This document specifies in detail how Lore Seeker generates booster packs for custom sets. This is used on the Sealed page, for Fenhl's paper drafts, and the Custom Standard Sealed League. If your set is on Lore Seeker and its specification is wrong, please contact Fenhl.

Table of contents

  1. Algorithms
    1. Simulated collation
    2. The naïve algorithm
    3. taw's algorithm
    4. Reuben's algorithm
    5. PlaneSculptors
  2. Sets
    1. Dreamscape
    2. Ankheret
    3. Aenyr
    4. Lorado
    5. Tesla
    6. Magic Villains
    7. Jannada
    8. Netropolis
    9. Custom Core 2018
    10. Hollows of Lordran
    11. Vastuum
    12. Ruins of Doharum
    13. Rakoa
    14. Eralou
    15. Scriptures of Urshad
    16. Secrets of the River Cities
    17. Custom Core 2020
    18. Kuutalya

Algorithms

The following algorithms are used by several sets. This is not intended as an exhaustive list of what Lore Seeker is capable of; if you have an idea for a unique booster layout for your set, contact Fenhl and we can probably add it. Note, however, that Lore Seeker has no concept of print runs: If you open multiple boosters at the same time, the system treats them independently, as if they were each picked randomly from a separate booster box.

Simulated collation

The most realistic method of generating boosters is by simulating one of the several printing and packaging processes used for official sets, as described at http://www.lethe.xyz/mtg/collation/. Due to the required effort on the set designer's part of making card lists of the print sheets, no custom sets use this method so far, though some designers have expressed interest in switching to it in the future.

The naïve algorithm

Like most algorithms, this algorithm is based on print sheets: a set of cards from which parts of a booster are generated. The naïve algorithm simply puts all the commons on a single common print sheet and all the uncommons on a single uncommon print sheet. The rare/mythic print sheet contains two copies of each rare and one copy of each mythic.

The algorithm picks 10 cards from the same common sheet (meaning that the same card can't appear twice), 3 cards from the same uncommon sheet, and one card from the rare/mythic sheet. If the set has any cards at basic land rarity, a random one is added as the 15th card.

One notable flaw of this is that color balance is not guaranteed: A pack could in extreme cases generate with all cards being of the same color; though this is very unlikely, less extreme cases like one color missing from the commons do happen quite often.

For official sets where taw's algorithm can't be used, Lore Seeker uses a variation of this algorithm that randomly inserts foils into some boosters. Custom sets are assumed not to have any foils unless specified otherwise by the set designer(s).

taw's algorithm

This algorithm is based on the naïve algorithm and intended to improve its color balancing. It doesn't work for unusual cases like multicolor sets, artifact sets, or Torment, but other than that it is used for official sets where no exact printing process is known (with the addition of random foils).

Five of the common slots are replaced with color-locked common slots, one of each color. In these slots, only monocolored cards appear; colorless and multicolor commons only appear in the remaining five slots. The color distribution for these remaining slots is adjusted so that each individual common has the same overall frequency.

Other rarities work the same way as the naïve algorithm.

Reuben's algorithm

Reuben, set designer of Dreamscape, Tesla, and Vastuum, has described how he generates boosters for paper drafts. Lore Seeker uses an approximation of this method to generate his sets' boosters: First, generate a booster using the naïve algorithm, except omitting the basic land slot even if the set has basic lands, then check against the rules given in the article, and if any of the rules aren't met, generate a new booster. Repeat until a booster that conforms to the rules is generated. The rules are:

  1. A pack must never have more than 4 commons of the same color
  2. A pack must have at least 1 common card of each color
  3. A pack must have at least 1 common creature
  4. A pack must never have more than 2 uncommons of the same color
  5. A pack must never have repeated cards

This is not exactly the same as Reuben's method since it ignores the fact that the boosters should be generated as a group. Generating the 24 boosters as a box, checking the rules for the entire box, and then picking a random booster from the box would be more accurate.

PlaneSculptors

PlaneSculptors has its own booster generator used for its Draft and Sealed features. Lore Seeker does not currently use the PlaneSculptors algorithm for any sets, but it might be requested in the future.

Some interesting features of the algorithm:

  • There are 5 common slots locked to each single color, but unlike in taw's algorithm the remaining 5 common slots are not balance-adjusted, which for almost any set means that each individual monocolored common appears more frequently than each individual multicolored or colorless common.
  • The mythics are on a separate sheet which is used in 1/8 of boosters.
  • There is a “Basic land slot” option which can be used to generate a different kind of slot instead of the basic land slot.

Some notes for myself in case it's requested in the future:

Sets

Dreamscape

This set uses Reuben's algorithm.

Ankheret

This set uses taw's algorithm with the following modifications:

  • Despite being part of the set, basic lands don't appear in boosters at all. Instead of the basic land slot, there is a nonbasic land slot where any nonbasic land in the set can appear, though the chance is weighted by rarity:
    • 80/112 chance of a common (there are 6 such cards, so each individual card has a 2240/18816 chance of appearing)
    • 24/112 chance of an uncommon (there are 7 such cards, so each individual card has a 576/18816 chance of appearing)
    • 7/112 chance of a rare (there are 8 such cards, so each individual card has a 147/18816 chance of appearing)
    • 1/112 chance of the mythic Archive of Kariro
  • Lands are removed from all of the other sheets.

Aenyr

This set uses the naïve algorithm with the following modifications:

  • Despite being part of the set, basic lands don't appear in boosters at all. Instead of the basic land slot, there is a nonbasic land slot where any nonbasic land in the set can appear, though the chance is weighted by rarity:
    • 80/112 chance of a common (there are 10 such cards, so each individual card has an 8/112 chance of appearing)
    • 24/112 chance of an uncommon (there are 2 such cards, so each individual card has a 12/112 chance of appearing)
    • 7/112 chance of the rare Heart of Inspiration
    • 1/112 chance of the mythic Mount Chromaziel
  • Lands are removed from all of the other sheets.
  • Instead of using the same print sheet for rares and mythics, they are on two separate sheets. The chance of using the rare sheet is 7/8, in the other 1/8 of boosters a mythic appears instead.

Lorado

TODO confirm

This set uses the naïve algorithm since its designer hasn't specified otherwise.

Tesla

This set uses Reuben's algorithm with the following modifications:

  • Instead of the 10th common slot, there is a DFC slot where any double-faced card in the set can appear, though the chance is weighted by rarity:
    • 10/14 chance of a common (there are 4 such cards, so each individual card has a 75/420 chance of appearing)
    • 3/14 chance of an uncommon (there are 15 such cards, so each individual card has a 6/420 chance of appearing)
    • 1/14 chance of a rare (there are 3 such cards, so each individual card has a 10/420 chance of appearing)
  • Double-faced cards are removed from all of the other sheets.

The rules in Reuben's algorithm use the card's actual rarity, not the slot in which it was generated.

Magic Villains

First, generate a booster using the naïve algorithm, then check against the following rules, and if any of the rules aren't met, generate a new booster. Repeat until a booster that conforms to the rules is generated. The rules are:

  • no more than 6 cards of a single color in a pack
  • no less than 1 card of a color in a pack

Jannada

This set uses taw's algorithm.

Netropolis

This set uses taw's algorithm.

Custom Core 2018

This set uses taw's algorithm. (The set has no cards at basic land rarity.)

Hollows of Lordran

This set uses taw's algorithm.

Vastuum

This set uses Reuben's algorithm.

Ruins of Doharum

TODO confirm

This set uses the naïve algorithm since its designer hasn't specified otherwise.

Rakoa

This set uses taw's algorithm with the following modifications:

  • Despite being part of the set, basic lands don't appear in boosters at all. Instead of the basic land slot, there is a nonbasic land slot where any nonbasic land in the set can appear, though the chance is weighted by rarity:
    • 10/14 chance of a common (there are 7 such cards, so each individual card has a 110/1078 chance of appearing)
    • 3/14 chance of an uncommon (there are 7 such cards, so each individual card has a 33/1078 chance of appearing)
    • 1/14 chance of a rare (there are 11 such cards, so each individual card has a 7/1078 chance of appearing)
  • Lands are removed from all of the other sheets.

Eralou

This set uses the same algorithm as Magic Villains.

Scriptures of Urshad

This set uses taw's algorithm.

Secrets of the River Cities

This set uses taw's algorithm.

Custom Core 2020

TODO confirm

This set uses the naïve algorithm since its designers haven't specified otherwise.

Kuutalya

This set uses taw's algorithm with the following modifications:

  • Despite being part of the set, basic lands don't appear in boosters at all. Instead of the basic land slot, there is a nonbasic land slot where any nonbasic land in the set can appear, though the chance is weighted by rarity:
    • 10/11 chance of a common (there are 10 such cards, so each individual card has a 1/11 chance of appearing)
    • 1/11 chance of a rare (there are 5 such cards, so each individual card has a 1/55 chance of appearing)
  • These lands are removed from all of the other sheets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment