Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   Non-Random Random()? (https://forums.graalonline.com/forums/showthread.php?t=44692)

Kaimetsu 05-04-2003 04:02 AM

Non-Random Random()?
 
1 Attachment(s)
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.

adam 05-04-2003 04:11 AM

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.

VeX_RaT_Boy 05-04-2003 04:16 AM

Yes, it is a pain when you try to make something RANDOM, it happens ALOT even if the random is up in hundreds :grrr:

CheeToS2 05-04-2003 08:17 AM

1 Attachment(s)
Quote:

Originally posted by adam
Im not really noticing the pattern in your example.
Here, I did the top half for you :x

adam 05-04-2003 10:01 AM

1 Attachment(s)
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.

CheeToS2 05-04-2003 08:14 PM

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)

adam 05-04-2003 11:19 PM

1 Attachment(s)
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.

adam 05-09-2003 07:49 AM

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

Kaimetsu 05-09-2003 09:09 AM

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

Soul-Blade 05-09-2003 01:20 PM

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.

adam 05-09-2003 05:12 PM

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.

Kaimetsu 05-09-2003 05:43 PM

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.

Tyhm 05-10-2003 11:00 AM

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.

adam 05-10-2003 12:30 PM

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. ;)

Kaimetsu 05-10-2003 03:23 PM

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.


All times are GMT +2. The time now is 04:51 PM.

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