pioneerspacesim / pioneer

A game of lonely space adventure
https://pioneerspacesim.net
1.64k stars 381 forks source link

View ship's orbital trajectory #985

Closed s20dan closed 11 years ago

s20dan commented 12 years ago

Now that we have some nifty fuel use going on for in-system flight, it finally becomes worthwhile to fly the most fuel-efficient route to the destination. To do that we need a visual representation of the player's orbital tradjectory, as well as the tradjectrories of any targets which we wish to rendezvous with (Planets and stars are already visualised)

Here's some mspaint art ;) First this is what the autopilot does: Imgur

And this is what would be seen if the player were to perform a Hohmann transfer (As Brianetta mentions below this is not a true Hohmann transfer, but rather a higher energy transfer, although still using a lot less fuel than the autopilot) Imgur The blue line would be the trajectory that the player's ship will take. Basically this is just a way of visualising where the player is and where they will be, as you are always moving in space from one perspective or another, so its good to see where you will end up.

It should be calculated based on the current reference point, and like set-speed mode ect should be able to be over-ridden with ctrl+click on a target. I imagine this would create some rather cool looking orbital configurations, like horseshoe orbits ect.

@Brianetta got any better diagrams? ;)

Brianetta commented 12 years ago

Not really. What you have there isn't a Hohmann transfer orbit; that's one where the apoapsis and periapsis of the transfer lie on the start and the destination, and uses the minimum delta-V. Yours is a more energetic transfer orbit, but still better than the autopilot in terms of efficiency.

It's a good idea, though. Plot the current trajectory as an orbit around the current frame body (let's not complicate things by attempting to use multiple frames). It doesn't need to be complete, either. A clear orbit around a body would be a complete ellipse on the plot, but any trajectory that intersects another reference frame should just end at the boundary (this might require fast-forwarding time to see where those frames will be, as the player progresses), and hyperbolic orbits should end at some arbitrarily distant point.

It doesn't need to be re-calculated live, either; an instantaneous plot on entering this screen would be fine. Its mostly for manual flight anyway (or judging where to re-engage an autopilot if we're saving fuel). The time forwards/backwards arrows would move the "player" blob along the blue line, just like the planets. Outside the time frame of that line, it could just be absent.

s20dan commented 12 years ago

Not really. What you have there isn't a Hohmann transfer orbit; that's one where the apoapsis and periapsis of the transfer lie on the start and the destination, and uses the minimum delta-V. Yours is a more energetic transfer orbit, but still better than the autopilot in terms of efficiency.

Have you ever used mspaint? It was a matter of drawing a shape as close as I could get it, its a wonder it came out that eliptical and actually overlaying Earth ;) I miss my photoshop. But yeah I know what you mean. I actually thought that any eliptical orbit where you change between two circular orbits was a hohmann transfer regardless. So does that type of orbital transfer I ended up drawing have a proper name?

Brianetta commented 12 years ago

For reference, a Hohmann transfer orbit: Hohmann

What isn't obvious is that Mars won't be there at launch time; it'll be nine months further back in its orbit.

s20dan commented 12 years ago

450 and #229 (which is similar) would aid the player in achieving the perfect orbital transfer ;)

And #853 which again is similar to the other issues.

s20dan commented 12 years ago
Plot the current trajectory as an orbit around the current frame body 
(let's not complicate things by attempting to use multiple frames).

I see one problem from using a single frame of reference though, you are in orbit of Earth and you want to transfer to another planet. Your actual orbit in relation to the sun, which you need to transfer from one planet to another, won't become visible until you leave the Earth's frame of reference.

s20dan commented 12 years ago

This video perfectly illustrates what we want to see on the in-system map :)

http://www.youtube.com/watch?v=VUTgDr7tYGQ

Brianetta commented 12 years ago

I see one problem from using a single frame of reference though, you are in orbit of Earth and you want to transfer to another planet. Your actual orbit in relation to the sun, which you need to transfer from one planet to another, won't become visible until you leave the Earth's frame of reference.

We already have a mechanism for dealing with this - holding Ctrl and selecting the Sol would make Set Speed match against Sol rather than Earth. Perhaps we could just use that? In the future, when something better comes along in the way of user interface, both could benefit.

Gudadantza commented 12 years ago

So, If I am not wrong, an orbit around a planet could be show too? It would be the same orbit but smaller, I guess...

The aid of this possible feature in navigation aid would be a step forward.

Greetings.

Brianetta commented 12 years ago

That's the idea, yes. You can zoom in to the map.

CmdrBugbear commented 12 years ago

I’d like to propose a new GUI element that will assist the pilot in following a fuel efficient trajectory.

In short, I think it would be fairly intuitive to have a ‘planned trajectory’ indicator that tells the pilot the direction and speed (relative to the current frame of reference) required to follow a fuel efficient trajectory from a predetermined origin and destination.

This indicator would be similar in appearance to the green relative velocity indicator that already exists.

To use the planned trajectory indicator, the pilot would first have to use their trajectory planner equipment (a purchasable extension to the autopilot perhaps?) and specify their destination. The trajectory planner would then work out a fuel efficient trajectory between the origin and the destination. Presumably, the origin is the current ship position and vector.

(I do not have a rigorous understanding of orbital mechanics so I don’t know how feasible this suggestion is from a coding point of view. Is it possible that for some origin / destinations, a fuel efficient trajectory does not exist? E.g. when arriving in a system from hyperspace, what would a fuel efficient trajectory look like?)

The planned trajectory, then would be the expected speed and direction of the ship (relative to the current frame of reference) assuming a main burn at origin and destination. The planned trajectory indicator would display the ships discrepancy from this planned trajectory.

It would be the job of the pilot to launch at the correct time, and to ensure their actual trajectory mirrors the planned trajectory as closely as possible. As you reach the destination, the planned trajectory indicator would quickly drift from front to rear view as the trajectory plan would be expecting deceleration at that point. This would be the visual cue for the pilot to start hitting the brakes!

Maybe a countdown to the deceleration window would be appropriate. Alternatively, the planned trajectory could simply indicate the expected times for start acceleration burn, end acceleration burn, start deceleration burn, end deceleration burn (feel free to correct my terminology here). It would be up to the pilot to commence the burns at the appropriate times.

Brianetta commented 12 years ago

From #1457, @MintyHippo wrote:

First of all, I love the game, but I have two features that would make interplanetary flight less difficult: For interplanetary flight, there should be a system map with the star at the center that shows all of the planets in their relative positions. Achieving orbits and Hohmann transfers would be much easier if on this map, there was a line starting from your ship that showed your predicted course, as well as Apoapsis and Periapsis, this way you would know for sure that you are in a circular orbit without having to guess or to calculate the Delta-V required to obtain a circular orbit (if you want to fly without autopilot. Also if you are trying to transfer into orbit around another planet, you would need this info for a smoother flight. When I fly to another planet with the autopilot it seems to be very fuel-costly and the navigation doesn't seem realistic. First, the autopilot points straight at your target (rather than burning prograde for an injection burn.) Then its breaking burn is far too late and it always ends up over-shooting the target and then going in reverse back to the target with the entire trip in a straight line. Also, the landing is similarly linear but I won't get too much into that.

Anyways, an orbital map that plots your vector (such as in KSP) would be extremely helpful! Or if you think it would be giving the player too much information then at least allow the autopilot to do hohmann transfers.

Luomu commented 11 years ago

Implemented in #2084.