Seed 100:
Code: Select all
c global.g.re_seed(100); game.print(global.g(1, 1000)); game.print(global.g(1, 1000))
Seed 350:
Code: Select all
c global.g.re_seed(350); game.print(global.g(1, 1000)); game.print(global.g(1, 1000))
Seed 355:
Code: Select all
c global.g.re_seed(355); game.print(global.g(1, 1000)); game.print(global.g(1, 1000))
I could go on.
Numbers change in some roughly linear pattern. You get a similar effect as you explore other seeds and other ranges of numbers, so I didn't just get lucky.
Why is that? Taking a wild guess, map generation uses the seed to change starting location in some scaled fashion (viewtopic.php?t=31083), so maybe LuaRandomGenerator is designed around that. But I would figure that for general use the random number sequence to have some non-trivial relationship with the seed.
Do we need two LuaRandomGenerators, one with this behaviour for compatibility, one with more general purpose behaviour?
For now, I'm using my own RNG to work around this behaviour, but I ran into a strange Lua bug (viewtopic.php?f=7&t=70571) which made me revisit my choice. Hence this post
Edits: I've edited all my posts here for clarity