Page 1 of 1

seed = "1 2 3 4 5 6";

Posted: Tue Sep 04, 2007 2:45 pm
by Commander McLane
I am experimenting with putting planets into a system. I have copied shamelessly the planetinfo.plist from Assassins. There is a

Code: Select all

seed = "1 2 3 4 5 6";
for every planet defined in the plist. I'm interested. What does it do? It's not documented in the wiki.

Posted: Tue Sep 04, 2007 3:06 pm
by LittleBear
I don't know either! I think it possibly effects the colours of the planet (if you wern't doing this with a texture, but we using the percentage land etc).

Posted: Tue Sep 04, 2007 3:17 pm
by Commander McLane
So, who would know? Or where did you get it from? (And yes, I am using textures.)

Posted: Tue Sep 04, 2007 3:41 pm
by LittleBear
I copied it in turn from Murgh's Diso OXP. :wink: He wasn't using textures for his planets, so maybe it does have an effect in Diso.

Posted: Tue Sep 04, 2007 4:28 pm
by Eric Walch
I looked into the source:

planet_seed = p_seed.a * 7 + p_seed.c * 11 + p_seed.e * 13; // pseudo-random set-up for vertex colours

According to Giles his comment, he uses it to set op the colors as you already thought.
I think he also uses it to generate a random planet description. But all these random values are only used if there are no explicit values defined by the script. So dont bother about these seeds if thing work already.

Posted: Tue Sep 04, 2007 6:57 pm
by JensAyton
A pseudo-random number generator (PRNG) is a function which returns a hard-to-predict value given a seed. Normally, the seed is set so something arbitrary when a program starts (for instance, the current time in microseconds since the computer started), and each call to the pseudo-random number uses its result as the next seed. For instance, if we used a very bad PRNG, f(x) = x + 1, and an initial seed of 42, the first call would generate the “random” value 43, and also set the seed to 43. The next call would thus result in a different value.

In the case of Oolite, a pseudo-random number generator is used to generate the same data repeatedly – for instance, the same planet appearance each time you enter a given system. To do this, Oolite starts by resetting the seed to a function of the galaxy number and planet number each time you enter the system.

In order to generate additional planets randomly in a system, a different seed value must be used for each one. This is what the seed attribute in planetInfo.plist is for. It consists of six numbers between 1 and 255.

Since you can’t change all attributes of a planet in planetInfo.plist (for instance, you currently can’t modify the atmosphere, and new attributes might be added in the future) it’s good practice to make up a new seed for each planet. If you don’t feel very creative, try this amazing Web 2.0 app. Good thing I’ve been having to learn JavaScript, eh? ;-)

Posted: Wed Sep 05, 2007 9:29 am
by Commander McLane
Thanks again for your answers. :D

All of this for me finally translates into: If I set up two textured planets with no atmosphere (addMoon:) at specific places in a system (which is what I am doing), I don't need a seed at all. Correct?

Posted: Wed Sep 05, 2007 12:10 pm
by JensAyton
Not correct. As I said, it’s possible new features will be added to the planet model, in which case they will probably use the seed to determine default values.