Question on Universe.m
Moderators: winston, another_commander
Question on Universe.m
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
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
-
- ---- E L I T E ----
- Posts: 389
- Joined: Sat Sep 26, 2009 2:14 pm
- Location: Christchurch, New Zealand
Re: Question on Universe.m
But you already have a tape measure.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
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
Last edited by pmw57 on Mon Oct 05, 2009 10:45 am, edited 2 times in total.
A trumble a day keeps the doctor away, and the tax man;
even the Grim Reaper keeps his distance.
-- Paul Wilkins
even the Grim Reaper keeps his distance.
-- Paul Wilkins
Re: Question on Universe.m
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...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
Yours, Christian Treczoks
Minor point: to find out the radius you need to type
What you typed above
doesn't exist.
(the first is a property, the second looks like a function, but isn't...)
Code: Select all
system.sun.radius
Code: Select all
system.sun.radius()
(the first is a property, the second looks like a function, but isn't...)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Re: Question on Universe.m
Unless Giles happens to wander by, no-one around here actually knows.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...
Oh yes, definitely.treczoks wrote:Are there any caveats I could stumble in (like subroutines gobbling up random numbers)?
E-mail: [email protected]
Re: Question on Universe.m
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:Unless Giles happens to wander by, no-one around here actually knows.
Hey, don't raise the hopes too high...Ahruman wrote:Oh yes, definitely.treczoks wrote:Are there any caveats I could stumble in (like subroutines gobbling up random numbers)?
Looks like I've got to dig for the data all by my little self.
Oh my...
Yours, Christian Treczoks
- Cmdr James
- Commodore
- Posts: 1357
- Joined: Tue Jun 05, 2007 10:43 pm
- Location: Berlin
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.
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.
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
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...
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
- Dr Beeb
- Dangerous
- Posts: 127
- Joined: Sun Mar 23, 2008 10:28 pm
- Location: Mt. Vista, Oosa, Biarge System, Galaxy 1
Re: Question on Universe.m
Oh yes. I discuss some of that here:treczoks wrote:Hi!
Are there any caveats I could stumble in (like subroutines gobbling up random numbers)?
Yours, Christian Treczoks
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
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.
White dots were so much easier to hit
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
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:
Gives you as output:
And this can be achieved for all the systemInfo parameters.
e.g. the line:
Code: Select all
for (var i=0; i<26; i++) log("system "+i+" : "+ System.infoForSystem(galaxyNumber, i).description);
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.
UPS-Courier & DeepSpacePirates & others at the box and some older versions