MINIFIG GENERATOR

Welcome to the Minifig Generator-enator! This project started as a way to explore a possible implementation of the shiny hover effect used with the cards generated by this applet.

What Does It Do?

Click the Generate button to conjure a digital card with a random LEGO® minifigure from a selection of 22 bodies, 16 heads, and 57 types of hat or hair! Each one is from my personal collection and was carefully photographed, cropped, and sized for this project.

Generation Methods

The generator uses the following three methods to generate each roll: (1) Random Number, (2) Seeded Random Number, or (3) Secret Code.

Random and Seeded Random Numbers

When the RANDOM source option is selected, the generator will pick each part (a body, head, and hat or hairpiece) using a random number.

When the SEED source option is selected, you will be able to enter a string into the text box that will influence the random number generated. This method is useful because it generates repeatable results whenever a given seed is used. Share your favorites seed words with your friends!

Secret Codes

Each body, head, and hat or hair has an assigned "Part ID." When combined, these Part IDs form an eight-character alphanumeric Secret Code that can be used to generate any combination on demand, as long as you know which Part IDs you need. When the CODE option is selected, you will be able to enter the Secret Code into the text box.

New codes can be found by generating new rolls. See if you can figure out the code for the Gilded King!

Rarity Scores

Each head, body, and hat or hair piece also has an assigned Rarity Score. These values are used to calculate an overall Rarity Score for each roll, divided into the following tiers:

  • Common - A Rarity Score between 1.0 and 3.9
  • Rare - A Rarity Score between 4 and 5.9
  • Epic - A Rarity Score between 6.0 and 7.6
  • Legendary - A Rarity Score between 7.7 and 9.9
  • Mythical - A Rarity Score of 10 or higher

Each tier is color-coded so you can instantly see how rare your roll is. The Mythical background is guaranteed to appear if the roll includes the golden body, golden head, and golden crown (odds of about 1 in 125,000). However, because certain combinations recieve a Combo Multiplier, it is possible to achieve a score of 10 or higher in other ways.

Also, if you get impatient and start spamming the Generate button, don't worry; any time the roll is Epic or better, you won't be allowed to generate a new roll for one full second. Neat!

Combo Multipliers

Certain combinations of heads, bodies, and hat or hairpieces result in a roll that is more cohesive than others. If one of these combinations occurs, the generator applies a combo multiplier bonus to the Rarity Score of the roll.

For example, a roll with the firefighter body will recieve a multiplier bonus if it also rolls with the smiley face or the firefighter helmet. If the roll includes the smiley face, the firefighter helmet, and the firefighter body, the individual bonuses from each piece are multiplied together for an even greater boost.

The Beard Multiplier

Only one piece covers the face of the minifigures generated: the Beard. This piece is separately from the rest of the hats and hair because it isn't compatible with every other type. To prevent unnatural combinations that wouldn't be possible with real LEGO® minifigures, the generator picks the hat or hairpiece first, and determines whether it is compatible with the Beard. If it is, there is a 5% chance that the Beard will appear. When it does, the Rarity Score of the assigned headpiece gets a bonus that is incorporated into the final overall Rarity Score of the roll.

Saving Your Roll

In addition to writing down your favorite Secret Codes the old fashioned way, you can also save an image of your roll using the Save button. It won't be quite as shiny as the real thing, but you can still save your best rolls and brag to your friends!

Secret Code: