Jump to content

Will KSP 2 have Lagrange points?


Recommended Posts

57 minutes ago, Nerbal The Second said:

Since the James Webb Telescope is in a Lagrange point, I was curious if Ksp 2 will have them?

Kind of don't need them in KSP/KSP2.  Given the way the orbitals work in SOI... its almost certain the L4/L5 and L3 points are well out of the given body's SOI, so you could just do a stellar orbit in any one of those points without risk of perturbation.  L1 & L2 could also be simulated merely by plopping something just outside the planetary SOI (except that due to differing orbital circumferences, you will get drift).  So 3/5 aint bad.

Link to comment
Share on other sites

12 hours ago, JoeSchmuckatelli said:

L1 & L2 could also be simulated merely by plopping something just outside the planetary SOI (except that due to differing orbital circumferences, you will get drift).

I think drift is exactly the problem. If you wanted to plop a colony or coms satellite that's going to always stay on sunny/dark side of Kerbin, but keep within a short range for communication, you're out of luck.

13 hours ago, TheOrbitalMechanic said:

With the exception of Rask and Rusk, which will have localized N-body mechanics (and therefore a Lagrange point between the two)

It's never been properly confirmed how Risk system will be handled. They said limited N-body early on, but later specified that it might be something a bit simpler. The point near barycenter might behave kind of like an L1, but it will depend on implementation. It might end up being too unstable to actually park anything there.

Link to comment
Share on other sites

8 hours ago, K^2 said:

something a bit simpler

A small, weak SOI at the designated L1&2 points, outside the secondary body's SOI for game purposes - where the engine basically determines the location by a linear distance from the secondary to keep the alignments correct. 

Also except as needed they declare that only the Kerbin Lagrange points are in the game (so don't go expecting K-Mun points, etc) or other designated points (Jool, Risk) unless they wanted to add Trojans to visit... or something

Edited by JoeSchmuckatelli
Link to comment
Share on other sites

They could simulate lagrange points by having a very small SOI at the point location that is only activated when a ship is moving slower than x speed. Getting to the L  point would be a bit gamey due to lack of n-body, but having it only trigger below a certain relative m/s would prevent the SOI from interfering with other missions.

Link to comment
Share on other sites

6 hours ago, TLTay said:

They could simulate lagrange points by having a very small SOI at the point location that is only activated when a ship is moving slower than x speed. Getting to the L  point would be a bit gamey due to lack of n-body, but having it only trigger below a certain relative m/s would prevent the SOI from interfering with other missions.

The reason to use SoI instead of N-body dynamics is primarily to allow to fast-forward time without having to do integration steps, and that's conditional on as few parameters of SoIs changing as possible. Dealing with SoIs that are moving is already added complexity. Making them also conditional on ship parameters, like relative velocity, would almost nullify the advantage. 

If you want to fake Lagrange points with SoI, it's probably best to just make them weak attractors and accept the fact that they won't be entirely true to how real Lagrange points work.

Link to comment
Share on other sites

On 2/7/2022 at 7:28 AM, TLTay said:

They could simulate lagrange points by having a very small SOI at the point location that is only activated when a ship is moving slower than x speed. Getting to the L  point would be a bit gamey due to lack of n-body, but having it only trigger below a certain relative m/s would prevent the SOI from interfering with other missions.

I do have 1 problem with this, which is that it wouldn't enable ultra-low cost missions using something similar to the ITN, but this is a great idea for people who need to use L1 through L5. And, as an alternative to having it trigger only below a certain velocity, it might be possible to instead have the SOI be relatively large (perhaps the radius of The Mun), but incredibly weak.

Link to comment
Share on other sites

Well, if they put Rask and rusk on rails orbiting the barycenter, it's not true n-body physics.

I don't know if a precise solution for craft orbits is possible in this case, where the 2 other bodies are unaffected by the changing positions, and have perfectly predictable orbits.

At least if not, it will simplify the calculations

Link to comment
Share on other sites

23 hours ago, K^2 said:

The reason to use SoI instead of N-body dynamics is primarily to allow to fast-forward time without having to do integration steps, and that's conditional on as few parameters of SoIs changing as possible. Dealing with SoIs that are moving is already added complexity. Making them also conditional on ship parameters, like relative velocity, would almost nullify the advantage. 

If you want to fake Lagrange points with SoI, it's probably best to just make them weak attractors and accept the fact that they won't be entirely true to how real Lagrange points work.

That actually would be pretty cool!

I'm sure that we could do something like this with Kopernicus by having near invisible planets or moons or some sort of body in the Lagrange points that Kerbin and other planets would have.

Link to comment
Share on other sites

3 minutes ago, AtomicTech said:

I'm sure that we could do something like this with Kopernicus by having near invisible planets or moons or some sort of body in the Lagrange points that Kerbin and other planets would have.

I'm sure you could create an SoI with either no planet but still having an attractor, or putting in a fake planet with no collision or rendering to the same effect.

The only problem is that you'll have a singularity dead-center, so you might need to actually use two SoIs, the inner, much smaller one having no gravity. As Intercept are still developing KPS2, they could, of course, side-step both of these problems and simply allow for SoI with arbitrary attractors. Code-wise, you'll still have to do designate inner and outer zones in SoI and do an additional boundary check on orbits passing through it, but instead of having a dead zone with gravity sharply cutting off, you could have a harmonic attractor, which will allow for much smoother orbits.

Of course, this would also require information about these fake L-points to be somehow presented to the player, probably have tutorials about it... It's a pretty sizeable feature, if implemented properly, so I wouldn't hold it against Intercept for just passing on it. Might still be something that can be modded in, though. We'll have to see how easy they make it to modify the planetary systems.

Link to comment
Share on other sites

Just now, K^2 said:

I'm sure you could create an SoI with either no planet but still having an attractor, or putting in a fake planet with no collision or rendering to the same effect.

The only problem is that you'll have a singularity dead-center, so you might need to actually use two SoIs, the inner, much smaller one having no gravity. As Intercept are still developing KPS2, they could, of course, side-step both of these problems and simply allow for SoI with arbitrary attractors. Code-wise, you'll still have to do designate inner and outer zones in SoI and do an additional boundary check on orbits passing through it, but instead of having a dead zone with gravity sharply cutting off, you could have a harmonic attractor, which will allow for much smoother orbits.

Of course, this would also require information about these fake L-points to be somehow presented to the player, probably have tutorials about it... It's a pretty sizeable feature, if implemented properly, so I wouldn't hold it against Intercept for just passing on it. Might still be something that can be modded in, though. We'll have to see how easy they make it to modify the planetary systems.

Fingers crossed!

Link to comment
Share on other sites

The thing is, LPs aren't actual places. Only stable ones are L2 and L3 L4 and L5, which can be achieved by carefully placing a craft there by hand anyway, and the other points are unstable so they would be very limited in usefulness. I see no point in duct-taping their existence in a patched conics system. Whatever solution you come up with, they aren't actually Lagrange Points until you switch to n-body (at which point they become emergent anyway). I don't think they can be implemented, because the only way to do it is to ditch patched conics entirely.

KSP used patched conics for the sake of simplicity (computationally speaking, and in terms of gameplay). It's kinda wrong, but still 'good enough' for the purposes of showcasing orbital mechanics (which is one of the main aspects of KSP). You could also say Patched Conics is lesser by omission, but still valid. Can't think of a system where LP could be introduced without being flat-out wrong, which would go against the spirit of KSP moonlighting as educational content. You'd simply be creating space-magic anomalies.

Edited by Axelord FTW
Link to comment
Share on other sites

1 hour ago, Axelord FTW said:

The thing is, LPs aren't actual places. Only stable ones are L2 and L3, which can be achieved by carefully placing a craft there by hand anyway, and the other points are unstable so they would be very limited in usefulness. I see no point in duct-taping their existence in a patched conics system. Whatever solution you come up with, they aren't actually Lagrange Points until you switch to n-body (at which point they become emergent anyway). I don't think they can be implemented, because the only way to do it is to ditch patched conics entirely.

Kerbin isn't an actual place either. There's a lot to be said about providing interesting mechanics in a game. There are a lot of features of real world orbital mechanics that lead to cool use cases, such as parking craft near Lagrange points, which would be interesting to replicate in a game. Saying, "That's not a feature of patched conics," is missing a point of all of this by a nautical mile. The entire goal of the simulation is to allow you to run a variety of mission profiles approximating real world cases while being able to run at 100k the real time speed across dozens of craft in multiple star systems and provide real-time trajectory predictions while doing so on console hardware. If you have a better idea how to achieve that, I'd love to see an implementation.

Link to comment
Share on other sites

~[snip]~

Anyway, L4 and L5, in particular, are HUGE zones. You cannot use patched conics to 'simulate' them without giving them vast spheres of influence. They cover over 40 degrees of arc together, from the main parent's point of view (look at the trojans for an example of this). How can you implement anything that would cover a thousand times the volume of Jool's current SOI? That's why my idea of how to implement them boils down to 'No,' unless you switch to n-body. Patched Conics is antithetical to the Lagrangian system.
They are considered virtual points in space for a good reason; that they only exist in relation to other gravitational bodies. Until you can get two bodies to influence your craft at the same time, they cannot exist, and any approximations will fall short of portraying how they really work. Now THAT would be missing the point.

 

P.S. Fixed earlier mistake, I meant L4 and L5, not L2 and L3.

Edited by Starhawk
Redacted by moderator
Link to comment
Share on other sites

Without looking at it from implementation (assume it will work and will be accurate and not annoying) are Lagrange points really worth putting in the game? First, let’s rule out that it will educate players well, because no matter how it is modeled with an SOI (which would have to have a different  gravity strength curve, but that is hardly a problem), the players who don’t know about Lagrange point and stumble upon this when making their first transfer to Duna will not get a solid understanding of what is making it work (unlike with n-body, where you are primed to look at multiple bodies attracting at the same time) and while this may prompt them into research, the experience will not be fulfilling for most people.


Next, for the people who already know what Lagrange points are and want to send missions to them: This allows you to run another type of mission, which I am all for, but this particular type of mission only differs from a regular deep space mission in that it is always in a relatively fixed area relative to a planet and has a cool orbit. This small benefit doesn’t seem worth the harm to  new players when trying to transfer. They will see a small perturbation in their orbit that sort of ruins the simplicity of the SOI system. I personally would immediately download a mod that adds Lagrange points, but I wouldn’t want it to be in the base game, because it adds more hassle than it does new gameplay. 

Edited by t_v
Link to comment
Share on other sites

4 hours ago, Axelord FTW said:

Anyway, L4 and L5, in particular, are HUGE zones.

L3-L5 require no additional work. They are already equilibrium points in KSP.

4 hours ago, Axelord FTW said:

They are considered virtual points in space for a good reason;

No, they aren't. The term "virtual" wouldn't even make sense in the context. They equilibrium points of the effective potential in the rotating frame of reference. If you want to make it sound like your argument is coming from some sort of academic principles, at least use the right terminology.

Here's your system on n-body physics.

qJXmfJw.png

Same system on patched conics with SoI boundary marked.

KrifkNU.png

The L3, L4, and L5 have merged into a continuous equilibrium band. They're unstable, but so was L3 to begin with, and L4 and L5 only have limited dynamic stability. They work for gameplay purposes either way. If you want to build a base in L3 in KSP, if you're careful about parking it, it will pretty much stay there. It requires very careful maneuvering and observation to even tell that the dynamic of craft near L3 in the top picture vs bottom picture is any different. For gameplay purposes, they are identical.

L1 and L2, in contrast, are simply gone. They are not a feature on the bottom image. If you want to place an object where L1 or L2 would have been, it will drift away from there in a hurry. These points aren't just unstable, they aren't equilibria at all. The entire topic of discussion is, can we reasonably bring in an approximation of these into the game? And the answer is yes. If you build small plateaus in potential where you want the pseudo-L1 and L2 to be located, it will work. And for gameplay purposes, you will not be able to tell the difference between the picture on the top and the picture on the bottom, because I already had to tinker with contours and contrasts and apply logarithmic stretching just to make the two pictures look different for illustration purposes here.

This whole talk about n-body somehow being critical for simulating Lagrange points is hot air. ^ There's the math.

Link to comment
Share on other sites

On 2/9/2022 at 8:45 AM, K^2 said:

L3-L5 require no additional work. They are already equilibrium points in KSP.

[snip]

The L3, L4, and L5 have merged into a continuous equilibrium band. They're unstable, but so was L3 to begin with, and L4 and L5 only have limited dynamic stability. They work for gameplay purposes either way. If you want to build a base in L3 in KSP, if you're careful about parking it, it will pretty much stay there. It requires very careful maneuvering and observation to even tell that the dynamic of craft near L3 in the top picture vs bottom picture is any different. For gameplay purposes, they are identical.

But for gameplay purposes, what you see above is not identical for L4 and L5, unless you match SMAs exactly down to every digit of precision. That limited dynamic stability does make a difference.  Also, the need to get close to the points makes them distinct, in the current situation, you don't have L3, L4, and L5 points, you have an "L-Ring". I don't think that's the same as far as gameplay, even if it is the same at the precise points, the lack of differentiation of those points from the rest of the ring is something different, and that difference means there is no longer any gameplay significance  to those 3 points.

On 2/9/2022 at 8:45 AM, K^2 said:

L1 and L2, in contrast, are simply gone. They are not a feature on the bottom image. If you want to place an object where L1 or L2 would have been, it will drift away from there in a hurry. These points aren't just unstable, they aren't equilibria at all. The entire topic of discussion is, can we reasonably bring in an approximation of these into the game? And the answer is yes. If you build small plateaus in potential where you want the pseudo-L1 and L2 to be located, it will work. 

How will this work exactly? putting in attractors will result in naked singularities inviting all sorts of crazy oberth maneuvers, even if you make them "weak", because they are still singularities, with infinite gravity as one gets close to the source.  

One thing I do in KSP for L4 and L5, is to put actual bodies there, preventing naked singularities, even if the body is smaller than Gilly. But this doesn't even work for L1 and L2, as the bodies (and associated gravity wells) are on rails according to patched conics, and the patched conics system won't have them stay in the same position relative to their body. I can put a Trojan asteroid at Jools L3, L4 or L5 points, I can't put a similar asteroid at Jool's L1 or L2 points, because that asteroid won't stay at the L1 or L2 point.

And of course, having a small asteroid at every lagrange point is going to look silly (even if you manage to fix the system so that the asteroids can orbit to stay in quasi L1/L2, by having them each on a different gravity "layer"/ having them pulled stronger/weaker by the primary body), which brings you to the naked singularity... which I suppose you could maybe try to have an SOI of zero gravity inside an SOI of some gravity, so instead of hitting a body's surface or continuing to a singularity, you change SOIs to a zero grav zone... but this would require changing the SOI system specially in these cases so that yu transition to an SOI whose gravity should not be dominant...

These solutions are all very messy, and not so simple to implement.

However, I think that the choice is not just full N-body physics, or patched conics.

Surely we can ignore the mass of the spacecraft. In this case, for a system like Rask and Rusk, its just a standard 2 body problem for the massive bodies: patched conics works fine. For something like the Kerbolar system, I fully expect everything to remain on rails, treated as a series of 2 body problems.

This doesn't mean that our spacecraft, whose gravitational effects can be safely ignored, has to use patched conics of N-body all the time:

https://www.sciencedirect.com/topics/physics-and-astronomy/three-body-problem

Quote

this problem does not have a general solution and thus we usually consider simplified formulations justified by physical reasoning. In this chapter, we consider three simplifications. We assume that:

1. One of the three bodies has negligible mass compared to the other two bodies (for instance a spacecraft under the influence of the Sun and the Earth).

I haven't read up on this subject in detail recently, but its my understanding that with this simplication, a general solution can be found.

Its not N-body physics, but its not going ot be just conic sections either.

Edited by KerikBalm
Link to comment
Share on other sites

8 minutes ago, KerikBalm said:

But for gameplay purposes, what you see above is not identical for L4 and L5, unless you match SMAs exactly down to every digit of precision. That limited dynamic stability does make a difference.  Also, the need to get close to the points makes them distinct, in the current situation, you don't have L3, L4, and L5 points, you have an "L-Ring". I don't think that's the same as far as gameplay, even if it is the same at the precise points, the lack of differentiation of those points from the rest of the ring is something different, and that difference means there is no longer any gameplay significance  to those 3 points.

They are identical for gameplay purpose. We aren't looking to fully simulate the dynamics - that would by the very definition require full N-body simulation. But it's also not what people are asking for. What people want is be able to place a replica or re-imagining of a real or proposed spacecraft that utilize these points. For gameplay purposes, you can place a spacecraft near the location where L3, L4, or L5 would be found in the real world and have it stay in general neighborhood of that point arbitrarily long. There are no perturbations or sources of external force, so having an equilibrium is all you need.

12 minutes ago, KerikBalm said:

How will this work exactly? putting in attractors will result in naked singularities

Already addressed in the thread.

14 minutes ago, KerikBalm said:

I haven't read up on this subject in detail recently, but its my understanding that with this simplication, a general solution can be found.

In general, a 3 body problem, with 3rd body of negligible mass, produces a chaotic solution for that 3rd body. There can be closed form approximations for certain special cases. Some of them are well known. However, it does not cover the general case, which we need for the game, and approximations aren't always good enough even for cases where they are available.

So while yes, there are things you can do to clean up the problem and use in things like mission planning, if you are simulating the game, you still have to rely on numerical integration, and the fact that the system exhibits chaos, would require very fine precision as you are integrating forward.

This isn't impossible in principle, but given that even at 100k time warp, which is the limit in KSP, any sort of interstellar mission would take a while and there can easily be dozens to hundreds objects one has to simulate, this becomes a very hard numerical problem. Add to it the need to project orbits forward and all the shenanigans that come with multiplayer, then consider requirement of this whole thing running on a console and not even natively, but via C# compiled to CIL? All of these things you can work on. You could maybe discard debris a lot easier to keep number of simulations down. Maybe not project future trajectory as far forward or not worry about potential SoI intercpets as much. You can compile native code to run the integration more efficiently. You can do very fancy implicit integration methods to reduce errors. There is a lot of room for optimization here.

Or you can just keep using patched conics and fake what you need for gameplay. Again, keeping in mind that we're more interested in supporting the mission profile than providing 100% accurate simulation.

Link to comment
Share on other sites

22 hours ago, KerikBalm said:

How will this [SOIs with no significant central mass] work exactly?

Well, conceptually the radius of the SOI is related to the central mass, but in the implementation there are separate parameters sphereOfInfluence  and gravParameter to express the central mass.  (I don't think anyone has set those parameters independently using Kopernicus, so maybe KSP1 computes sphereOfInfluence based on gravParameter behind the scenes.) 
Someone could program a game to check if a craft is inside an arbitrarily large SoI, and then when it is time to calculate Kepler orbits, apply gravParameter=0, so the potential energy is a flat plateau inside the SoI, and the Kepler orbits degenerate into straight lines in a frame of reference moving with the SoI.  
Someone else mentioned a harmonic potential, like a linear spring pulling toward the centre of the SoI, so the force gets weaker as you get closer, which also has orbital shapes that you can write out with sines and cosines.  

I would not guess that either of these SoI solutions would add to the fun of a game. 
With KSP1 and Principia, I enjoyed trying to get a craft to pseudo-orbit the L4 point, mostly because that pseudo-orbit is so strange.   I never considered placing something in an orbit identical to Mun's but 60° advanced and calling that 'L4'. 

So I agree that Lagrange points require N-body gravitation.
Only our craft need to feel gravity from N bodies at once (so the "restricted N-body problem" you referenced).  And to play with Lagrange points, and experience other complicated motions around Rask & Rusk, our craft need only feel gravity from N=2 planets at once.

Edited by OHara
grammar
Link to comment
Share on other sites

1 hour ago, OHara said:

Only our craft need to feel gravity from N bodies at once (so the "restricted N-body problem" you referenced).

Even in KSP, there are edge cases where this assumption breaks down, but in KSP2 this is completely unworkable. First of all, multiplayer. Anyone can take over any ship at any time. Second, some ships are going to be traveling under power for a long time. Again, there could be arbitrarily many of these. And crucially, if you are flying a long duration mission, you've set your thrust, you checked the trajectory, and then switched to a different craft, you can't have the trajectory change. Which means, it has to stick to the n-body. Since the game isn't clairvoyant in so far as what you want to use for your missions, that means that any part that came from any ship that has been flown should be considered still a part of the mission, and therefore be on n-body system. And that's basically everything in the game.

So it's really an all or nothing. You can't swap between n-body and patched conics in KSP2 in any remotely reasonable way. It might be ok if you're just doing it to handle the Risk system, but not as a general solution.

Link to comment
Share on other sites

  • 2 weeks later...

Do we really have to put a mass at a pseudo SOI to fake Lagrange points? We do know closed form solutions (solutions with a formula, which require less or no integration) for a lot more problems than the 1/R²  2-bodies problems, isn't there one of them that would be more suitable ? That would better approximate what happens in the vicinity of Lagrange point ? At least better than 1/R^2 ?

I haven't looked closely at the question, but what first comes to mind is a first order approximation of both body influence. I might be overly optimistic as it likely does not have any closed solutions, but if they do, first it could allow to have not only Lagrange points but also halo orbits (and to not have orbits we're not supposed to have), and second, it might be a strict step up from patched conics realistically speaking, which is less clear with a fake mass.

Link to comment
Share on other sites

×
×
  • Create New...