Unreal-Dan / lightshow.lol

A demo site to show off Vortex Engine
GNU General Public License v3.0
2 stars 0 forks source link

Color randomization is always the same. #43

Open LivingSynthesis opened 1 month ago

LivingSynthesis commented 1 month ago

Color randomization results are identical every time

Edit: this is because the seed is working correctly from the same initial mode. Idk how to improve this but it kinda feels bad. Maybe the default mode generates a random random seed before randomizing?

Unreal-Dan commented 1 month ago

I intend to make a randomize window similar to the color selector which would replace the current randomize buttons, it would offer all kinds of randomization controls like selecting the number of colors you want to randomize, a range of pattern ids to randomize within, or possibly a single pattern ID with a range of parameters. Could have things like colorset-completion where you open the randomizer on say a 3ccolorset and then select '6c' colorset and it will randomly fill in the next 3 colors based on some random color theory based on the first 3.

Ultimately, the goal is to expand the users access to randomization options significantly through a new UI.

With regards to this issue, there's no reason we cannot solve this in the meantime with a slightly modified randomization technique. All kinds of tricks could be applied in the javascript, even 1 or 2 lines.

The location where this happens is the control panel code:

https://github.com/Unreal-Dan/lightshow.lol/blob/main/js/ControlPanel.js#L247

That is just using the default Lightshow function randomizeColorset:

https://github.com/Unreal-Dan/lightshow.lol/blob/main/js/Lightshow.js#L445

This function is actually just opening the randomizer menu and injecting clicks to simulate somebody clicking in the menu, it really is the poorest kind of randomization. There's a lot of other ways a colorset could be randomized or some entropy could be injected to make the results change. Like you could just delete a random color from the current colorset before doing this click-injection randomization and that will exponentially increase the randomness. There is already functions like Lightshow.addColor which can add colors to the colorset -- you could delete a color then add one and then randomize and it would always give you something new (Because the seed changed).

at any rate, million ways to skin this cat but I'm not going to spend any time on it right now as I will just circle back and make the randomization menu when I get a chance. I'd love to see what you can come up with if you want to give this a shot, but I wouldn't be bothered if you didn't.