(Oh my god I am so sorry if you actually click to read all of this)
For the sake of clarity, I’m using “radius” to (interchangeably) refer to either orbital altitude or the actual radius. It would be entirely up to you which one you’re measuring with. Altitude measures from sea level, while radius measures from the center of the gravity well’s body. Most calculations are done with radius, but an IF implementation would likely have a lot of fuzzy approximations and units of measurement anyways.
A “gravity well’s body” refers to something like the Earth, Moon, Sun, galactic core black hole, or whatever. It’s the mass that is primarily shaping your orbit, assuming a Kepler-style approximation (as opposed to an n-body calculation, which I’m 99.99% certain nobody wants to do in an IF title).
These first two directions might not be something you would perform explicitly, depending on the implementation. They would probably be used for describing relative positions instead:
Up for increase in orbital radius
Down for decrease in orbital radius
If we’re talking about a literal direction that the player could “move” in, then “going Up” would just require you to complete a full orbit, as you accelerate/decelerate at each side of the orbit, to both keep it circular and raise the entire thing to your desired radius. This is also known as a Hohmann Transfer.
These directions, however, would be explicitly used by the player when navigating space:
Prograde for forward acceleration along orbital path (Makes the opposite end of your orbit go Up)
Retrograde for backward acceleration along orbital path (Makes the opposite end of your orbit go Down)
Normal for angling the orbit towards the positive axial vector of your orbit
Anti-Normal (AN) for angling the orbit towards the negative axial vector of your orbit
Implementing Normal and Anti-Normal (which change your “inclination”) might be a liiiiiittle overkill. It’s usually engaging enough to assume all orbits share the same inclination, and just play around with orbital radii and angles through time.
You would use Prograde and Retrograde to change your orbit, but it would not really be what moves you forward or backward in the orbit. In reality, time passes, and you continue to move Prograde, whether you want to or not. By using Prograde or Retrograde as a direction, you’re just accelerating, relative to those directions. When a movement turn passes, your ship will have moved some amount in the Prograde direction.
It might be useful to implement these directions as well:
Foreward for looking forward in time
Backward for looking backward in time
These would be more similar to truly “moving” in the Prograde and Retrograde directions, but only as a way of previewing the world. By going Forward, you can see all the positions everything will be in, after the movement turns pass. You can then go Backward to return to the present.
If you are Forward n
-number of turns, then there are a few ways you can handle the other directions:
- You could see the effects of these Prograde and Retrograde after
n
movement turns have passed.
- You will schedule a Prograde or Retrograde command, to be executed
n
turns later.
I feel like option 1 would be easier to implement and play with, personally, but I have made a game that uses option 2, as well.
Now, we have the question of angle. Ships move along their orbits, which are circular, so relative positions are usually described with the differences in orbital radii, angles.
Normally, we use radians to describe the angles, but, for an approximation, you can also use “spinward” and “anti-spinward”. HOWEVER, these are not likely to be used as orbital directions that the player can use, and would instead be used to help describe where things are placed.
This is because you cannot arbitrarily change your angle in space; this is controlled entirely by the progression of time. So, since these would only be used for description and information-gathering, I’m not listing them as directions.
If an orbiting “target” (be it a ship, moon, etc) is 11 units spinward and 10 units up, while I’m 3 units spinward and 8 units up, then I probably need to go Up 2 units. This is because smaller orbits are always faster, and I will make up for the difference in spinward position by starting at my lower orbit. By the time my orbital radius matches the target’s, we will both have similar spinward positions and equal orbital radii, after only half an orbit. (This is because acceleration/deceleration only affects the opposite end of your orbit, so you will need to complete half of your orbit to see the results of your changes.)
If our spinward positions are still a little off, then all I need to do is accelerate Prograde or Retrograde, which will make my orbit slightly slower or faster, respectively. After a full orbit, I will have removed the spinward difference in angle entirely, and I should be within appropriate range of the target to be considered “in the same space”. At this point, I’ll reverse my pro/retro-grade acceleration to perfectly match the target’s orbital shape, and prevent our angles from falling out of alignment in the future.
This is called a phase orbit!
Why would I need to wait a full orbit when making fine-tuned adjustments to my target angle offset? Because if my orbital radius near the target is correct, then my acceleration will change the opposite end of my orbit, making it slightly slower or faster, which will make me or my target “catch up”. At half an orbit in the future, my radius does not match the target (because it was changed), and I’m temporarily too far away from the target again. It will take another half-orbit to return to the target’s radius, with my remaining angle offset being removed. At that point, I undo my previous acceleration changes, so that my orbit perfectly matches the shape of the target’s orbit, but we are now at the exact same angle.
BUT WHAT IF I WANT TO USE UP, DOWN, SPINWARD, AND ANTI-SPINWARD AS DIRECTIONS?
Then I have (slightly) good news for you! You can!
(The following section is only useful if you’re only representing orbits as circles, and completely avoiding scenarios where they are ellipses. Any point where they might be elliptic would just be mentioned in passing between turns.)
Using Spinward and Anti-Spinward (AS) as explicit directions would be the same as scheduling full phase orbits to change your angle! When you “move” in either of these directions, you are just passing the duration of a full phase orbit (which could be anything from a few hours to a few days)!
Then, if you want to use Up and Down as explicit directions, you would just be scheduling Hohmann Transfer orbits. These only require a half-orbit to complete, however!
So, what does this mean?
Going US (Up-Spinward) would take 3 halves of an orbit (time may vary greatly). 1 half to change your radius, and 2 halves to change your angle!
Honestly, you would only need to know how much time passes to appropriately change the positions of other ships in the sky. Otherwise, you know you are at least catching up to your target, and getting within contact range, once the time elapses.
Anyways, this was something I was working on for an IF project one time. It can definitely be done at varying levels of approximation, but it really depends on how you wanna approach it.