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

Adding weight doesn't guarantee usage of trait element #159

Open
jasan-s opened this issue Sep 21, 2021 · 1 comment
Open

Adding weight doesn't guarantee usage of trait element #159

jasan-s opened this issue Sep 21, 2021 · 1 comment

Comments

@jasan-s
Copy link

jasan-s commented Sep 21, 2021

In the following example for headwear layer with None element has 30% weight and remaining all have 10% each, see code.

      {
        name: "Headwear",
        elements: [
          {
            id: 0,
            name: "None",
            path: `${dir}/headwear/none.png`,
            weight: 100, //30%
          },
          {
            id: 1,
            name: "Headphones",
            path: `${dir}/headwear/headphones.png`,
            weight: 70, // 10%
          },
          {
            id: 2,
            name: "Beanie",
            path: `${dir}/headwear/beanie.png`,
            weight: 60, // 10%
          },
          {
            id: 3,
            name: "Brain",
            path: `${dir}/headwear/brain.png`,
            weight: 50, // 10%
          },
          {
            id: 4,
            name: "Birds",
            path: `${dir}/headwear/birds.png`,
            weight: 40, // 10%
          },
          {
            id: 5,
            name: "Tattoo",
            path: `${dir}/headwear/tattoo.png`,
            weight: 30, // 10%
          },
          {
            id: 6,
            name: "Zombie hat",
            path: `${dir}/headwear/zombie hat.png`,
            weight: 20,// 10%
          },
          {
            id: 7,
            name: "Alien headset",
            path: `${dir}/headwear/alien headset.png`,
            weight: 10, // 10%
          },
        ],
        position: { x: 0, y: 0 },
        size: { width: width, height: height },
      }

Expected:
With editionSize set to 100, Out of 100 output files, each of non-None elements(Headphones, Beanie. etc) should represent 10% of the headwears and 30% of files should have None headwear

Actually Happening:
Some headwear elements are not included in any outputted files.

@calebharris216
Copy link

Yeah these rarity weights are unbelievably confusing. In one of the videos he says to have them ordered from highest to lowest with no duplicate values, though even when I account for this, whatever element I put at the top gets vastly overrepresented. I am struggling for answers.

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