Page 1 of 1
math.randomseed()
Posted: Tue Oct 05, 2010 3:04 am
by Lap
math.randomseed(os.time())
Should probably be included in the base code of the T-Engine every time it starts, otherwise you have to manually add it to each module so you don't get the same random numbers every start up.
Re: math.randomseed()
Posted: Tue Oct 05, 2010 7:45 am
by darkgod
No, you do not want to use math.random at all.
Use the rng.* functions, they are correctly inited and use a mersene twister which makes much better random numbers than the default OS rand()
Re: math.randomseed()
Posted: Tue Oct 05, 2010 4:25 pm
by yufra
There are a few calls to math.random from the thirdparty modules, anything in there that is sensitive to non-randomness?
Re: math.randomseed()
Posted: Wed Oct 06, 2010 8:00 pm
by darkgod
True .. I'll include the init just in case
Still for your own code use rng.*
Re: math.randomseed()
Posted: Wed Oct 06, 2010 8:27 pm
by Shoob
perhaps it would be better to say here is a list of rng.* functions you can use, rather than say use them... as some people may not know all of them... and it is easier to find the math.* stuff because it is written down online.
Re: math.randomseed()
Posted: Wed Oct 06, 2010 8:36 pm
by yufra
That reminds me, is there any way to include documentation of the C functions exposed to Lua with the LuaDoc generated documentation?