Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-04-2003, 04:02 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Non-Random Random()?

If I call random() lots of times within a single frame then all the numbers seem completely random, which is what we'd expect. But if it is called once per timeout then a pattern starts to emerge. The attached level shows the phenomenon.
Attached Files
File Type: nw test.nw (9.6 KB, 148 views)
__________________
Reply With Quote
  #2  
Old 05-04-2003, 04:11 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
Yes, i've noticed that too.

When I was making my fireworks script everything was based on random. And sometimes they'd go in the same direction every single time. same color same spread pattern.

Well actually I think that was in a for loop, but aw well.

Im not really noticing the pattern in your example.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #3  
Old 05-04-2003, 04:16 AM
VeX_RaT_Boy VeX_RaT_Boy is offline
WannaBe Scripter
VeX_RaT_Boy's Avatar
Join Date: Aug 2002
Location: Norway
Posts: 960
VeX_RaT_Boy is on a distinguished road
Send a message via ICQ to VeX_RaT_Boy Send a message via AIM to VeX_RaT_Boy Send a message via Yahoo to VeX_RaT_Boy
Yes, it is a pain when you try to make something RANDOM, it happens ALOT even if the random is up in hundreds :grrr:
__________________
-Kjetil Valen
Reply With Quote
  #4  
Old 05-04-2003, 08:17 AM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
Quote:
Originally posted by adam
Im not really noticing the pattern in your example.
Here, I did the top half for you :x
Attached Thumbnails
Click image for larger version

Name:	random2.gif
Views:	164
Size:	25.9 KB
ID:	23687  
__________________

Reply With Quote
  #5  
Old 05-04-2003, 10:01 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
I found the pattern!


resize screen to graph to your liking

say redo [size]

to redo the pattern finder from a different size sample.

It's strange. The pattern does repeat the same everytime.
Attached Files
File Type: nw test.nw (10.9 KB, 128 views)
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #6  
Old 05-04-2003, 08:14 PM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
Quote:
Originally posted by adam
I found the pattern!


resize screen to graph to your liking

say redo [size]

to redo the pattern finder from a different size sample.

It's strange. The pattern does repeat the same everytime.
with how kai explained it to me (don't kill me), it just ended at a certain point in the cycle (300), when you start the level again, it starts at a different point in the cycle, but it still goes through it (you still see some distinct peaks)
__________________

Reply With Quote
  #7  
Old 05-04-2003, 11:19 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
Quote:
Originally posted by CheeToS2


with how kai explained it to me (don't kill me), it just ended at a certain point in the cycle (300), when you start the level again, it starts at a different point in the cycle, but it still goes through it (you still see some distinct peaks)
Strange indeed....
Would have to expand on the script there to see that part....


Im not seeing it ever start being random... except the first little bit....

Oh, nevermind, I know what he was saying to you. Well anyhow here's a script that doesn't stop with the randoms it just keeps going. yes kia's does stop.
Attached Files
File Type: nw test.nw (9.6 KB, 128 views)
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly

Last edited by adam; 05-04-2003 at 11:30 PM..
Reply With Quote
  #8  
Old 05-09-2003, 07:49 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
This should really be fixed sooner rather than later, it could totally ruin anything that uses random().

Like being hit on 2k2. surely most o fyou have noticed when they hit or when they miss . they do it a lot. they hit every time or this miss every time...
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #9  
Old 05-09-2003, 09:09 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
It's not likely to be a problem in most scripts. I doubt that it has any adverse effect on G2K2's systems (especially since they use a serverside random function, which works better).
__________________
Reply With Quote
  #10  
Old 05-09-2003, 01:20 PM
Soul-Blade Soul-Blade is offline
US Marine
Soul-Blade's Avatar
Join Date: Jul 2001
Location: Coeur d'Alene, ID
Posts: 945
Soul-Blade is an unknown quantity at this point
Send a message via AIM to Soul-Blade
Yes, well the way I believe random works, is it gets some number built into the system, which actually is entirely systematic (as opposed to random), but changes so fast the normal user does not notice.

I read that somewhere in my readings of programming.
Reply With Quote
  #11  
Old 05-09-2003, 05:12 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
Quote:
Originally posted by Soul-Blade
Yes, well the way I believe random works, is it gets some number built into the system, which actually is entirely systematic (as opposed to random), but changes so fast the normal user does not notice.

I read that somewhere in my readings of programming.
Yeah, but the problem is when accessed at regular intervals (say once every 0.05 seconds) it is predictable.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #12  
Old 05-09-2003, 05:43 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Soul-Blade
Yes, well the way I believe random works, is it gets some number built into the system, which actually is entirely systematic (as opposed to random), but changes so fast the normal user does not notice.
Often the system tick count is used with some hashing algorithm, but sometimes a list of random numbers is created via an algorithm that takes a initialisation seed (though this seed is, again, usually taken from the clock). It would seem that Graal uses the latter.
__________________
Reply With Quote
  #13  
Old 05-10-2003, 11:00 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
Quote:
Originally posted by adam
This should really be fixed sooner rather than later, it could totally ruin anything that uses random().

Like being hit on 2k2. surely most o fyou have noticed when they hit or when they miss . they do it a lot. they hit every time or this miss every time...
Or how you almost always get 2 shell bomies in a row.

Yeah, there's no such thing as true random, only a complex algorythm based off the timer.
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #14  
Old 05-10-2003, 12:30 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
Quote:
Originally posted by Tyhm


Or how you almost always get 2 shell bomies in a row.

Yeah, there's no such thing as true random, only a complex algorythm based off the timer.
Could try basing it on some outside influence, like keyboard strokes. The weather outside, the movements of little critters in cages, stuff.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #15  
Old 05-10-2003, 03:23 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by adam
Could try basing it on some outside influence, like keyboard strokes. The weather outside, the movements of little critters in cages, stuff.
Why? The timer is sufficient.
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:22 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.