The Daily Click ::. Forums ::. General Chat ::. MMF original random generator
 

Post Reply  Post Oekaki 
 

Posted By Message

hapsi



Registered
  13/11/2003
Points
  775
12th August, 2012 at 12/08/2012 13:06:45 -

So i made a quick application to test mmf's random generator. Events of the app are following:
On loop-->Set "red dot" x position to: 320+Random(321)-Random(321) + paste into background (allso y pos is randomly generated)
So basicly it should paste the red dots randomly on the screen (excluding the fact that it pastes(or should paste) more on the center of the screen).

And there seems to be a some sort of pattern.
Image

How does MMF calculate "random" event?

Edited by hapsi

 
[Signature][/Signature]

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
12th August, 2012 at 12/08/2012 14:04:56 -

Is the issue here not the formula you are using to position the dots? Try just using random(screen width) instead.

 
n/a

hapsi



Registered
  13/11/2003
Points
  775
12th August, 2012 at 12/08/2012 14:19:13 -


Originally Posted by lembi2001
Is the issue here not the formula you are using to position the dots? Try just using random(screen width) instead.


I really dont understand a word you are saying. Anyways, i dont have any issue with the MMF random(x) function. I'm just curious how it calculates the randomness. Clearly there is a pattern as seen in the dots. Btw it does the same pattern every time. Intresting..

 
[Signature][/Signature]

hapsi



Registered
  13/11/2003
Points
  775
12th August, 2012 at 12/08/2012 15:49:21 -

Actually a was wrong about the pattern being same every time. Here is 3 screenshots of the app over each other:
Image

But the pattern is still weirdly regular every time.

 
[Signature][/Signature]

monkeytherat

Hero of Time Jr

Registered
  07/11/2010
Points
  1293

VIP MemberI donated an open source project
12th August, 2012 at 12/08/2012 16:35:51 -

Well there certainly is no pattern here: http://www.mediafire.com/?1122iv8k67l6f3c

 
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

nim



Registered
  17/05/2002
Points
  7234
12th August, 2012 at 12/08/2012 17:24:07 -

I get straight lines, too.

 
//

Fifth

Quadruped

Registered
  07/05/2003
Points
  5818

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
12th August, 2012 at 12/08/2012 19:19:04 -

Yeah, it's true. Use the built-in random() enough and it'll start to repeat itself. Obvious when you plot it to the screen as you did.

If it's something that would be a problem for you, just use the Randomizer Object. It does a much better job at randomness.

 
Go Moon!

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
12th August, 2012 at 12/08/2012 20:51:54 -

Yes it's been established multiple times that MMF's built in randomize is not truly "random" but neither is any other randomizing algorithm.

I can't remember the exact algorithm that MMF uses, someone posted a link to the Wikipedia article on it a while back.

But as Fifth said just use the randomizer object, it's much better. For most purposes MMF's built-in randomizer is fine.

 
n/a

monkeytherat

Hero of Time Jr

Registered
  07/11/2010
Points
  1293

VIP MemberI donated an open source project
12th August, 2012 at 12/08/2012 22:06:59 -

Perhaps it would do clickteam well to investigate into Mersenne Twister randoms?

 
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
13th August, 2012 at 13/08/2012 05:27:59 -

Clickteam is aware of other options. It's been mentioned countless times. I don't remember what their excuse for it was though.

 
n/a

hapsi



Registered
  13/11/2003
Points
  775
13th August, 2012 at 13/08/2012 10:35:44 -

This is with Randomizer object:
Image

Thats how it is supposed to be..

 
[Signature][/Signature]

jamesh



Registered
  28/02/2012 15:24:25
Points
  381
17th August, 2012 at 17/08/2012 12:07:44 -

A very clever experiment!

 
n/a

hapsi



Registered
  13/11/2003
Points
  775
18th August, 2012 at 18/08/2012 21:51:06 -


Originally Posted by jamesh
A very clever experiment!


When you build an application with a klik software, there is very much expiriments in coding(have to do it constantly).. This example is just one of a billionth that were published. Klik softwares have a large scale of usefull(or harmfull) features unknown to the most of the klikkers. I wish people would share the grievances to the klik community the way i did (once>P).

Ps. dont know if your message is sarcasm.

 
[Signature][/Signature]

chrilley

Insane Beaver

Registered
  05/01/2002
Points
  704

Game of the Week WinnerVIP Member360 Owner
18th August, 2012 at 18/08/2012 22:31:07 -

I asked about this exact same thing back in 2007 on Clickteam's forums. This is just the way their random function works. It generates a bank and runs through the numbers, once reaching the end it'll loop the same thing again.

One method to avoid this without using an extension;


Originally Posted by DavidN on Clickteam's Old Forums

To get a more 'random' pattern, you need something to generate random numbers from - for example, use a Date and Time object in the frame, and Randomize (under "Special") with the value of its seconds every time a second passes.



 
Image

Jenswa

Possibly Insane

Registered
  26/08/2002
Points
  2723
19th August, 2012 at 19/08/2012 15:42:00 -

Nice example, the pic of the starting post certainly looks like some kind of wave.

My first random functions were also just lists of numbers to go through, not exactly random and every time the same row of numbers. But that was a good thing for debugging my other code.

Nice way to overcome this limitation, you might added pressed keystrokes since application start and mouse movements along with that for more 'randomness'.

 
Image jenswa.neocities.org
   

Post Reply



 



Advertisement

Worth A Click