Time in the game

Altaïr

Space Stig, Master of gravity
Staff member
Head Moderator
Team Kolibri
Modder
TEAM HAWK
Atlas
Deja Vu
Under Pressure
Forum Legend
#2
What do you mean exactly?

I guess that on each frame the time is incremented by a 30th of second (if you play in 30 fps...). But is it really what you wanted to know?
 

Juliblabla

TEAM HAWK
Swingin' on a Star
Fly me to the Moon
Under Pressure
Registered
#3
What do you mean exactly?

I guess that on each frame the time is incremented by a 30th of second (if you play in 30 fps...). But is it really what you wanted to know?
No sorry I wasn't speficic enough ! I wanted to ask "the time" in game, like for us a day is 24 hours... or maybe I am asking it wrongly... like how can I calculate the time of a trajectory (for example : earth moon, or LEO) ?
 

Pink

(Mooncrasher)
Staff member
Team Valiant
Discord Staff
Voyager Quest
Man on the Moon
Forum Legend
#4
Easiest way is the check the number of seconds the world is at before you start and after you arrive.
You can see this by opening the quicksave file of your world using a file manager.
 

Altaïr

Space Stig, Master of gravity
Staff member
Head Moderator
Team Kolibri
Modder
TEAM HAWK
Atlas
Deja Vu
Under Pressure
Forum Legend
#5
Ah, you mean the period of an orbit.

If it's a circular orbit it's quite simple. You know the speed from the game, and you can easily get the radius of your trajectory (take the altitude ingame, and add the planet radius). The circumference is 2π × radius, and the orbital period is circumference /speed.

Now if you want the period for an elliptic trajectory, that's a bit more complicated. For this you will need the semi-major-axis (sma), which is (periapsis + apoapsis) / 2. Be careful, you have to take into account the planet radius. For example, if your periapsis is at 35 km above Earth's surface, you should use 350 km (35 + 315, 315 km being the Earth's radius) in your calculation.

From there, there are 2 ways.

The first method is experimental. You can launch a ship on a circular orbit which radius is the sma you calculated, and calculate his period with the method described above. Two orbits that have the same sma have the same period, they are synchronous, so you have directly the answer.

The second method requires more calculations. For this one you also need the gravitational parameter of the orbited body. It's usually called μ ("mu"), and you can calculate it from the planet data:
μ = g × (planet radius)^2

Then you just have to use the third Kepler's law:
Period^2 / sma^3 = 4 × π^2 / μ

If we take as an example a ship orbiting Earth (circular orbit) at 35 km of altitude. So the sma is 350 km, so 350000 meters. Always use the values in meters in the formulas.

For Earth, g=9.8 m/s^2, and radius = 315000 meters, so:
μ = 972.405 × 10^9 m^3/s^2

Then with the third Kepler law, I can deduce the orbital period:
Period = 1126 seconds, so 18 minutes and 46 seconds.
 

Juliblabla

TEAM HAWK
Swingin' on a Star
Fly me to the Moon
Under Pressure
Registered
#6
Ah, you mean the period of an orbit.

If it's a circular orbit it's quite simple. You know the speed from the game, and you can easily get the radius of your trajectory (take the altitude ingame, and add the planet radius). The circumference is 2π × radius, and the orbital period is circumference /speed.

Now if you want the period for an elliptic trajectory, that's a bit more complicated. For this you will need the semi-major-axis (sma), which is (periapsis + apoapsis) / 2. Be careful, you have to take into account the planet radius. For example, if your periapsis is at 35 km above Earth's surface, you should use 350 km (35 + 315, 315 km being the Earth's radius) in your calculation.

From there, there are 2 ways.

The first method is experimental. You can launch a ship on a circular orbit which radius is the sma you calculated, and calculate his period with the method described above. Two orbits that have the same sma have the same period, they are synchronous, so you have directly the answer.

The second method requires more calculations. For this one you also need the gravitational parameter of the orbited body. It's usually called μ ("mu"), and you can calculate it from the planet data:
μ = g × (planet radius)^2

Then you just have to use the third Kepler's law:
Period^2 / sma^3 = 4 × π^2 / μ

If we take as an example a ship orbiting Earth (circular orbit) at 35 km of altitude. So the sma is 350 km, so 350000 meters. Always use the values in meters in the formulas.

For Earth, g=9.8 m/s^2, and radius = 315000 meters, so:
μ = 972.405 × 10^9 m^3/s^2

Then with the third Kepler law, I can deduce the orbital period:
Period = 1126 seconds, so 18 minutes and 46 seconds.
Yes exactly that ! Thx a lot man ! That really helped :)