generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Heeeellp

Previous Thread :: Next Thread 
loleris is not online. loleris
Joined: 23 Feb 2009
Total Posts: 1610
28 May 2013 07:07 AM
So... I'm need of some sort random or not so random function for generating binary chaos from 3 variables: x and y coordinates and the seed.

...And I have no knowledge about random theories at all...

This is something I've tried to make right now:

function BinaryChaos(x, y, seed)
return math.floor(math.abs(math.sin(((x * (0.5486 + seed)) - (y * (0.7872 + seed))))) + 0.5)
end

Output:
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
0
1
1
1
1
1

Basically, it only has to return 1 or 0 from those three variables. The main rule is that the same variables have to return the same binary value all the time.

Help?
Report Abuse
loleris is not online. loleris
Joined: 23 Feb 2009
Total Posts: 1610
28 May 2013 07:11 AM
Last time I made something working:

function chaos(x,y,seed)
x = x+10
y = y+10
seed = seed+10
while pos(x) >= 10 do
x = x*0.43786
end
while pos(y) >= 10 do
y = y*0.57348
end
while pos(seed) >= 10 do
seed = seed*0.47569
end
gen = math.sqrt(pos(x+y+seed)*33)
return round(gen-math.floor(gen))
end

But it's REALLY slow.
Report Abuse
loleris is not online. loleris
Joined: 23 Feb 2009
Total Posts: 1610
28 May 2013 07:13 AM
I cleaned up the old version to work normally

function chaos(x,y,seed)
x = x+10
y = y+10
seed = seed+10
while math.abs(x) >= 10 do
x = x*0.43786
end
while math.abs(y) >= 10 do
y = y*0.57348
end
while math.abs(seed) >= 10 do
seed = seed*0.47569
end
gen = math.sqrt(math.abs(x+y+seed)*33)
return math.floor((gen-math.floor(gen))+0.5)
end
Report Abuse
loleris is not online. loleris
Joined: 23 Feb 2009
Total Posts: 1610
28 May 2013 07:14 AM
The output of the older chaos function:

1
1
0
1
1
0
1
0
0
1
0
1
0
0
0
1
0
0
1
0
0
1
0
Report Abuse
loleris is not online. loleris
Joined: 23 Feb 2009
Total Posts: 1610
28 May 2013 07:29 AM
...Just created a 2D image of my old chaos function... It's not chaotic at all ._.
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
28 May 2013 07:34 AM
> "Not so random" > Perlin Noise?

Also, try looking up this kind of thing on WIkipedia.
Report Abuse
loleris is not online. loleris
Joined: 23 Feb 2009
Total Posts: 1610
28 May 2013 07:36 AM
I asked only for a binary noise.
Report Abuse
loleris is not online. loleris
Joined: 23 Feb 2009
Total Posts: 1610
28 May 2013 07:46 AM
...Maybe it's impossible to make that function ._.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image