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
 

quick question

Previous Thread :: Next Thread 
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
29 Sep 2015 08:03 PM
this skid thinks we can't identify the difference between a genuine troll and an idiot claiming to be a troll to cover up

seriously, why do you morons try to pull that "I'm trolling" BS anyway?
Report Abuse
IllegallyBlind is not online. IllegallyBlind
Joined: 07 Nov 2010
Total Posts: 1691
29 Sep 2015 08:03 PM
Shhh


cnt is the roast sensei


Instance.new("BodyThrust" , Illegallyblind.Pelvis)
Report Abuse
SlickV is not online. SlickV
Joined: 23 Apr 2015
Total Posts: 78
29 Sep 2015 08:04 PM
I can not see, I'm legally blind.
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
29 Sep 2015 08:50 PM
@OP This isn't really useful, but it does pertain to the original question. In most cases you're perfectly fine using either case you mentioned to seed. Anyways...


There really isn't a difference between one or the other. It's just a different seed as cntkillme said. The con to using time itself as a seed is that the PRNG that roblox uses tends to be biased by the most significant bits of the double passed to it.
*Note: After x iterations of math.random() you will see deviation, that's due to the LSBs of tick(); the MSBs create an initial bias since they change very slowly with respect to time.

What this means is if you seed the PRNG multiple times in a small time frame you'll end up with similar values. While this normally isn't much of an issue it can be appear to be a weird bug when you do rapid testing in play-solo//test server.

A quick way around this to use:
math.randomseed(tick()%1*1e6)

This uses the fractional part of a second (only the least significant bits of time) to seed since they change the most frequently.



Basically try this in commandline:
for i = 1, 300 do
math.randomseed(tick())
print(math.random())
wait()
end

Then try:
for i = 1, 30 do
math.randomseed(tick()%1*1e6)
print(math.random())
wait()
end
Report Abuse
Previous Thread :: Next Thread 
Page 2 of 2Go to page: 1, [2] Prev
 
 
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