Page 1 of 1

Slower planet rotation?

Posted: Sat Jun 01, 2024 11:56 pm
by Cholmondely
This was published on Reddit a couple of days ago by "BicornisGoat":
Is there an OXP out there that slows in-game planet rotation down to something more realistic? I like using the Planetfall OXP to land on the planets and it's a little immersion-breaking to see the landscape zooming past during approach.

I don't think that anybody has done anything like this yet.

But I notice on the Planetinfo.plist wiki page the ability to play around with

Rotational Velocity
A number describing the rotational velocity of the planet in radians per second. Overrides rotation_speed if both are set.
Example:
"rotational_velocity" = 0.0015;


Rotation Speed
A number describing the rotational velocity of the planet in radians per second. Unlike rotational_velocity, this is affected by rotation_speed_factor.
Example:
"rotation_speed" = 0.0015;


Rotation Speed Factor
The rotational speed of all planets whose rotational speed was set by rotation_speed and not by rotational_velocity will be multiplied by this number.
Example:
"rotation_speed_factor" = 1.0;
(Intended more for the universal section as a "personal taste" option than for individual planets)


I notice also that Tianve OXP v.1's "Pulsar" is actually a fast rotating planet (but is just the one planet) and that Cody suggested just creating a config folder in the AddOns folder with a "planetinfo.plist" inside (to duplicate his preferred ooniverse) saying just

Code: Select all

{

/*     universal =
    {
        // Nebula in regular space.
        // Original number: nebula_count_multiplier = 1;
        sky_n_blurs = 100;
        sky_blur_scale = 30;                // 50;
        sky_blur_cluster_chance = 0.87;
        sky_blur_alpha = 0.142;             // 0.3185;

        // Stars in regular space.
        // Original number: star_count_multiplier = 5;
        sky_n_stars = 32768;
        sky_color_1 = (0.6, 0.7, 1.0);
        sky_color_2 = (1.0, 0.8, 0.4);

        // Standard ambient level.
        ambient_level = 0.4;

        // Slightly yellowish tinge to the sun.
        sun_color = "1.0 1.0 0.925 1.0";

        // Move the sun further out.
        sun_distance_modifier = 55.0;

        // Original flare is 0.075.
        corona_flare = 0.25;
        corona_hues = 0.4;
        corona_shimmer = 0.85;

        // Planets.
//        cloud_alpha = 5;
    };*/

    "interstellar space" =
    {
        /* Nebula in interstellar space. */
        /* Original number: sky_n_blobs: 128; */
        sky_n_blurs = 400;
        sky_blur_scale = 100;
        sky_blur_cluster_chance = 0.95;
        sky_blur_alpha = 0.15;

        /* Stars in interstellar space. */
        /* Original number: sky_n_stars = 480; */
        sky_n_stars = 8192;
        sky_color_1 = (1.0, 1.0, 0.0); // <-- changed from 0.0, 1.0, 0.5
        sky_color_2 = (0.5, 0.5, 0.1); // <-- changed from 0.0, 1.0, 0.0

        /* Interstellar space is dark. */
        ambient_level = 0.0; // <-- changed from 0.1
    };
    }
    

So I tried with this (having removed Cody's tweaks above, and titling this as a planetinfo.plist inside the config folder instead):

Code: Select all

{
universal =
        {
        rotational_velocity = 0.0005;
        };
}
And Lave seemed not to rotate at all! (I presumed that it should have done so at 1/3 the velocity - presuming that the figure given in the wiki is the actual vanilla code figure).

What have I done wrong?

And how would I exclude Drew's pulsar from the effects?

Re: Slower planet rotation?

Posted: Sun Jun 02, 2024 4:47 am
by phkb
Cholmondely wrote: Sat Jun 01, 2024 11:56 pm
What have I done wrong?
Nothing. 0.0005 is just very slow. You'll need to sit in place for a while to see the planet rotate.

Well, rotationalVelocity is tweakable in game, for any planet. I just changed Lave to 0.1 and watched it spinning ridiculously fast! So I think I can easily put together an OXP that will slow the rotational speed of whatever planet you are approaching so that by the time you're 1km or less over the surface, the rotation should stop. And then, increase again when you leave, back to it's original value.

I can approach this in 2 ways:
1. I could just incorporate the change into PlanetFall (which is far and away the primary reason you might want to approach a planet in the first place). Or:
2. I could make this a separate OXP, so that no matter what planet you approach, with or without planetfall, the rotation will become invisible when you get too close.

What do you thnk?

Re: Slower planet rotation?

Posted: Sun Jun 02, 2024 8:39 am
by Cholmondely
phkb wrote: Sun Jun 02, 2024 4:47 am
What do you thnk?
Thy choice, August Admiral!

I'm happy with things as they are - I enjoyed the challenge of trying to land on "land" with PF1. If, as you always do, you make it Library.oxp configurable, then adding it into PF2 makes more sense to me.

I did notice that "rotational_velocity" appears in some 8 of the vanilla code files.

PlanetEntity.m has 13 mentions including a section which reads as follows (lines 541-50):

Code: Select all

// set speed of rotation	
	if ([dict objectForKey:@"rotational_velocity"])
	{
		rotational_velocity = [dict oo_floatForKey:@"rotational_velocity" defaultValue:0.01f * randf()];	// 0.0 .. 0.01 avr 0.005
	}
	else
	{
		rotational_velocity = [planetInfo oo_floatForKey:@"rotation_speed" defaultValue:0.002 * (0.5+0.5*randf())]; // 0.001 .. 0.002 avr 0.0015
		rotational_velocity *= [planetInfo oo_floatForKey:@"rotation_speed_factor" defaultValue:1.0f];
	} 
I suppose that on a wider scale we have two options in dealing with this sort of option.

Either adding in another OXP to our collection of 1100+ and hoping that the player will be able work it all out if he's a Siamese speaker... or add it in to the Library Config and hope again that it can be worked out...

I suppose that if added in as an OXP that the title would be crucial - something like PlanetFall v.2 planet rotation twiddler (or some such) so that it's grouped with PlanetFall (but then it would be over in ambience, not activities).

Re: Slower planet rotation?

Posted: Sun Jun 02, 2024 8:50 am
by phkb
Cholmondely wrote: Sun Jun 02, 2024 8:39 am
If, as you always do, you make it Library.oxp configurable, then adding it into PF2 makes more sense to me.
I'm not sure there's much point in adding this into Library config if it's *not* part of PF, as there's nothing really to configure. You either want the visual effect, or you don't. If you don't, don't install it. If it was part of PF, then, yes, I could see a benefit of having an on/off switch.

I'm not aware of any gameplay effects linked to the rotational speed of the planet, so this is purely visual ambience, so, as you say, as a simple OXP it would go into the ambience category.

For now, I'll work on making it an addition to PF, and go from there. If there's a call to have it separate, I'll split it out.

I really can't see this being a particularly large addition, actually.

Re: Slower planet rotation?

Posted: Mon Jun 03, 2024 7:45 am
by Wildeblood
phkb wrote: Sun Jun 02, 2024 8:50 am
For now, I'll work on making it an addition to PF, and go from there. If there's a call to have it separate, I'll split it out.

I really can't see this being a particularly large addition, actually.
How enmeshed with the rest of the Planetfall script is it? Is it a separate .js file, or a few clearly labelled functions addended to an existing file, or would it require hours of family fun to disentangle?

Which is to ask: could it be easily copy/pasted into some hypothetical, future version of Explorers' Club?

Re: Slower planet rotation?

Posted: Mon Jun 03, 2024 7:49 am
by phkb
Wildeblood wrote: Mon Jun 03, 2024 7:45 am
How enmeshed with the rest of the Planetfall script is it? Is it a separate .js file, or a few clearly labelled functions addended to an existing file, or would it require hours of family fun to disentangle?

Which is to ask: could it be easily copy/pasted into some hypothetical, future version of Explorers' Club?
Its a single script file, which borrows two functions from the turbulence routines. Shouldn’t take much effort to extract and repurpose.

Re: Slower planet rotation?

Posted: Mon Jun 03, 2024 9:01 am
by Redspear
Cholmondely wrote: Sat Jun 01, 2024 11:56 pm
I don't think that anybody has done anything like this yet.
I did it for the rescaling experiment.
Can't remember which of those settings I used however.

The rescaling experiment was 'finished' and functional BTW it just gets left behind a bit if it doesn't get updated along with oolite.

What's been good about that however is that it's given me a prod to review it every so often and improve how it works or even add a feature or two.

phkb wrote: Sun Jun 02, 2024 4:47 am
I can approach this in 2 ways:
1. I could just incorporate the change into PlanetFall (which is far and away the primary reason you might want to approach a planet in the first place). Or:
2. I could make this a separate OXP, so that no matter what planet you approach, with or without planetfall, the rotation will become invisible when you get too close.

What do you thnk?
I would recommend #2

I agree with the quoted poster that it really becomes an obvious problem upon approach.

As for implementation there is a third option: make it a separate oxp but add it as a requirement for planetfall oxp. That way non-PF users can have the option whilst PF users would have it by default as an appropriate addition.

Re: Slower planet rotation?

Posted: Mon Jun 03, 2024 10:43 am
by phkb
Well, I’ll split it out into a separate oxp as long as someone comes up with a suitable, concise but clear name for it!

Re: Slower planet rotation?

Posted: Mon Jun 03, 2024 11:48 am
by Redspear
  • (more) realistic approach?
  • planet surface stabiliser?
  • planet rotation cosmetics?

Re: Slower planet rotation?

Posted: Tue Jun 04, 2024 1:20 am
by phkb
OK sports fans, the Planet Rotation Cosmetics OXP has been spun off into a separate OXP. Should be in the download manager shortly.