So does this function, but you shouldn't use it:
Code: Select all
function math.betterrandom() return 4 end
Indeed, neither of the two PRNG-s are cryptographically secure either, but there are properities one does want from their generators, even for games... idk about you but i'd be pissed off if i expected uniformity and did not receive that... or if it straight out didn't return specific numbers... or always returning a sequence like 5,24,163,5,24,163,...
Must be why old games had shitty bot ai, huh?
Well, you didn't counter jack though; luajit can not support multiple PRNG-s using the two functions it offers, math.random and math.randomseed
Yes. besides the upvalue thing, which kinda would be a decent solution in and of itself, and the speed which i don't care about that much, the implementation itself is flawed... pretty sure i did say this before as well. You can't just save the output of the math.random call and think "oh, this is going to be the next seed!", it won't work as expected, and since there's no way to get the current seed/internal state of the luaJIT PRNG, you can't save and restore that state in any way whatsoever.
But it's still going to work wrong and not do what you want; you can not save the PRNG's state.
There is none, it's not possible... unless you re-implement the prng yourself in a way that can create separate generator objects, but that was not what the discussion was about.
The original post's problem wasn't really about which prng they used, that was you opening your post with that opinion about it being better debug-able like that...
Yeah, i didn't check the file because the issue was already solved; and yes, i am indeed correcting the eponymous someone who is actually dead wrong on the internet; hope no hard feelings though, i'm enjoying the banter myself.BrotSagtMist wrote: ↑Sat Sep 18, 2021 1:26 am Seeing that the file has only 3 downloads, i gather you are giving an opinion without even having looked at the file. For what?
Such fuss about a badly phrased tip.... on the bright side nothing is as instructive as a few pages of "someone is wrong on the internet!".