ID:2772175
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
Iirc something was announced along this lines for 515 but.

Can we get a datum, even if it's just /generator, that allows us to make a custom object of a random number generator, and seed it?

I want to make deterministic procedural generation a thing in code without requiring external libraries to handle this. However, seed_rand() isn't helpful here because that would require me to generate everything I'll ever need for the map in one loop, ensuring no other procs can run and possibly invoke rand() and throwing it off.

which is, obviously, not preferable and usually infeasible for said procedural generation features.
I'm almost certain this is on Lummox's todo list and there's probably a thread out there already for this, but until then I do have a Mersenne Twister library on the hub.
bumping this to ask if we can set seeds for /generators
There is something like `noise_hash()`, which does this in 515. Also you could do something similar even before with perlin noise or similar hashing functions.
I'd suggest switching to WyRand instead of MT if possible - it's EXTREMELY fast (output is measured in GB/s), very simple to implement, and passes practrand and BigCrush. Only issue is that you need to handle 128-bit ints, so you'd need to implement it on the C/C++ side of things, as it'd likely be slow and difficult if implemented in pure DM.

WyRand isn't a CSPRNG... but neither is MT.
I believe the `noise_hash()` uses `xxhash`.