Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: [1] 2

Author Topic: Orbital Period of Planets  (Read 2164 times)

jerri

  • Ensign
  • *
  • Posts: 21
    • View Profile
Orbital Period of Planets
« on: March 09, 2023, 04:58:34 PM »

I don't suppose anyone would happen to have a list of the orbital period of every core world?

Unless it's in the code somewhere I'm not exactly willing to settle down in every system and log exactly how long it takes for a planet to repeat its position.
Although, as I write that the thought of some deranged captain sitting in orbit with nought but a tally counting the days without explanation grows more and more appealing...
Logged

Doctorhealsgood

  • Admiral
  • *****
  • Posts: 517
    • View Profile
Re: Orbital Period of Planets
« Reply #1 on: March 10, 2023, 07:37:14 AM »

If i remember well the hyperspace entry points move around as the planets move so if nothing else it could make things easier for you. I think that standing still consumes no fuel? Or at the very least very little fuel.
Logged
Quote from: Doctorhealsgood
Sometimes i feel like my brain has been hit by salamanders not gonna lie.

Ruddygreat

  • Admiral
  • *****
  • Posts: 524
  • Seals :^)
    • View Profile
Re: Orbital Period of Planets
« Reply #2 on: March 10, 2023, 10:52:50 AM »

luckily (and honestly, kinda wierdly), all of the code for the core worlds generation is in /data/scripts/world/systems, the orbital period (in days) of a given object is always the final arg in the method that either adds it or sets it's orbit.

jerri

  • Ensign
  • *
  • Posts: 21
    • View Profile
Re: Orbital Period of Planets
« Reply #3 on: March 10, 2023, 11:37:43 AM »

Quote
all of the code for the core worlds generation is in /data/scripts/world/systems

Information that's come too late to save my evening unfortunately, although my own measurements were less than a day off from what was in the code, which is nice.

I spent a bit of time in Askonia watching the worlds go by and noticed that the period of one of the proceduraly generated planets (502 days) was shorter than Umbra's (600 days) despite being further from the star. This is completely unacceptable and I will be requesting 3 refunds at the same time immediately >;((

In all seriousness, it's not exactly a concerning problem but it doesn't seem like a difficult fix to add some sort of check that ensures the generated planets have a longer period than the furthest out placed one.
Logged

SafariJohn

  • Admiral
  • *****
  • Posts: 3021
    • View Profile
Re: Orbital Period of Planets
« Reply #4 on: March 10, 2023, 05:58:30 PM »

A lot of proc gen orbits use this function to calculate their orbit time:

orbitRadius / (20f + Random().nextFloat() * 5f)
Logged

CapnHector

  • Admiral
  • *****
  • Posts: 1056
    • View Profile
Re: Orbital Period of Planets
« Reply #5 on: March 10, 2023, 11:47:31 PM »

Uhm the orbital period should not be random but should depend on the mass of the star and radius of the orbit only. Should probably make a suggestions thread about this
Logged
5 ships vs 5 Ordos: Executor · Invictus · Paragon · Astral · Legion · Onslaught · Odyssey | Video LibraryHiruma Kai's Challenge

Hiruma Kai

  • Admiral
  • *****
  • Posts: 886
    • View Profile
Re: Orbital Period of Planets
« Reply #6 on: March 11, 2023, 08:18:43 AM »

Uhm the orbital period should not be random but should depend on the mass of the star and radius of the orbit only. Should probably make a suggestions thread about this

I'm guessing it was done so you don't have large variation in speed relative to the player fleet's "stationary".  The formal presented (R/ 20 to R /25), is restricted, and given an orbital circumference of 2*pi*R, means you'll have a variation in speed of orbital objects relative to the game's "stationary" of 2*pi*20 to 2*pi*25 distance units per unit time (game days?) no matter the distance.  So maximum speed variation of 0.25 (25%) or so.

If you actually applied Kepler's laws (T^2 ~ R^3), you'd potentially get variations in speed from Research stations orbiting black holes to planets in the outer reaches of a system, potentially a R difference of 20.  Which would yield a variation in period of 89.4 (i.e. 1 = 1, 89.4^2 = 20^3), which in turn means a variation in speed of 4.47 or so (447%).  And that's ignoring mass.  Take something like a 0.6 solar mass white dwarf versus a 10 solar mass black hole.  T ~ 1/sqrt(M).  That's another factor of 4 in speed and orbital variation, so combined that's up to a factor of 16 (1,600%) in speed from distant objects in a white dwarf system compared to a research station close orbiting a black hole.

So I'm guessing Alex didn't want to deal with objects moving over a ~64 times larger speed range (16/0.25=64) for gameplay's sake.  You could pick the scale such that the fastest things are as fast as they are now, but that would imply most middle to outer distant objects would be moving much, much slower and thus much less noticeable.  Which might make certain clandestine relay type missions be in bad positions for much longer.
Logged

CapnHector

  • Admiral
  • *****
  • Posts: 1056
    • View Profile
Re: Orbital Period of Planets
« Reply #7 on: March 11, 2023, 09:53:27 AM »

Well, now that you've described it it definitely sounds very cool how it would be in practice. I wonder if Alex has tried it with Kepler's laws. It's definitely computationally simple. Or if it could be modded in. I would be interested in this mod.

I'm not sure if it would make clandestine missions harder. Wouldn't greater differences in orbital velocity make configurations of planets decay faster, on average? For example if you have two objects circling the same point with a 25% difference in angular velocity and they start on top of each other, they will stay within 10 degrees of each other a longer period of time from the start than if they have a 100% difference in angular velocity. However, I can see that it might be frustrating to chase a very fast research station.

Anyway if you don't want such a large range you could just sacrifice realism for gameplay and add a soft floor and ceiling so the range of velocities is compressed but still the order is realistic in terms of how gravity works so objects that are further away do not move faster.
Logged
5 ships vs 5 Ordos: Executor · Invictus · Paragon · Astral · Legion · Onslaught · Odyssey | Video LibraryHiruma Kai's Challenge

SafariJohn

  • Admiral
  • *****
  • Posts: 3021
    • View Profile
Re: Orbital Period of Planets
« Reply #8 on: March 11, 2023, 02:50:37 PM »

Chasing planets and stations sucks. It is already abstracted - for example habitable planets are arbitrarily larger than uninhabitable ones.
Logged

jerri

  • Ensign
  • *
  • Posts: 21
    • View Profile
Re: Orbital Period of Planets
« Reply #9 on: March 11, 2023, 07:44:04 PM »

Quote
habitable planets are arbitrarily larger than uninhabitable ones
Wait, really? I've never noticed that, I wonder what the reasoning behind it is.

As for the question of extreme orbital velocities, I don't think extremely fast or slow objects would end up being too much of a hassle. Research stations that orbit close to their star would orbit fast enough for you to just wait for it to come back around. Planets that are far from the star don't aren't typically populated nor interesting. However, this would break down in binary systems - say you have a black hole and a brown dwarf together - this would probably end up looking a bit silly.

The idea of a soft floor/ceiling to ensure sensible velocities from a gameplay standard seems the most appealing to me. This would still require giving every star it's own mass, though. But if you gave each star it's own mass then that raises the question of why the planets don't have their own mass. Trying to make one thing more realistic would probably spiral out of control quite quickly.

Perhaps you could give each category of star an average density? This avoids the problem of giving every star a unique mass, instead you just need the average density for white dwarfs, red dwarfs, blue giants, etc. From what I've seen by searching around the internet it doesn't seem like density varies that much in stars of the same classification - a lot less than the mass does - though I could be wrong. Assuming we properly scale the final value to fit within our floor/ceiling, we can use Kepler's 3rd with the density (rho) and radius of the star (R) and the radius of the planet orbiting it (r) to determine the period (T).

T^2 = [3*pi*(r^3)] / [G*rho*(R^3)] where G is the gravitational constant. Of course this all assumes that giving each star a unique mass is a problem at all.

Hell, this assumes that any of this is a problem at all. The game's fine as it is and there's no way someone's going to actually notice that the planets orbital velocities don't make sense and then complain that it's not realistic enough.
Logged

CapnHector

  • Admiral
  • *****
  • Posts: 1056
    • View Profile
Re: Orbital Period of Planets
« Reply #10 on: March 11, 2023, 08:43:45 PM »

Well, the orbits are all circular even in a multiple star system so only gravitation from one point is considered. We probably shouldn't ask Alex to add a more detailed simulation of say the three body problem so that is fine.

That means each orbit exactly defines the mass of its central point. For example, if you have a circular orbit around Askonia, and this orbit is 600 days at a particular radius, and no other gravitational interactions exist, that defines the mass of Askonia. In fact if we knew what the units were you could use your observations to calculate it.

Anyway, that means that no actual changes to how orbits are specified would really be needed, just that whenever you specify one orbital period around one object then all other orbital periods are inferred from the implied mass of the central body rather than defined separately.

It wouldn't necessarily be a waste to spend a little time working on planetary motion. This might open the way to for example elliptical orbits, including comets etc. Elliptical orbits exist in the 2d space adventure Transcendence and look very cool compared to just circular orbits.

Like this:

« Last Edit: March 11, 2023, 09:02:17 PM by CapnHector »
Logged
5 ships vs 5 Ordos: Executor · Invictus · Paragon · Astral · Legion · Onslaught · Odyssey | Video LibraryHiruma Kai's Challenge

Serenitis

  • Admiral
  • *****
  • Posts: 1467
    • View Profile
Re: Orbital Period of Planets
« Reply #11 on: March 12, 2023, 01:14:31 AM »

Elliptical orbits exist in the 2d space adventure Transcendence and look very cool compared to just circular orbits.
Unless it's been added in a later version than I have, bodies in Transcendence do not move. At all.
Thier orbits are plotted out to make it easier to find things and orient yourself in new territory. The underlying system topolgy never changes though.
Logged

CapnHector

  • Admiral
  • *****
  • Posts: 1056
    • View Profile
Re: Orbital Period of Planets
« Reply #12 on: March 12, 2023, 03:08:32 AM »

That's true, in Transcendence the function of the orbits is (at least when I last played, too) to help the player find objects, and Starsector is more advanced that way. The point, though, is that eccentric orbits look cool - just look at that image. Most people likely have an idea of space where orbits are not perfectly round, so having eccentric orbits increases immersion. It's a wow factor which are not something to dismiss.

It's not like generating an eccentric orbit and motion along an eccentric orbit would be particularly difficult to program if you were to define stellar mass, even implicitly such as basing it on one orbital period along a circular orbit. Kepler's laws of planetary motion are literally 17th century math, it's very elementary compared to much of what is going on in Starsector.
Logged
5 ships vs 5 Ordos: Executor · Invictus · Paragon · Astral · Legion · Onslaught · Odyssey | Video LibraryHiruma Kai's Challenge

jerri

  • Ensign
  • *
  • Posts: 21
    • View Profile
Re: Orbital Period of Planets
« Reply #13 on: March 22, 2023, 03:08:00 AM »

The thing is that typically planets don't have very eccentric orbits (in comparison to dwarf planets, comets etc.) and in the scale that the systems in starsector provide it may end up looking stranger than intended. For example, if a gas giant strays close to a small planet's orbit a player might expect the gravity of the gas giant to affect the smaller planet, especially if the gas giant already has moons.

Speaking of gas giants, is it just me or are the gas giants in most systems a bit too small? Perhaps I'm just expecting them to be bigger because Jupiter is my go-to for visualising a gas giant?

Anyway, elliptical orbits don't seem like they would be particularly easy to implement, and even if they were you'd probably have to implement full simulation of orbital physics to get everything cohesive enough to not raise questions.

I still think that the small change of ensuring generated planets have periods that increase with distance wouldn't be difficult to make. Even if it is completely unnoticeable.
Logged

CapnHector

  • Admiral
  • *****
  • Posts: 1056
    • View Profile
Re: Orbital Period of Planets
« Reply #14 on: March 22, 2023, 03:12:58 AM »

You should definitely make a suggestions thread about it. I can do it too, but it's your discovery and also I would recommend implementing Kepler's laws which Alex won't do.
Logged
5 ships vs 5 Ordos: Executor · Invictus · Paragon · Astral · Legion · Onslaught · Odyssey | Video LibraryHiruma Kai's Challenge
Pages: [1] 2