Random isn't random
aliz94
Member, PRO Posts: 19
I have an attribute change to random(1,2) and it determines what actor is spawned. The same pattern of actors appears each time. It goes 1,2,1,2,1,2,etc it never does for example 1,1,1,2,1,2,2 being really random.
Comments
Hello @aliz94 How are you triggering the random change - with a Timer set to Every, for instance?
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
What I usually do is make a attribute tester button as attached, just so you can see what's going on. What attribute type are you using?
https://www.dropbox.com/sh/xq0dgrc9y4654qy/AAA3WrN1whhx8_PEPuvKP2e4a
Testing the attribute is good, as @revoltandreverb suggests
My question about the Timer set to Every concerns the fact that you wouldn't see anything other than 1,2,1,2 in a Display Text behaviour set to the single attribute showing the randoms.
Because (the following explanation based on showing results via a Timer as described): say there were two or three "1"s in a row, it would still show as 1. When changing to 2, similarly, not seeming to change no matter how many repeats of 2, until a 1 is chosen again; and so on.
So here's my test file as well to show you what I mean:
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Works fine for me too . . .
Although this is almost certainly not the issue it's worth pointing out, even if just for the maths pedants out there . . . aliz94's first example sequence 1, 2, 1, 2, 1, 2 is every bit as random as his second example sequence 1, 1, 1, 2, 1, 2 - both are as likely to be produced in a truly random system (both sequences have a 1/64 chance of occurring) . . . . and, counterintuitively, if you were to run the random sequence generator a thousand times and each time you got the same 1, 2, 1, 2, 1, 2 sequence then there is nothing about this result that should make you think the random sequence generator is not truly random - as the likelihood of 1, 2, 1, 2, 1, 2 turning up every time you run the random sequence generator is no less or no more than the likelihood of any other series of results.
I am.
Is there any way to make this work with every 0 seconds?
Hi @aliz94
sure it is - although the random numbers generated would be so fast not sure how useful it'd be visually nor, I suspect, would the resulting very fast stream of random 1's and 2's be much use for anything...
(Unless you're "collecting them" for use somewhere in your game, but if you're wanting to do that, you'd put one of the few ways into your Rules to stop it generating after a set time so as to utilise the total output).
Unless i'm missing something... what are you using these random series of 1's and 2's for, can I ask?
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Can I ask how though? How would I make it change every 0 seconds and truly be random?
Hi @aliz94 Try the following, easy to change:
Download the test file I showed in the post above (if you haven't already), and simply change the Timer in the black square actor to Every 0 seconds. (then after you've seen what to do, apply that simple change to your own game file).
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps