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

Post Reply  Post Oekaki 
 

Posted By Message

hapsi



Registered
  11/13/2003
Points
  665
12th August, 2012 at 8/12/2012 1:06:45 PM -

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
  4/1/2005
Points
  565

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

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

 
Image

hapsi



Registered
  11/13/2003
Points
  665
12th August, 2012 at 8/12/2012 2:19:13 PM -


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
  11/13/2003
Points
  665
12th August, 2012 at 8/12/2012 3:49:21 PM -

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
  11/7/2010
Points
  1287

VIP MemberI donated an open source project
12th August, 2012 at 8/12/2012 4:35:51 PM -

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
  5/17/2002
Points
  7049
12th August, 2012 at 8/12/2012 5:24:07 PM -

I get straight lines, too.

 
//

Fifth

Quadruped

Registered
  5/7/2003
Points
  5494

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNER
12th August, 2012 at 8/12/2012 7:19:04 PM -

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-

Professor Spectrum

Registered
  7/7/2008
Points
  6121

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 Fool
12th August, 2012 at 8/12/2012 8:51:54 PM -

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.

 
http://www.soapcow.com <- Flash games, featuring MMF made games!
http://www.jsoftgames.com <- Old blog I don't keep up anymore

monkeytherat

Hero of Time Jr

Registered
  11/7/2010
Points
  1287

VIP MemberI donated an open source project
12th August, 2012 at 8/12/2012 10:06:59 PM -

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-

Professor Spectrum

Registered
  7/7/2008
Points
  6121

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 Fool
13th August, 2012 at 8/13/2012 5:27:59 AM -

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

 
http://www.soapcow.com <- Flash games, featuring MMF made games!
http://www.jsoftgames.com <- Old blog I don't keep up anymore

hapsi



Registered
  11/13/2003
Points
  665
13th August, 2012 at 8/13/2012 10:35:44 AM -

This is with Randomizer object:
Image

Thats how it is supposed to be..

 
[Signature][/Signature]

jamesh



Registered
  2/28/2012 3:24:25 PM
Points
  380
17th August, 2012 at 8/17/2012 12:07:44 PM -

A very clever experiment!

 
n/a

hapsi



Registered
  11/13/2003
Points
  665
18th August, 2012 at 8/18/2012 9:51:06 PM -


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
  1/5/2002
Points
  704

Game of the Week WinnerVIP Member360 Owner
18th August, 2012 at 8/18/2012 10:31:07 PM -

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
  8/26/2002
Points
  2217
19th August, 2012 at 8/19/2012 3:42:00 PM -

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'.

 
Check out DTV Boxes http://ow.ly/k13fh (work in progress)
Download hh_beer.zip from http://ge.tt/4d07kPc/v/0 and hhxl.zip from http://ge.tt/3kbXlPc/v/0
   

Post Reply



 



Advertisement

Worth A Click