HashLips / generative-art-opensource

Create generative art by using the canvas api and node js, feel free to contribute to this repo with new ideas.
MIT License
1.36k stars 695 forks source link

Suggestions for rarity percentage for layer #44

Closed Y-Ali closed 2 years ago

Y-Ali commented 2 years ago

So I've got 6 layers and the code was producing over 1000 images but now is producing less due to some changes that I've made to the rarity percentages ...

addRarityPercentForLayer('original', 'accessory', { 'super_rare': 0, 'very_rare': 0, 'rare': 0 , 'original': 100 });
addRarityPercentForLayer('rare', 'accessory', { 'super_rare': 0, 'very_rare': 0, 'rare': 50, 'original': 50 });
addRarityPercentForLayer('very_rare', 'accessory', { 'super_rare': 0, 'very_rare': 40, 'rare': 40, 'original': 20 });
addRarityPercentForLayer('super_rare', 'accessory', { 'super_rare': 50, 'very_rare': 20, 'rare': 10, 'original': 20 });

Can someone suggest what percentage I could assign to each one for the above please and suggest how I should distribute the percentages for the other layers too? It gets a bit confusing with a lot of layers lol

Ponda1 commented 2 years ago

Your layer percentages are too heavy on a single rarity which highly decreases the number of unique images which can be generated. Just try to make sure each layer has a well distributed rarity percentage. For instance , Changing the values to something like addRarityPercentForLayer('original', 'accessory', { 'super_rare': 5, 'very_rare': 15, 'rare': 30 , 'original': 50 }); You are gonna have to spend a lot of time tweaking the different values for all the layers to get the desired outputs. It took me like 4-5 hours editing the values to get the elements I wanted lol

thecryptobirdie commented 2 years ago

could you please explain what these lines of code mean and what the values signify? also how did you add/what did you change to make the very rare layer work?

Ponda1 commented 2 years ago

@thecryptobirdie addRarityPercentForLayer('original', 'accessory', { 'super_rare': 5, 'very_rare': 15, 'rare': 30 , 'original': 50 });

Here original refers to the nfts generated in original rarity and accessory is the layer which the element is picked from. This piece of code is defining the rarity of each element being picked from the accessory layer so you can really fine tune the results. Say you want to do the same for all rare nfts for a layer called background you could add something like this: addRarityPercentForLayer('rare', 'background', { 'super_rare': 5, 'very_rare': 20, 'rare': 35 , 'original': 40 });

And you can keep adding these for all your layers and rarities. Just make sure the values add up to 100 or you'll get an error. I hope you understood im really bad at explaining XD

thecryptobirdie commented 2 years ago

Alright I think I understand. Just would i have to do ('original', 'background', ('rare', 'background', ('super_rare', 'background', for every layer?

Ponda1 commented 2 years ago

@thecryptobirdie yeah and then change the 'background' to the layer name for every original rare and super rare.

thecryptobirdie commented 2 years ago

perfect. ill give it a shot! Thanks so much!