the secret about randomized variables

Started by atomburst, June 14, 2008, 11:52:18 pm

Previous topic - Next topic

atomburst

hi i was recently just messing about with randomizing bgm for my maps and i came across something interesting when i was testing. i noticed that the randomizing of variables values does not seem to actually be random at all. there is a tendancy for certain values to be picked more often and others to be picked almost never. of course this could be the randomization but i tested this many many times. i have tried to make the certain background music that wasnt being played very often to play more times. the way i tried doing this was add the same song to 4 different variable values and the rest to only 1 value. yet after testing this i still found that the same songs seemed to be playing and this particular song wasnt being played very often. has anybody else found this? any ways to overcome this?


Starrodkirby86

Any ways to overcome this? Why, make the random values more broad...Set different numbers for Variables. Instead of the random values...0-3, try something like 6-9. Sure, it sounds quite stupid, but it may work. I never seem to get this random problem, but I never was interested in seeing the truth how RPG Maker does the random calculations. But I'm sure that above would work more. ;)

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




Blizzard

The thing is that it's not really random, it's pseudorandom. It works like this: There is a special function which takes the number of seconds past since 1.1.1970 and does a few operations on it. The resulting number seems to be random and the distribution of generated numbers isn't 100% accurate. i.e. in 10000 randomly generated numbers from 1 to 6 the distribution could be like:

1 - 1634
2 - 1678
3 - 1664
4 - 1651
5 - 1687
6 - 1686

The distribution is still alright with a little deviation.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Starrodkirby86

Quote from: Blizzard on June 15, 2008, 07:46:34 am
The thing is that it's not really random, it's pseudorandom. It works like this: There is a special function which takes the number of seconds past since 1.1.1970 and does a few operations on it. The resulting number seems to be random and the distribution of generated numbers isn't 100% accurate. i.e. in 10000 randomly generated numbers from 1 to 6 the distribution could be like:

1 - 1634
2 - 1678
3 - 1664
4 - 1651
5 - 1687
6 - 1686

The distribution is still alright with a little deviation.

Wait...1.1.1970!? Is that January 1st, 1970!? Holy carps, Batman! That's insane...a good majority here aren't born at that time, and I can definitely prove that. Are you even born during that time Blizzard? o.o
And dost thou know what is this random calculation? Algorithm perhaps?

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




Blizzard

June 15, 2008, 01:03:56 pm #4 Last Edit: June 15, 2008, 01:04:30 pm by Blizzard
I suppose that's around the time the first actual OSes were made like DOS and so on. Sadly, I don't know the calculation pattern. I suspect that it can even differ from programming language to programming language.

And no, I was born August 4th, 1986. -_-
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.