A Random Feature


#21

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


#22

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


#23

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.


#24

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


#25

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


#26

Woah, nice title pun. Thank you.


#27

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


#28

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


#29

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


#30

I’m pretty sure it’s more random


#31

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.


#32

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.


#33

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


#34

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


#35

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!


#36

Nice!!


#37

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


#38

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?


#39

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


#40

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