Took me a while to debug and identify why this was happening...
I was taking advantage of RESET to clear clipping and palette and as a side-effect RND() started to misbehave returning always the exact same number. I guess that RESET also sets a fixed srand seed and that's why the pseudo-randoms go stale... Probably worth documenting that RESET also does that or if this was unintentional fix it...
Well, it’s annoying indeed. Maybe @zep would want to reconsider whether reset() should overwrite the PRNG memory area.
Well it has an effect only if you are calling RESET regularly (I was doing that at the end of _draw() to clear out all my tampering...)
Yup it seems undocumented, but reset() reseeds. I called it on each new game state to clear clipping and palette tweaks.
> reset();for i=1,5 do print(rnd()) end
[Please log in to post a comment]