Seed based RNG

I would like a seed system that makes it so the RNG is consistant if you replay the game with the same seed. I guess the RNG needs to be specific to each event. Is this even possible?
theoretically yes - practically it requires someone who knows how to program a random number generator in javascript.

And I suggest you rename the topic as the current topic title "seed system" is extremely misleading.
What you want is not a seed system but a random number generator that is based on a seed number.
This might not sound as much of a difference to you, but for a programmer that is extremely different.
random and seed-based are mutually exclusive.
you can't have predictability in a random system.... that's the foundation of *randomness*
random and seed-based are mutually exclusive.
you can't have predictability in a random system.... that's the foundation of *randomness*
I thought all the RNG was based on preprogrammed code within the computer, a computer doesn’t have the ability to be truly random anyway, right? In that case you don’t believe that RNG exists at all.
no, there is no true randomness, but there is a degree of statistical probability that leads towards equal distribution of occurrences across your scope of values *for "randomness"*
for *seed-based* generation, there is a degree of predictability: you WILL find a given value after a minimum number of tries, which defeats *probability* (as in, it's not *probability*, it's *certainty*)
for RNG systems, you'll have a spectrum of all possible values before you see a pattern.
with a seed based system, you'll see the pattern before you go through the whole spectrum of values.

most "random" generators out there actually use a seed based on the machine's clock.
since time can only go forward, you'll never experience the same output, because you'll never start from the same seed, because .... well.... time can only go forward.
look into that technique.
Yea, the thing is that Math.random is implementation-dependent and does not expose a seed value. 😴

A popular RNG method is the Mersenne Twister (a.k.a. MT). There's a JavaScript (Node) implementation here:

Based on the documentation, I think you could import that file and a small "patch" as two new plugins? The patch would simply replace your game's existing random function with one that references the new generator, e.g. (untested):
JavaScript:
var $gameRNG = new MersenneTwister();
Math.randomInt = function(max) {
  return Math.floor(max * $gameRNG.random());
};
Then you could initialise the generator with a new seed when needed via a script call, e.g.
JavaScript:
$gameRNG.init_seed(123);
Thank you so much! It seems to be working! 🙂

Original thread: https://forums.rpgmakerweb.com/threads/seed-based-rng.118164/