seed = "1 2 3 4 5 6";

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

seed = "1 2 3 4 5 6";

Post 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.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2882
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post 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).
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

So, who would know? Or where did you get it from? (And yes, I am using textures.)
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2882
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post 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.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post 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.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post 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? ;-)
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post 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?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

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