HashLips / generative-art-opensource

Create generative art by using the canvas api and node js, feel free to contribute to this repo with new ideas.
MIT License
1.36k stars 695 forks source link

Race weights not working #142

Open jon5791 opened 2 years ago

jon5791 commented 2 years ago

When I put in the race weights it isn't randomising anything it just pull from the one with the highest number the most. Even if it's only 1 number higher than all of the other ones it will only pull from that one.

jon5791 commented 2 years ago

Forgot to mention I'm using branch 4.

jon5791 commented 2 years ago

Hi, So I have found out part of the issue is having more than 10 variables for a layer since the code will only put out a number between 0 and 9. It seems to pull id: 0 the most no matter what weight I give it. I could give it a zero and it will still pull it. I even tried deleting that colour background from one of the races and it still pulled it from another races layers. (not sure how it is doing that.) Is there a way to have it create a random number up to the amount of available layers?

Thank you for your help.

cryptopharma commented 2 years ago

i'm having the same issue. most of my element layers have 10 to 20 layers, and it seems to pick the top layer 9 out of 10 times. i've carefully layered things in the right order, but with 20 layers you have duplicate weights. also if i put 100 at the top layer it picks that all the time. theres got to be a better randomization code for weights of 20 layers.

cryptopharma commented 2 years ago

Hi, So I have found out part of the issue is having more than 10 variables for a layer since the code will only put out a number between 0 and 9. It seems to pull id: 0 the most no matter what weight I give it. I could give it a zero and it will still pull it. I even tried deleting that colour background from one of the races and it still pulled it from another races layers. (not sure how it is doing that.) Is there a way to have it create a random number up to the amount of available layers?

Thank you for your help.

i've tried that as well and yes it picks the top layer no matter the weight.... got to be another way