The Tokyo Rebels Art Build Overview
For those who are curious about the way we build the NFTs over at @TheTokyoRebels, here’s a sneak peek on our thought processes and how we approached the problems we have encountered along the way. But first, a little bit of history.
A few days after the rug, @rnoxxx___ shared an idea on our discord’s #art-derivative channel to show what he imagined the collection could be if we bring it back to life. It was well received by the community that was still grieving at the time, and was met with praise, *if onlys*, and wishful comments.
At the time, animated PFP NFT collections were basically non-existent, and most animated ones come in limited sets (1–3k) due to the complexities and the sheer time it takes to make them. One of the exceptions we found are projects from Genetic Chain which are animated on-the-fly. When I saw what rnoxx__ was proposing, I dm’ed him immediately to explore the possibilities of making a 10K animated PFP collection out from the ashes of TTT a reality. He whipped out some test layers, and I set out to find ways to put them together — automatically and randomly — by code. The biggest obstacle at the time was the time it would take, and in our head, simply stacking animated layers of traits on top of each other would not work in such a way that it would look good. After much struggle, we came up with this:
This first prototype does not look much, but it was proof-of-concept of the things we initially plan to do, that we might somehow pull it off.
And from there it was a blur! Three sleepless days later we have painstakingly recreated all the base assets from the TTT collection, and the madness began. rnoxx___ kept creating new stuff daily, with us working closely to put them together in ways that retain the charm of the old collection, and to add an interesting spin on how NFTs are built that we haven’t seen yet. All these lead us up to this moment a year later, where the NFT community at large could finally see our results.
The hurdles and the solutions
At the core of our art assembler is a “rule configuration” file that tells the random generator which parts are compatible or otherwise incompatible with other parts — all pretty standard when it comes to NFTs.
What sets ours apart is the concept of multi-layering within traits. The rules define which parts or traits come as single, a pair, or even multiple layers, and where exactly these parts can sit in the layer stack based on the absence or presence of other traits. With these rules, we have fine control on how each NFT is built, ensuring the whole piece looks as natural as possible, avoiding inconsistencies like eyewear inside helmets, tattoos over skin features, rain inside a building, among other problematic combinations. This rule file is about 3000 lines long.
Color matching
TTT was a colorful collection. So much so that on early animation tests we were afraid they would end up looking like *Christmas trees*, as rnoxx__ would put it.
To prevent this from happening, all assets are placed in a color pool where their main color components are grouped. For each assembled piece, the colors of each trait are compared with each other, and those that are *too colorful* are rejected. This results in a well-themed piece with no clashing colors and are pleasing to look at — or in NFT-speak: clean.
In addition, each background trait comes with its own color grading layer that helps incorporate The Rebels into the environment.
Layer ordering
Most NFTs would have a simple list of trait types and stack them in one particular order and call it a day.
For example: Background > Hair > Body > Eyes> Mouth > Extras
In our case it couldn’t be this simple. Some hair needed to be under eyewear, in some over it. Environment effects need to be in multiple layers, sometimes in front of or behind the main character, or even *outside* an indoor background, along with a myriad of possibilities in between. Should this mask be over the eyewear? How about this earring? To solve these, we have a comprehensive rule-set for which layers should sit on top of what, and on which particular scenario.
Here’s a little snippet of a rule:
The first rule above states that the earrings should be layered on top of Hair only if the hair is Short, Long or Ponytail. The next rule below it tells the code that the blindfold should always be under the hair, except when the selected hair value is Fauxhawk or Bun.
Flexible traits distribution
Aside from the general “chance” to mint an asset with a particular trait (e.g. 5% can have tattoos), we have also devised some detailed rules to ensure these percentages makes sense. For example, a simple 5% chance for a “Tattoo” trait to show up would not make sense if the character has clothes that would cover that tattoo. This would make them invisible and undesirable. What we did in this case is to group the assets into logical categories and assign different chances of traits to show up (or not at all) depending on what other traits are present and selected. Here’s a sample tattoo rule:
The sample rule above ensures that the Ghouls are not allowed to have a “Rebel” tattoo, as well as any class with the Oni and Amber skins. At the same time it assigns 0% chance to appear on closed-neck clothes, but with a 5% chance on ripped clothing where it would be more visible.
Randomizing an opinionated collection
To say that The Tokyo Rebels is a randomly generated collection is a little misleading. At this point, you’ll notice that a lot of care has been placed to ensure that the final NFT output would look a particular way, not only as a single item but also as a cohesive collection. The rules are the sum of our collective vision and opinions on how The Rebels should look like. With all the rules in place, is there still a fair chance to get the desirable “rare” traits?
Of course there is! Even if the traits are assigned a specific percentage of chance to appear, they are still random and are allowed to go over or under their target percentages by a certain margin to ensure fairness. For instance, in the old collection there are 1000 hunters exactly. In the new set, we don’t know. We set it as 15%, but the actual output could be 17% or 12% depending on the combined results of how specific assets have been affected by all the rules. We have no direct control on what the exact outcome would be, only an idea of what it *might* be. At the end of art generation, the results are re-validated against the rules and the percentage margins. If it goes too far from the expected results, that batch is discarded and are regenerated. We have done this over and over, and the results closest to our vision was selected.
PFP preview image
The Tokyo Rebels being an animated collection means that you don’t immediately get a single image that you could easily download, use, and share on your social media. Animated PFPs are not supported outside of Medium and Discord (Twitter soon, hopefully), JPEGs or PNGs are still required. Simply capturing a single frame from the animation (like a screenshot) has its own problem in that you don’t get to see all the cool parts of its traits at once due to the animation timings. What we did to solve this is to capture a specific frame from each animated trait that showcases its best parts, and put them together in a single image.
In a way, the preview image in itself is a separate NFT since you will not be able to find that *particular* frame out of the 600 frames in the animated format.
This is a tiny glimpse of the lengths we went through to rebuild and improve upon what little art we seized from the rugged TTT collection, with the hope that we bring back some value to our community members. It’s both a labor of love for our community, and of spite to those who left us dry.
We hope that you, our fellow Rebels, stay and keep supporting us through this grind, and get hyped. Tell all your friends in the NFT space about our awesome Tokyo Rebels community and our badass comeback!
PS. Shout out to the Guardians, the Mods, and the Dev Team. Their tireless efforts keep this community running and growing. Much love.
#TheTokyoRebels #RebelRiseUp #RebelVibes
三
Updated Nov. 16, 2022 after launch day