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

Rarity weights w/40+ values #83

Open omniNerd opened 2 years ago

omniNerd commented 2 years ago

I'm trying to add the rarity weights to trait types with over 40 values each. If the weights have to be different numbers and add up to 100, how can I properly assign weights to the values so the rarity function works properly? Can I assign a value of 1 to the all of the super rares and 2 to all of the rares without them overriding each other? Any help is greatly appreciated!

mixart commented 2 years ago

The rarity values are quite confusing, they're not percents, they are incremental percents (the top value should be 100).

Follow the process here... https://youtu.be/qmpuvGdI0w4?t=1795

For example the values I used are: 100,86,71,56,41,28,17,9,5,2

But the actual percents of each of the above are: 14%, 15%, 15%, 15%, 15%, 12%,12%, 8%, 4%, 3%, 2%

jasan-s commented 2 years ago

@mixart is correct, however Through my testing , it does not appear adding percent on weight guarantees the element usage. see my issue posted https://github.com/HashLips/generative-art-opensource/issues/159

I mean even if you set the weight of super rare trait to be 1%. and you generate 100 files, it is possible the 1% trait is not included in the outputted files.