Giter Club home page Giter Club logo

Comments (8)

thepeanutgalleryandco avatar thepeanutgalleryandco commented on August 20, 2024

@thoechsmann just thinking about this feature a bit, how would you handle it if someone configures multiple dependency traits for a single trait?

For example: I have a dependency trait for Background: Cyan , to only include Eyes: White. Then I have a second dependency trait for Background: Cyan , to only include Eyes: Red. Which one will hold true or should both hold true?

This is why I sort of see the feature as an inclusion rule, meaning that only if these traits combinations are available, then the NFT should be created. Otherwise, the NFT that got created should be rejected. Basically the opposite of the exclusion rule.

I experienced how long the exclusion list can become while helping another user, where the developer had 20 layer items in a layer, and the developer only wanted a combination with a single item in that layer. The developer had to exclude the 19 items instead of simply stating the item that he wanted to combine and only allow that combination.

from create-and-mint-nft-collection.

thoechsmann avatar thoechsmann commented on August 20, 2024

from create-and-mint-nft-collection.

thepeanutgalleryandco avatar thepeanutgalleryandco commented on August 20, 2024

I see that you are fixing the DNA within the filter, but are you also changing it in the main method to the correct image layer items for creating the actual image for the specific JSON file? I am not too keen on a DNA fix within the filter file itself

I would like to see an inclusion rule / trait dependency rule in the code base that could work in the following way. I am happy to work on it and do the conversion from exclusions to filters as well, so that we can also build on top of that going forward.

My thinking was the following:

compatibleTraits: {
"Eye color/Cyan": [
"Eyeball/Red",
],
"Iris/Large": [
"Bottom lid/High",
"Top lid/High",
],
"Background/Orange": [
"Bottom lid/High",
"Bottom lid/Low",
"Top lid/High",
]
}

The way this would then work is as follow:

  1. Layer item "Eye Color/Cyan" must have a layer item "Eyeball/Red", otherwise the NFT will be rejected.
  2. Layer item "Iris/Large" must have layer items "Bottom lid/High" and "Top lid/High", otherwise the NFT will be rejected.
  3. Layer item "Background/Orange" must have layer items "Bottom lid/High" OR "Bottom lid/Low" and also have "Top lid/High", otherwise the NFT will be rejected.

from create-and-mint-nft-collection.

thoechsmann avatar thoechsmann commented on August 20, 2024

Looks good.

And yes, fixing in the filter is not very nice, but I need fixing as otherwise generating valid DNAs will get very unlikely in my use case, where we have one trait that is using 4 layers.

if there are compatible traits that have more than one option, should we also take into account potential trait probabilities?

The cleanest implementation would be to take filters already into account when the layers for the DNA get selected in the 1st place.

from create-and-mint-nft-collection.

thepeanutgalleryandco avatar thepeanutgalleryandco commented on August 20, 2024

And yes, fixing in the filter is not very nice, but I need fixing as otherwise generating valid DNAs will get very unlikely in my use case, where we have one trait that is using 4 layers. - So you would like the fixing / change of DNA so that it ignores the wrong DNAs, like in the last point? I think if we handle this incrementally with main functionality going in first, and then later do the clean implementation of the filters at the point of layer selection, then this will be easier chunks to manage.

if there are compatible traits that have more than one option, should we also take into account potential trait probabilities? - Can you elaborate on this? I was thinking of keeping it as simple as possible

The cleanest implementation would be to take filters already into account when the layers for the DNA get selected in the 1st place. - I agree, perhaps we can keep this as part of a re-work, and just build the initial compatible functionality in.

Keen to hear your thoughts and thanks for the collaboration and bouncing of ideas!

from create-and-mint-nft-collection.

thepeanutgalleryandco avatar thepeanutgalleryandco commented on August 20, 2024

Added a new configuration option on the layerConfigurations array object in the src/config.js file.

dependentTraits: {
      "Eye color/Cyan": [
        "Eyeball/White",
      ],
      "Background/Blue": [
        "Eyeball/Red",
        "Top lid/low"
      ],
}

This will check and ensure that if the layer item Cyan is select for Eye color, then the layer item White should be selected for the Eyeball layer, otherwise it will reject the edition. If the layer item Blue is selected for the Background layer, then Red should be selected for Eyeball, while low should be selected for Top lid layer, otherwise the edition will be rejected. If the edition contains both Cyan for the Eye color and Blue for the Background, then all three of the dependencies need to be selected for the edition, otherwise the edition will be rejected.

A new error will be shown to the user when the filtration rule rejects an edition:
Combination of traits filtered because of dependent traits filtration rule! Only 2/3 dependent layers were found.

The 2/3 will be dynamic, depending on how many traits were missing based on the dependency rules.

With filtration rules in place, users need to ensure that they have enough layers available to reach their specific NFT collection's growth size, or alternatively, reduce the filtration rules.

from create-and-mint-nft-collection.

thoechsmann avatar thoechsmann commented on August 20, 2024

nice. Will check it out.

from create-and-mint-nft-collection.

cesar4design avatar cesar4design commented on August 20, 2024

I have a folder with two subfolders.
How to make a layer compatible with all traits from only one subfolder.

I thought

etc

"Body/Black":
[ "Right Hand/Black/*",

etc

from create-and-mint-nft-collection.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.