ID:2319575
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
BYOND being limited to a single prng globally is a major headache.

I'm fine with rand(), prob(), pick(), and roll() as they currently work.

I'd just prefer that they be wrapped in an object, and the existing global rand(), prob(), pick(), and roll() procs be syntactic sugar to pull from the default random number generator.

This way we can actually instantiate multiple prngs each with their own seed so that different parts of the game can have reliable deterministic outcomes independent of one another.

Structure:

/random
proc
rand(low,high)
roll(num,sides)
prob(pct)
seed(seed)
pick()
New(seed)
This is something I've thought about on and off. It would be really good to specify a particular persistent RNG.
++++
This may not be necessary to implement in hard code, as just tonight I was able to get a native implementation of MT19937 without any DLLs or external calls. I'm gonna try and have it up on the hub here in a few days.