Jump to content

Orbit Question


Brad

Recommended Posts

From what I can gather, the reason the spacecraft is unaffected by multiple bodies' gravity is due to a limit of the game engine. I'm just curious why an orbit can't just be simulated by the programmer (if within x distance of body, make the spacecraft turn in y direction, etc (I think there are formulas to calculate this)) rather than recognized as a body by the engine.

Edited by Brad
Link to comment
Share on other sites

I'm not sure what you think the difference is.

If you're within a body's SOI, you'll accelerate toward its center according to specific formulae. The SOI is how it determines that you're "within x distance of body".

Link to comment
Share on other sites

It was a considered and intentional decision to use Patched Conics instead of implementing N-Body calculations. Although the latter is possible, the calculations are much more processing intensive. Considering the hundreds of debris in many persistent worlds, I doubt our regular computers are up to the task.

Also note that proper orbit modelling would make the game play more complicated and unpredictable. If applied to planets, I would also expect compounding precision errors of the floating point calcs to cause all sorts of mahem.

IMO I think it was a good decision.

Link to comment
Share on other sites

Because it gets very complex very quickly. Right now, we have 4 significant bodies. You would have to calculate the total forces from each, then figure out where to move the ship based on that, and you would have to do that each physics step. Most computers simply can't handle that much work without the simulation grinding to a halt. And we are getting nearly a dozen new bodies in the next update. Besides, patched conics does almost as good a job, and is far easier to solve for.

TL;DR:

What we have now works, computers can handle the load, and changing to an n-body system wouldn't make things noticeably more accurate.

Link to comment
Share on other sites

What we have now does indeed work. Free Return Trajectories are possible, regardless of the lack of Kerbin's affect on the craft when it is in the Mun's SOI. Anything more would put too much a load on the game, not to mention create needless development time.

In the end, there is never going to be a perfect simulation, shy of dedicating a few servers to the job of handling every miniscule effect on the craft. KSP isn't meant to be such, but with what it has, it does it well.

Link to comment
Share on other sites

From the Krakensbane dev blog:

In KSP, ships aren't simulated as a single physical point, with forces and torques acting on it. They're simulated as multiple linked rigidbodies, each with its own velocity.

Is gravity also calculated separately for each piece of a ship? It would have to be, wouldn't it? Momentum, velocity, all that, would have to be, or bad designs wouldn't realistically rip apart on takeoff like they do, and that sort of thing. If so, then a single ship is already an N body problem.

Link to comment
Share on other sites

Gravity hasn't been calculated separately for each part of a ship since v.0.11 Kind of a shame, really, because I didn't get the idea to try to pull of gravity gradient stabilization until v.0.12.

As it is now, every piece of your spacecraft feels the exact same gravitational accelleration in the exact same direction.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...