|
| 06 Apr 2014 12:27 AM |
even with seeding, my math.random integer kept on coming out as sequences, just as I thought it would. Are there any other algorithms so I can make an alternative function to math.random?
i'm asian |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 06 Apr 2014 12:40 AM |
is atmospheric noise actually true (human-like) random?
i'm asian |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
| |
|
|
| 06 Apr 2014 12:45 AM |
but isn't random() a PRNG?
i'm asian |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 06 Apr 2014 12:48 AM |
| Second alternative: math.floor(tick()*100000)*MAX%1 |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2014 12:52 AM |
what is MAX? math.max?
i'm asian |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 06 Apr 2014 12:57 AM |
I did that one horribly
function altRandomNum(min, max, integers) local num = math.floor(tick()*1000000)*(max-min)+min if integers then num = num%1 end return num end |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2014 01:01 AM |
that's basically what i'm doing right now, except that the number keeps on coming out in sequences
i do a number between 1,4
it goes 1,1,1,1,3,3,3,3, 2,4,1,4,2,1,3,4,1,3 something like that
i'm asian |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2014 01:09 AM |
bump I know tick() is a physical phenomenon but is it really going to generate random? it's just a time ever since unix right? Why would that generate random? I was thinking more thermal noise and atmospheric noise for random
i'm asian |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Apr 2014 01:10 AM |
| Anytime you are using a computer you are always going to get some sort of sequence. |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2014 01:11 AM |
yes, but on the random.org, it didn't come up with as SIGNIFICANT of a sequence
i'm asian |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Apr 2014 01:30 AM |
Because it's not computer generated. random DOT org/randomness/ |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2014 01:32 AM |
I know it's generated via atmospheric noise but I was going to use thermal noise originaly but isn't tick() also a natural thing
i'm asian |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Apr 2014 01:34 AM |
No, tick is just the time since Jan. 1 1960. That's not natural, it's literally just doing 1, 2, 3, 4, ..., now |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2014 01:43 AM |
so why do they use that for the seed
i'm asian |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Apr 2014 01:44 AM |
| Because it's always increasing, it will never be the same again. |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 06 Apr 2014 01:58 AM |
wait, TRNG's are slower? I've heard that the Blum Blum Shub algorithm for PRNG's are slow too though
i'm asian |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2014 01:59 AM |
...well not algorithm i should say blum blum shub generator that IS a prng
i'm asian |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Apr 2014 02:02 AM |
| TRNG's are dependent on what is actually being measured while PRNG need no physical "input" meaning the speed of the TRNG depends on the object that is being measured. |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2014 02:07 AM |
what prng does roblox use? Mersenne?
i'm asian |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2014 02:09 AM |
ya, i just found out that regular Lua uses Mersenne twister so probably roblox lua does too. I really don't know what to use now because each side has it's benefits. I think it's time to play around with TestU01 and take the big choice
i'm asian |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Apr 2014 02:35 AM |
| Rbx.Lua definitely uses what Lua uses, afaik they haven't changed any actual core functions (all of the functions in the math table and stuff like that) |
|
|
| Report Abuse |
|
|