Page 1 of 1

Question on Universe.m

Posted: Mon Oct 05, 2009 7:47 am
by treczoks
Hi!

I hope this is the right place to ask...

I'm working on a Wiki Galaxy Guide (shameless plug) and for this project to work I need to reimplement some algorithms (in perl) that describe the Oolite Universe.

I gathered a lot of information (all the basics) from TXTELITE.C, but there are some extensions to that in Oolite which I need to understand.

My focus is legacy_random.c (which I groked) and Universe.m (which escapes me, as I can't read Objective C fluently enough).

I've Oolite-1.73.4/src/Core/Universe.m as a base:

In line 894 it starts setting up "Space", which looks like generating info on a system.

In line 924 it says: seed_for_planet_description(system_seed);
Is this system_seed the same "goatsoup seed" (as Ian Bell names it), derived from W1 and W2 that is used to create the description texts ("Lave is most famous..." etc)? Or is this somehow a (W0/W1/W2) tuple for this system? I sincerely hope this is not something entirely alien...

Could anybody out there create and publish a list of these seeds and the resulting sun size, sun colour, planet distance, station type for the systems in the first universe (I don't know wether you count starting at 0 or 1, therefor the first=the one containing Lave), so I can verify the implementation of my algorithms? It is difficult to verify parameters like "sun radius" by flying into a system and applying a tape measure ;-)

Are there any caveats I could stumble in (like subroutines gobbling up random numbers)?

Yours, Christian Treczoks

Re: Question on Universe.m

Posted: Mon Oct 05, 2009 9:57 am
by pmw57
treczoks wrote:
Could anybody out there create and publish a list of these seeds and the resulting sun size, sun colour, planet distance, station type for the systems in the first universe (I don't know wether you count starting at 0 or 1, therefor the first=the one containing Lave), so I can verify the implementation of my algorithms? It is difficult to verify parameters like "sun radius" by flying into a system and applying a tape measure ;-)
But you already have a tape measure.

Get the debug console up and going, and use the following to find out the radius of the sun.

system.sun.radius

See: http://wiki.alioth.net/index.php/Oolite ... rence:_Sun

Edit: radius() updated to radius - thanks Kaks

Re: Question on Universe.m

Posted: Mon Oct 05, 2009 10:38 am
by treczoks
pmw57 wrote:
But you already have a tape measure.

Get the debug console up and going, and use the following to find out the radius of the sun.

system.sun.radius()

See: http://wiki.alioth.net/index.php/Oolite ... rence:_Sun
OK, I did not know about this console (thanks for the info!), but even more thanks for pointing me to that documentation - it tells me that one can dump some information on the current Universe by pressing "!" on the long range screen. That might be exactly what I would need here...

Yours, Christian Treczoks

Posted: Mon Oct 05, 2009 10:42 am
by Kaks
Minor point: to find out the radius you need to type

Code: Select all

system.sun.radius
What you typed above

Code: Select all

system.sun.radius()
doesn't exist.

(the first is a property, the second looks like a function, but isn't...)

Re: Question on Universe.m

Posted: Mon Oct 05, 2009 7:52 pm
by JensAyton
treczoks wrote:
In line 924 it says: seed_for_planet_description(system_seed);
Is this system_seed the same "goatsoup seed" (as Ian Bell names it), derived from W1 and W2 that is used to create the description texts ("Lave is most famous..." etc)? Or is this somehow a (W0/W1/W2) tuple for this system? I sincerely hope this is not something entirely alien...
Unless Giles happens to wander by, no-one around here actually knows.
treczoks wrote:
Are there any caveats I could stumble in (like subroutines gobbling up random numbers)?
Oh yes, definitely.

Re: Question on Universe.m

Posted: Mon Oct 05, 2009 9:56 pm
by treczoks
Ahruman wrote:
Unless Giles happens to wander by, no-one around here actually knows.
Why do I have the feeling that this does not sound THAT good? Let me guess: This "Giles" guy is the ONE BIG CREATOR, he left the project and nobody but him knows the internals of the code?
Ahruman wrote:
treczoks wrote:
Are there any caveats I could stumble in (like subroutines gobbling up random numbers)?
Oh yes, definitely.
Hey, don't raise the hopes too high...

Looks like I've got to dig for the data all by my little self.

Oh my...

Yours, Christian Treczoks

Posted: Mon Oct 05, 2009 10:09 pm
by Cmdr James
Giles is the One Big Creator, however that doesnt mean noone else understands the code, it just means that some questions cannot easily be answered.

Typically what does the code do if possible to understand, why is not always obvious. But there are some key devs like Ahruman who seem to be able to understand just about everything.

Posted: Tue Oct 06, 2009 6:51 am
by Diziet Sma
And Giles does occasionally drop in, albeit briefly.. (he was here a few days ago, in fact) if you see "aegidian" listed as online, that's him...

Re: Question on Universe.m

Posted: Fri Dec 04, 2009 8:32 am
by Dr Beeb
treczoks wrote:
Hi!

Are there any caveats I could stumble in (like subroutines gobbling up random numbers)?

Yours, Christian Treczoks
Oh yes. I discuss some of that here:
http://wiki.alioth.net/index.php/Random ... _generator

To answer your question I pulled some lines of interest and hopefully my comments will make sense to you

Code: Select all

seed_for_planet_description(system_seed); // reset 
 
planet_zpos = (12.0 + (Ranrot() & 3) - (Ranrot() & 3) ) * planet_radius; // 10..14 pr (planet radii) ahead

seed_for_planet_description(system_seed); // reset 

sun_distance = (sunDistanceModifier + (Ranrot() % 5) - (Ranrot() % 5) ) * planet_radius;
sun_radius = (2.5 + randf() - randf() ) * planet_radius;


// reset : load up 4-byte goat seed from W1&W2 and flatten into seed sRANROT
// Ranrot defined in legacy_random.c, it performs operations on seed sRANROT to make it a new random number
// randf pulls out a value in range 0:1 from Ranrot
The Elite 'goat-seed' gets reset each time (to W1,W2) before being used for sun/planet/sky hue info in Oolite. The Ranrot function may be specific to Oolite and is a 'third' way to manipulate the seed not covered in Ian Bell's C code that you refer to. I dont know if Elite also used this third method for the sun radius/distance to planet, or whether it used the W0,W1,W2 bits in some other way.

Although the above indicates how sun_distance is chosen, the final position of the sun is complicated by how close it is to witch-point etc., the code gets quite complicated.

Posted: Fri Dec 04, 2009 10:00 am
by Eric Walch
When you only want to know all this to calculate all system parameters without the need of selecting all the systems in oolite itself, you can use the console.
e.g. the line:

Code: Select all

for (var i=0; i<26; i++) log("system "+i+" : "+ System.infoForSystem(galaxyNumber, i).description);
Gives you as output:

Code: Select all

system 0 : This planet is most notable for Tibediedian Arma brandy but scourged by deadly edible grubs.
system 1 : Qube is reasonably well known for its great dense forests but scourged by deadly civil war.
system 2 : The world Leleer is very noted for its pink Leleerian Er plant plantations but beset by frequent civil war.
system 3 : This world is very fabled for the Biargeian edible poet.
system 4 : The world Xequerin is  fabled for its weird volcanoes and the Xequerinian mountain lobstoid.
system 5 : Tiraor is a revolting little planet.
system 6 : The planet Rabedira is  well known for its inhabitants’ ancient loathing of sit coms but ravaged by dreadful civil war.
system 7 : Lave is most famous for its vast rain forests and the Laveian tree grub.
system 8 : This planet is mildly noted for the Zaatxeian deadly Ouenbeoid but plagued by lethal spotted craboids.
system 9 : This planet is mildly fabled for its inhabitants’ eccentric love for tourists but beset by deadly edible moths.
system 10 : Teaatis is mildly well known for Teaatisian vicious brew.
system 11 : This world is mildly famous for its vast rain forests and the Riinusian tree grub.
system 12 : The planet Esbiza is most famous for its vast rain forests.
system 13 : This planet is reasonably famous for its inhabitants’ exceptional love for food blenders.
system 14 : This world is most notable for its fabulous Cebetelaian lethal brandy but scourged by killer mountain Esbionoids.
system 15 : This planet is most fabled for its inhabitants' ingrained silliness but scourged by deadly civil war.  This system is home to Navy Sector Command 14.
system 16 : The planet Rizala is mildly notable for Rizalaian lethal brandy.
system 17 : Atriso is mildly well known for its exotic cuisine and its inhabitants’ ingrained silliness.
system 18 : This planet is plagued by frequent earthquakes.
system 19 : The planet Azaqu is most famous for its pink oceans and Zero-G cricket.
system 20 : This world is ravaged by occasional solar activity.
system 21 : The planet Sotiqu is  famous for its exotic goat soup but ravaged by killer disease.
system 22 : The world Inleus is most famous for the Inleusian spotted wolf.
system 23 : The world Onrira is mildly noted for the Onriraian deadly Esonatoid but plagued by lethal spotted yaks.
system 24 : This planet is most notable for vicious Inzalodi gargle blasters but scourged by unpredictable earthquakes.  This system is home to Navy Sector Command 1.
system 25 : The planet Biisza is most famous for its vast rain forests.
And this can be achieved for all the systemInfo parameters.