Randomizer
Last updated
Last updated
We are using the Aptos randomness API to randomize the trait values of the different traits of an NFT. A key feature of the Aptos Randomizer is that you will never know the traits of the generated NFT until the point of minting.
IMPORTANT: Currently, Reveal is NOT SUPPORTED when the randomiser feature is required, and vice versa.
User needs to create a “randomize” folder in the assets folder. Your assets folder should then look like this.
IMPORTANT: Make sure that the name of this folder is exactly "randomize"
Within the 'randomize' folder, you will need to setup your digital assets by creating different folders which contain the various layers of the final image. You will have to start with “01_” for the base layer and the folder numbers thereafter will determine the sequence of the image layers.
IMPORTANT: Please note this naming convention has to be strictly adhered to.
An example of the digital assets residing in ‘01_background’ folder:
An example of the digital assets residing in ‘08_facewear’:
Run the following line of code in your Minting Folder.
The trait_config.json file will be generated upon running command ‘odyssey populate-trait-config-list’. This json file is auto-generated based on the assets folder structure.
IMPORTANT: If rarity is require, users need to edit the specific probabilities of each trait value in the generated trait_config.json file. The original json file will be generated with equal probabilities of all traits.
The following shows an example of the trait_config.json file where each “Background” trait colour is given a probability of 50%, 20%, 15%, 10% and 5% respectively. Users need to ensure all the trait values add up to 100% for each trait type.
The probabilities support up to 2 decimal places, following is another example of another trait type “Facewear”:
Lastly, an example of a randomized NFT minted with an image file and its metadata json file: