Skip to content

Conversation

jjohnson5253
Copy link

@jjohnson5253 jjohnson5253 commented Sep 16, 2021

This pull request adds a rarityData.js file that prints out the percentages of each attribute's occurrence throughout the collection. I added the layer name (calling it trait_type) to the metadata to make things easier. This seems to be typical of candy machines like metaplex anyway.

Example output:

Layer: ball
[
  { value: 'red eye ball super rare', percentage: 0 },
  { value: 'eye ball rare', percentage: 20 },
  { value: 'green eye ball rare', percentage: 20 },
  { value: 'grey eye ball', percentage: 10 },
  { value: 'red eye ball', percentage: 50 },
  { value: 'white eye ball', percentage: 0 }
]
Layer: eye color
[
  { value: 'red big super rare', percentage: 0 },
  { value: 'red small super rare', percentage: 20 },
  { value: 'pink big rare', percentage: 0 },
  { value: 'pink small rare', percentage: 10 },
  { value: 'purple big rare', percentage: 10 },
  { value: 'purple small rare', percentage: 30 },
  { value: 'cyan big', percentage: 10 },
  { value: 'cyan small', percentage: 10 },
  { value: 'green big', percentage: 0 },
  { value: 'green small', percentage: 0 },
  { value: 'yellow big', percentage: 10 },
  { value: 'yellow small', percentage: 0 }
]
Layer: iris
[
  { value: 'small super rare', percentage: 10 },
  { value: 'medium rare', percentage: 40 },
  { value: 'large', percentage: 50 }
]
Layer: shine
[
  { value: 'shapes super rare', percentage: 10 },
  { value: 'shapes rare', percentage: 40 },
  { value: 'shapes', percentage: 50 }
]
Layer: bottom lid
[
  { value: 'low bottom super rare', percentage: 10 },
  { value: 'tilted bottom rare', percentage: 40 },
  { value: 'high bottom', percentage: 50 }
]
Layer: top lid
[
  { value: 'tilted top super rare', percentage: 10 },
  { value: 'low top rare', percentage: 40 },
  { value: 'high top', percentage: 50 }
]

@NetworkEntity
Copy link

Amazing! Is there a way to impliment this into the Hashlips/Generative-Art-Engine code?

@jjohnson5253
Copy link
Author

You mean HashLips/hashlips_art_engine? Yea I made a pull request there too and it’s currently merged in with main. See the bottom of the readme on that repo

@NetworkEntity
Copy link

Exactly what I meant, great work! Thanks!

@DanChapp
Copy link

Thanks mate, such a great feature! If I generate the metadata.json and run the util it works, however if I rerun index.js to rebuild my images and jsons (including metadata.json) it returns the previous data, not the updated data. Have you encountered this?

@jjohnson5253
Copy link
Author

@DanChapp Hmm, I don't see that problem for me. Do you mean rarityData.js will use metadata from your initial index.js run? If I rerun index.js and then rarityData.js, the rarity data gets updated. rarityData.js reads in from ./output/_metadata.json so make sure that file is getting overwritten each time you run index.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants