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

[FEATURE] Layer Item Maximum Repeatability Settings #20

Closed
thepeanutgalleryandco opened this issue Feb 3, 2022 · 1 comment · Fixed by #25
Closed

[FEATURE] Layer Item Maximum Repeatability Settings #20

thepeanutgalleryandco opened this issue Feb 3, 2022 · 1 comment · Fixed by #25
Assignees
Labels
enhancement New feature or request

Comments

@thepeanutgalleryandco
Copy link
Owner

thepeanutgalleryandco commented Feb 3, 2022

Summary

At the moment, it is only possible to set maximum repeatability for all layers and layer items at a global level. Add the ability to also set the maximum number of times that a specific layer or layer item can repeat / be part of the collection.

Basic example

If I have a character layer with one item, hair layer with two items and glasses with three items.

Character:
main.png

Hair:
short.png
long.png

Glasses:
funky.png
square.png
oversized.png

Maximum layer repeatability: If I set my Glasses layer's maximum repeatability to 1, then only a single art work that gets generated will have this layer item. So with the layers, there would then be art work items generated:

  1. main.png + short.png + (funky.png OR square.png OR oversized.png)

Maximum layer item repeatability: If I set my Glasses layer item funky.png's maximum repeatability to 1, then only a single art work that gets generated will have this layer item. So with the layers, there would then be art work items generated:

  1. main.png + short.png + square.png
  2. main.png + short.png + oversized.png
  3. main.png + long.png + square.png
  4. main.png + long.png + oversized.png
  5. main.png + (short.png OR long.png) + funky.png

Motivation

Users would like to be able to force rarity on certain layer items for their collections.

@thepeanutgalleryandco thepeanutgalleryandco added the enhancement New feature or request label Feb 3, 2022
@thepeanutgalleryandco thepeanutgalleryandco self-assigned this Feb 3, 2022
@thepeanutgalleryandco
Copy link
Owner Author

Layer maximum repeatability can be configured at a global layer level, layer specific level or layer item level with the following options.

Example:

const layerConfigurations = [
  {
    growEditionSizeTo: 2,
    maxRepeatedTraits: 1,
    layersOrder: [
      { name: "Background" },
      { name: "Eyeball" },
      { name: "Eye color", maxRepeatedTrait: 2 },
      { name: "Iris" },
      { name: "Shine" },
      { name: "Bottom lid", maxRepeatedTrait: 3 },
      { name: "Top lid" },
    ],
    layerItemsMaxRepeatedTraits: [
      { name: "Background/Black", layerItemMaxRepeatedTrait: 4 },
      { name: "Eyeball/Red", layerItemMaxRepeatedTrait: 5 }
    ]
  },
];

If maxRepeatedTraits is set on a global level, whenever the art engine generates a new artwork that already contains a layer used before, then this new piece will be discarded and a notification will be displayed in the console with the message:

Combination of traits excluded because of global (${maxRepeatedTraits}) maximum repeatability exclusion rule!

If maxRepeatedTrait is set on a layer level, whenever the art engine generates a new artwork that already contains this specific layer, then this new piece will be discarded and a notification will be displayed in the console with the message:

Combination of traits excluded because of layer (${newTraits[i].layer}) maximum repeatability exclusion rule!

If layerItemsMaxRepeatedTraits is set on a layer item level, whenever the art engine generates a new artwork that already contains this specific layer item, then this new piece will be discarded and a notification will be displayed in the console with the message:

Combination of traits excluded because of layer item (${layerItemsMaxRepeatedTraits[layerItem].name}) maximum repeatability exclusion rule!

The creation of artworks will continue generating new combinations as usual, if possible.

These options will reduce the number of possible combinations and could be possible that the collection can not reach the requested number of elements. In this case increase the number of maximum repetitions or provide more traits in the layers that has less options to increase the probability of selecting different traits.

If the different options are not defined, then the specific restriction is not applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

1 participant