Page 1 of 1

Randomness, with Löve

Posted: Tue Aug 21, 2012 9:43 pm
by Roland_Yonaba
Hi,

I just was just reading the native implementation of love.run on the wiki.
So, from what I can see, the pseudo random generator is reset with a seed based on current time each time löve is started.

Code: Select all

    math.randomseed(os.time())
    math.random() math.random()
Actually, as some of you might be aware of, on some others frameworks, when you need randomness, using just math.random() will return the same sequence of values, even after restarted your Lua app.
Well, can I conclude that using math.randomseed later on is pointless as love.run already takes care of that ?
Unless one need to work with a specific seed ...

Re: Randomness, with Löve

Posted: Tue Aug 21, 2012 9:52 pm
by bartbes
This was added in 0.8.0, and it should seed (and discard the first few known-to-not-be-too-random-sometimes values) now. So generally speaking you don't need to seed yourself.