In this video, Pablo will show you how to use rules for your collection. Continue to Session 7: Adding Custom Tokens to learn about saving and creating custom tokens.
While creating each of the traits in your collection, you may find that some traits do not mix well with others. In these cases, you want to create rules within the rules tab under manage.
With that said, let’s take a deep dive into rules! For our examples, we will once again work with our Bueno Gente.
Let’s begin with the most straightforward rule. Doesn’t mix with prevents a selected trait from ever appearing with another selected trait. This rule is bidirectional - that means it works both ways!
Problem: In the Bueno Gente collection, we have a body color and a background color that are a little too similar - Purple and Blurple.
To make sure our tokens look good and have color contrast, we don’t want the purple bodies to ever mix with the blurple background. Time to make a rule!
Rule: Purple Body doesn’t mix with Blurple Background.
Result: Whenever Blurple Background appears in a token, Purple Body will never appear in that token.
Likewise, whenever Purple Body appears, Blurple Background will never appear.
Our next rule is a little more tricky. Only mixes with works when you would like a selected trait only to appear when another selected trait appears.
The only mixes with rule is unidirectional, and only works one way - from left to right! So, just because trait x only mixes with trait y, that doesn’t mean that y only mixes with trait x. Any other trait options in your trait pool can still mix with y.
Problem: Let’s say we still aren’t satisfied with the color contrast between the purple body and most of the other background colors. So, we’d like to see the purple bodies only with green or yellow backgrounds so they really pop.
Rule: Purple Body only mixes with Yellow Background and Green Background.
Result: Whenever Purple Body appears in a token, it will be paired with Green Background or Yellow Background.
However, whenever Green Background appears in a token, it doesn’t always need to be paired with Purple Body. It can still appear with any color body! The same goes with Yellow.
Always pairs with is a stricter version of only mixes with. This rule ensures that traits always appear together, and never separate. You can think of it as kind of the opposite of our doesn’t mix with rule.
Since the always pairs with rule works both ways, it can be used to group multiple traits from different attributes together. For example:
- Trait x always pairs with trait y
- Trait y always pairs with trait z
- Traits x, y & z will always appear together
Problem: As we are working with our Bueno Gente tokens, we finally decide that we want something like our previous rule, only more strict. We only want to see green and yellow backgrounds when we have a purple body in a token.
Rule: Purple Body always pairs with Yellow Background and Green Background.
Result: Whenever a purple body appears, the background will either be yellow or green, and nothing else.
Likewise, No other body colors besides purple will be paired with yellow or green backgrounds.
If a trait is paired to another, then the chance of it getting picked is equal to the rarity of either traits getting picked. As a result, a trait that has a low rarity % (very rare) may become more common (less rare) if it has been paired with a trait of higher rarity.
This is basic probability at work when there are two events that are not mutually exclusive. This means that the overall rarity of your paired traits in your token set equals the probability of both traits combined (Trait A + Trait B) minus the probability of both showing up together (Trait A x Trait B).
If this seems a bit complicated, we can brush up on probability together!
Let’s say we set Purple Body rarity at 2% (rare), and Yellow Background rarity at 20% (common). Then, we tell Bueno to always pair those 2 traits.
Problem: Out of a token set of 100, about how many tokens will have both traits? We can estimate by using — you guessed it — math!
We will be using the simple formula (A+B) - (AxB) = overall rarity
.02 + .20 = .22
.02 x .20 = .004
.22-.004 = .216
.216 = 21.6%
Solution: The overall rarity of the traits is 21.6%, so we should have about 21 or 22 tokens with these paired traits in a set of 100 total tokens.
If any of the traits has a fixed quantity, then paired traits will be limited to the lowest fixed value.
Our latest rule gives you the power to make sure that your tokens have at least one asset. This is useful when you want to vary the number of assets that show up in your tokens, but want to make sure none of your tokens end up with zero assets. This rule is great for collections with many different attribute groups to create additional token variation.
Problem: We want to vary attribute distribution across our token set. We decide that we want tokens to have hair sometimes, clothes sometimes and both attributes sometimes. However, we never want a token to be completely nude (no clothes, no hair).
To get our desired outcome, we start by setting the attribute rarity of Hair and Clothes down to 50%. For the sake of this example, we will limit all Body options to Blue.
While some tokens are rendering correctly, we see that many of our tokens are totally nude, lacking both hair and clothes. Uh oh!
Setting our attributes' rarities below 100% means that the traits in those attributes won't always show up in a token when we hit generate. We can now correct the problem with a rule!
We will set up an always appears with rule so that our Body always appears with at least one Hair or Clothes trait.
Now, when we generate, we will no longer see those nude tokens.
If your tokens are failing to generate or you notice rules aren’t behaving then we have some things you can do to help isolate the problem.
You can use our rule analysis (Manage > Rules > Analyze Rules) tool to make sure you don’t have any conflicting rules. It’s very easy to create rules that conflict, but we try our best to find these for you!
You can also try removing rules one at a time to find which one is causing the generation to fail. You can always re-add it after.
If you’re using fixed trait or template quantities then make sure you have allocated enough traits. A template will not be used if it cannot satisfy always pairs with rules.
Trait rarity also plays an important role. If your traits are too rare, or you have the overall attribute rarity set less than 100%, it’s possible the generator will never pick your traits.
If you’re still stuck, please reach out to our support channel with a link to your collection and a description of what’s going wrong.