A Random Feature

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

:pray: please be activated soon

4 Likes

So excited, I hope they activate it soon!

Any thoughts on being able to hop to a specific integer or number instantly instead of calling :NextNumber() or :NextInteger() a lot of times? I’m working on a slide generator with different obstacles, some of which require warning signs earlier on in the slide. I’m generating the slide on the fly and I want to know beforehand when certain obstacles should spawn (depending on random values). If I can just hop a few steps forward/backwards at once it would make things a lot more convenient.

2 Likes

Either tomorrow or early January.

7 Likes

Call :NextNumber() or :NextInteger() a bunch of times in advance, and store the results to a table. This is probably the fastest way to do it at the moment.

You could just use the noise function for something like that which would be easier. and you likely wouldn’t notice a difference if you “zoom out” enough with it

1 Like