Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we create incompatibilities? #3

Open
hamsterzbc opened this issue Mar 23, 2022 · 5 comments
Open

Can we create incompatibilities? #3

hamsterzbc opened this issue Mar 23, 2022 · 5 comments

Comments

@hamsterzbc
Copy link

Hi there is a way for make some exclusion like background never with blue body ? I dont see how to add in config. Thanks !

@alephao
Copy link
Owner

alephao commented Mar 23, 2022

@hamsterzbc hello, there is no way to do it via configuration currently, but it's an interesting feature.

What I've done in the past is to create multiple configurations and merge the generated collection later. You can use the nftool merge command for that and it guarantees no collisions. Do you think that would work in your case?

Also, if we were to implement this feature, how do you imagine yourself using it? How the configuration would look like to describe what you want?

@hamsterzbc
Copy link
Author

Ah i see yes can work i can generate the blue one the green one and merge. But for some case will not work Like for exemple i have few HAT that dont work with few eyes. This will make the job painfull but thanks for your answer !

For the feature in config :

  • trait_type: BG
    variants:
    • value: BLUE
      weight: 1

    • value: GREY
      weight: 10

    • value: jungle
      weight: 11

    • value: LUNE
      weight: 12
      Maybe in separate config file or just add in

      "trait-type": "BG",
      "value": "BLUE",
      "incompatible_with" : "traitname(value),trait2,trait3"

      But this mean all trait got unique "value"

@hamsterzbc
Copy link
Author

or maybe when dump the trait list add an ID to each trait so can filter by id for incompatible and do :

"incompatible_with" : "traitid,51,45,89"

@alephao
Copy link
Owner

alephao commented Mar 24, 2022

But this mean all trait got unique "value"

I think it's safe to assume that. The value is the only differentiator between variants in attributes:

{ "trait_type": "Body", "value": "Blue" }

Building on top of your idea, I think using an object to represent exclusion/incompatibility might make the api a bit better, this way we can exclude from multiple traits, for example, Body 1 is incompatible with Head 2 and incompatible with Face 3:

traits:
- trait_type: Background
  variants:
  - value: Green
    weight: 1
  - value: Red
    weight: 1
  - value: Yellow
    weight: 1
  is_optional: false
  optional_weight: 1
- trait_type: Shape
  variants:
  - value: Circle
    weight: 1
  - value: Square
    weight: 1
    exclude:                # <--------------------------------------
        Background: [Green] # <--------------------------------------
  is_optional: false
- trait_type: Direction
  variants:
  - value: Down
    weight: 1
  - value: Left
    weight: 2
  - value: Right
    weight: 2
    exclude:               # <--------------------------------------
      Background: [Yellow] # <--------------------------------------
      Shape: [Square]      # <--------------------------------------
  - value: Top
    weight: 2
  is_optional: false

Another option also following the same idea is to have an exclude list of TraitType:Value instead of using objects

exclude: 
- "Background:Green"
- "Shape:Yellow"

^ I think this might be cleaner/easier

@hamsterzbc what do you think about those?

--

On another note, I'm smashed with work this week, but might have some time to start implementing this in the next weeks. If you or anyone else who's reading this want to give it a try, I'm happy to assist with ideas and happy to test it out.

@hamsterzbc
Copy link
Author

Hi option 2 look good ! And simple to use!

exclude:

  • "Background:Green"
  • "Shape:Yellow"

Sorry cant help on code side. But glad you take this as mission i think its a must have ( also on what i see on github i found only one project on python with this function ) But if look on other function your tools is more advanced.

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

No branches or pull requests

2 participants