A Random Feature

Thank god for this. I’ll probably be using this for some sort of terrain generation.

Heck yes! I wrote a deterministic RNG in Lua for Bloxel because I needed to generate infinite worlds based on world seeds. Now I can switch to this. Very thanking @Fractality_alt @0xBAADF00D

3 Likes

Is math.random going to become depreciated now? Also if you just need a simple random number (like 1 or 2, and nothing more complicated than that) is there an advantage to either method? I would assume this new method is better.

1 Like

Heads up, we’ve temporarily disabled this feature until more platforms are on the latest version.
Stay tuned.

1 Like

We’ve needed this for a long time. Thank you.

Woah, nice title pun. Thank you.

1 Like

I’ll let the clickbait title slide… cus this is sweeeet!! thank you!!

1 Like

I dont see how this is any different from math.random except being able to copy the Random object?

1 Like

Guess you didn’t read the post then. Pretty obvious on how it’s different. :roll_eyes:

1 Like

I’m pretty sure it’s more random

1 Like

When you use math.random, all of your scripts share the same state for that random generator. With this feature, you have stateful randomness per object of Random (can instance new random objects, only use those in certain places, so you can reproduce random sequences better with a given seed). The quality of randomness is also higher due to a different algorithm being used.

3 Likes

In addition, math.random behavior is crazy & unpredictable (in a non-necessarily-truly-random way): Math.random() returns same number every time after a delay from setting randomseed. Because of this we will change math.random implementation to use the same RNG algorithm with a global Random instance instead of the current platform-specific behavior.

10 Likes

Would the min parameter default at 0, in case we only want to pass a max argument?

2 Likes

Woah! I love it. I think it could be better explained though :stuck_out_tongue:

3 Likes

I’m hoping this crushes the return the same value functionality. I want to spawn mobs around my map in a truly random way. Thanks for the update!

1 Like

Nice!!

1 Like

Finally, a less clunky RNG, praise the new random number god.

1 Like

Do you have a rough estimate as to when this’ll be active again? Do you know if all versions are approved and live yet?

3 Likes

This usually tends to take a bit of time, considering fractality only posted a day ago that it has been disabled. I also don’t think they normally turn on features during the weekend

Awesome!!! Now I can make my code more random than it already is!

1 Like