ninja5566
|
  |
| Joined: 14 Jan 2009 |
| Total Posts: 5233 |
|
|
| 02 May 2014 12:48 PM |
A lot of the professional scripters say that it's not actually random, they said you should use getAsync on a website called "Random", is this true?
|
|
|
| Report Abuse |
|
|
zbaddude2
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 1897 |
|
|
| 02 May 2014 12:54 PM |
| Yes binary computers are actually incapable of giving completely random results. Only quantum computers can do this. |
|
|
| Report Abuse |
|
|
ninja5566
|
  |
| Joined: 14 Jan 2009 |
| Total Posts: 5233 |
|
| |
|
stravant
|
  |
 |
| Joined: 22 Oct 2007 |
| Total Posts: 2893 |
|
|
| 02 May 2014 01:13 PM |
"they said you should use getAsync on a website called "Random", is this true?"
They are wrong, you should absolutely not be going to such lengths as using Random.org for your number generation. math.random is very much "random enough" for whatever you want to use it for on Roblox.
Yes, it's a pseudo-random number generator, meaning that you can predict it if you know how it's implemented and seeded, but unless you really care about someone who put in many hours of work being able to reverse engineer what "random" poker hands their opponents have been dealt in a poker game then you don't need to worry about math.random not being "random enough". |
|
|
| Report Abuse |
|
|
|
| 02 May 2014 02:00 PM |
Seeding with tick() or some other simple non-deterministic time (perhaps of execution rather than clock) is more than sufficient even, really, for many crypto purposes.
Doing calls to a web service is completely unnecessary.
Besides all of this, you don't need true randomness for a ROBLOX game. The only things that need it are cryptographic solutions and fair casino / tournament generation schemes, and even then the more important thing is generation method rather than seed. |
|
|
| Report Abuse |
|
|
|
| 02 May 2014 09:41 PM |
| technically nothing can be random right? everything has a cause and effect and you can predict that effect if you have enough info about the cause. |
|
|
| Report Abuse |
|
|
zbaddude2
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 1897 |
|
|
| 02 May 2014 09:43 PM |
| No quantum computers can generate truly random numbers. |
|
|
| Report Abuse |
|
|
Maroy
|
  |
| Joined: 15 Mar 2009 |
| Total Posts: 59 |
|
|
| 02 May 2014 10:56 PM |
| Quantum mechanics rely on probability, though, so even then it's still biased randomness. |
|
|
| Report Abuse |
|
|
|
| 03 May 2014 12:46 AM |
| So what if you did math.randomseed(math.random())? |
|
|
| Report Abuse |
|
|
MettaurSp
|
  |
| Joined: 20 Mar 2010 |
| Total Posts: 3179 |
|
|
| 03 May 2014 12:49 AM |
| It still wouldn't be entirely random because there still is a seed that is used in setting the seed. |
|
|
| Report Abuse |
|
|
| |
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
|
| 03 May 2014 07:03 AM |
It's funny, because people think that it will get more random the more you seed. This is completely false. In fact, it's so false that it's actually the opposite. It will get LESS random, the more you seed. The way to do it properly is this:
math.randomseed(os.time()) math.random() math.random() math.random()
You just seed the time, and then you call math.random 3 times, because you will find that there are these patterns right after you seed. So if you seed 5, call random, you might get a very similar number to if you seed 10 and call random. But after about 3 calls, that "pattern" disappears. |
|
|
| Report Abuse |
|
|
|
| 03 May 2014 02:41 PM |
Here is the source code for math.random if anyone is interested hurr durr
static int math_random (lua_State *L) { /* the `%' avoids the (rare) case of r==1, and is needed also because on some systems (SunOS!) `rand()' may return a value larger than RAND_MAX */ lua_Number r = (lua_Number)(rand()%RAND_MAX) / (lua_Number)RAND_MAX; switch (lua_gettop(L)) { /* check number of arguments */ case 0: { /* no arguments */ lua_pushnumber(L, r); /* Number between 0 and 1 */ break; } case 1: { /* only upper limit */ int u = luaL_checkint(L, 1); luaL_argcheck(L, 1<=u, 1, "interval is empty"); lua_pushnumber(L, floor(r*u)+1); /* int between 1 and `u' */ break; } case 2: { /* lower and upper limits */ int l = luaL_checkint(L, 1); int u = luaL_checkint(L, 2); luaL_argcheck(L, l<=u, 2, "interval is empty"); lua_pushnumber(L, floor(r*(u-l+1))+l); /* int between `l' and `u' */ break; } default: return luaL_error(L, "wrong number of arguments"); } return 1; } |
|
|
| Report Abuse |
|
|