CMDRennie Posted February 26, 2023 Share Posted February 26, 2023 This quickly became a hot topic in another thread, so I’m creating this one for a dedicated discussion. Keep in mind that most of this is hypothetical as the developers have already chosen not to implement such a system in KSP2. And are unlikely to retroactively change the core physics of the game. Quote Link to comment Share on other sites More sharing options...
garwel Posted February 26, 2023 Share Posted February 26, 2023 Indeed, there is nearly zero chance that N-body physics will be implemented in KSP2. It's a big overhaul of the fundamental systems of the game. I have another idea that might, just might, be more feasible: three-body physics. Basically, instead of having just the vessel and the main body, the physics system might also include influence from the second most influential celestial body. It would be Kerbin when you are near Mun or Minmus, Sun when in a planetary orbit and so on. I think it could still be done using the existing patched conics approach and would be reasonably realistic while not too computationally difficult or unstable. It would allow you to have Lagrange points, for instance. The SOIs would have to be much bigger (e.g. Mun's SOI would end at a point where the Mun's influence gets stronger than the Sun's), but crossing them would have a smoother effect on the trajectory. Quote Link to comment Share on other sites More sharing options...
CMDRennie Posted February 26, 2023 Author Share Posted February 26, 2023 On 2/26/2023 at 10:14 AM, garwel said: I have another idea that might, just might, be more feasible: three-body physics. Basically, instead of having just the vessel and the main body, the physics system might also include influence from the second most influential celestial body. Expand I like this approach. I feel like it would be a fairly accurate representation of full n-body physics without allot of the computational and stability problems. I’m not a coder though, so I’m only guessing. Quote Link to comment Share on other sites More sharing options...
tstein Posted February 26, 2023 Share Posted February 26, 2023 On 2/26/2023 at 10:56 AM, CMDRennie said: I like this approach. I feel like it would be a fairly accurate representation of full n-body physics without allot of the computational and stability problems. I’m not a coder though, so I’m only guessing. Expand IT is equally hard to implement N-Body and 3 Body physics. Seriously if you allow only bodies above certain mass to add their pull to the n-Body loop (while all bodies are subject to it) you can have somethign really smooth. THat if you put some good developer doing it, not the way the resources of this game were used. A lot of people already implemented this type of thing for fun. It is not hard. It can be problematic only if you want asteroids to affect each other's paths,but I do not think that is what players expect. Quote Link to comment Share on other sites More sharing options...
HenryBlatbugIII Posted February 26, 2023 Share Posted February 26, 2023 (edited) On 2/26/2023 at 10:14 AM, garwel said: I have another idea that might, just might, be more feasible: three-body physics. Basically, instead of having just the vessel and the main body, the physics system might also include influence from the second most influential celestial body. It would be Kerbin when you are near Mun or Minmus, Sun when in a planetary orbit and so on. I think it could still be done using the existing patched conics approach and would be reasonably realistic while not too computationally difficult or unstable. It would allow you to have Lagrange points, for instance. Expand Unfortunately, that won't work. The entire point of patched conics is that, as long as you're only affected by one body at a time, the orbits are conic sections. Therefore, they're easily calculable (by both the simulation and the players) and long-term stable. As soon as you add another gravitational body, you've given up both of those benefits (and gained others, like the Lagrange points you mentioned). In terms of computational load and ease of gameplay, that three-body approach is much closer to a full n-body approach than to the patched conics system. Edit: oops, ninja'd Edited February 26, 2023 by HenryBlatbugIII Quote Link to comment Share on other sites More sharing options...
Kermann Nolandung Posted February 26, 2023 Share Posted February 26, 2023 We do not need n-body physics. The patched conic approximation is not without interest considering that it is/was actually used for mission planning. At least it makes the navigation calculations accessible to the player and the orbital parameters remain fixed in the absence of thrust. I don't see the point of putting in an overly complicated model that requires extra computational resources, and then having to push a button on a mod that calculates the optimal trajectory automatically. You can play with matlab, gmat or whatever for that. What I would like to see is a fictitious oblatness with a J2 effect on the orbit drift that only works when the physic is on rail. This would allow a Kerbol-synchronous orbit. Quote Link to comment Share on other sites More sharing options...
tstein Posted February 26, 2023 Share Posted February 26, 2023 On 2/26/2023 at 11:41 AM, Kermann Nolandung said: We do not need n-body physics. The patched conic approximation is not without interest considering that it is/was actually used for mission planning. At least it makes the navigation calculations accessible to the player and the orbital parameters remain fixed in the absence of thrust. I don't see the point of putting in an overly complicated model that requires extra computational resources, and then having to push a button on a mod that calculates the optimal trajectory automatically. You can play with matlab, gmat or whatever for that. What I would like to see is a fictitious oblatness with a J2 effect on the orbit drift that only works when the physic is on rail. This would allow a Kerbol-synchronous orbit. Expand Lets put this way this game waste computational resources left and right for useless stuff. N-Body would be a drop in the ocean in this scenario (if implemented by a competent developer and in a language proper for this like C++ or Rust). N-Body physics still adds more to the game than kerbal expressions or kerbals rendering inside capsule, or even more than PAINTING the ship (that seems to be the only feature they really worked on). So let people dream. Quote Link to comment Share on other sites More sharing options...
Vl3d Posted February 26, 2023 Share Posted February 26, 2023 We don't need full 3/N-body. We just need Lagrange points. Quote Link to comment Share on other sites More sharing options...
tstein Posted February 26, 2023 Share Posted February 26, 2023 On 2/26/2023 at 11:53 AM, Vl3d said: We don't need full 3/N-body. We just need Lagrange points. Expand That is one view, but there are lots of things that N-Body allows besides lagrange points. THis is a good example Quote Link to comment Share on other sites More sharing options...
Vl3d Posted February 26, 2023 Share Posted February 26, 2023 On 2/26/2023 at 12:45 PM, tstein said: That is one view, but there are lots of things that N-Body allows besides lagrange points. THis is a good example Expand I know, but n-body means iterated numerical calculations for positional coordinates. The game cannot perform well without analytic solutions. Quote Link to comment Share on other sites More sharing options...
tstein Posted February 26, 2023 Share Posted February 26, 2023 (edited) On 2/26/2023 at 1:26 PM, Vl3d said: I know, but n-body means iterated numerical calculations for positional coordinates. The game cannot perform well without analytic solutions. Expand It can as I posted here more than once time. In one afternoon I made an implementation that can process 42 days ahead per SECOND on a Rysen 1 in our real solar system with all the planets and up to 8 moons each on each planet . It is really feasible for a good developer. That without ANY time spent optimizing it. If I spent a couple of days making some parts in intrinsics I am sure I could get to almost 3 times that. The biggest change a n N-Body game need is programability of course adjustments. So we coudl program the ship to automatically try to compensate after deviations reach certain X level. That would be needed to avoid issues of people losing their ships. It is very doable, but it woudl be a game very different from KSP. Edited February 26, 2023 by tstein Quote Link to comment Share on other sites More sharing options...
Kermann Nolandung Posted February 26, 2023 Share Posted February 26, 2023 With patched conic, the motion is described in a locally inertial reference frame, this is quite practical. If we go with n-body physics, in addition to the other gravitational forces, we must take into account the forces of inertia if we are not in the kerbol frame and we can continue as well with J2, solar pressure and even satellite emissivity. I can see some interest for few specific missions. In this case, why not install on these specific probes or vessels a massless engine that simulates all the orbital disturbances encountered while still remaining within a keplerian motion. Quote Link to comment Share on other sites More sharing options...
tstein Posted February 26, 2023 Share Posted February 26, 2023 On 2/26/2023 at 2:58 PM, Kermann Nolandung said: With patched conic, the motion is described in a locally inertial reference frame, this is quite practical. If we go with n-body physics, in addition to the other gravitational forces, we must take into account the forces of inertia if we are not in the kerbol frame and we can continue as well with J2, solar pressure and even satellite emissivity. I can see some interest for few specific missions. In this case, why not install on these specific probes or vessels a massless engine that simulates all the orbital disturbances encountered while still remaining within a keplerian motion. Expand The other forces are so small that they can be ignore in this scale unless you build ships meant to harvest them. I do not think it is useful for example to compute the movement of Kerbol relative to other stars for example on the timeframe of the game Quote Link to comment Share on other sites More sharing options...
GregA Posted February 26, 2023 Share Posted February 26, 2023 Thread Theme: Quote Link to comment Share on other sites More sharing options...
TechDragon Posted February 28, 2023 Share Posted February 28, 2023 Whenever this comes up, I just point to the n-Body addon developed for KSP1, Principia If a bunch of people can mod this sort of thing into KSP1... It goes to show how this sort of thing is doable, even if we have to do it ourselves. Of course, this does depend on them not somehow hobbling mod support so that such extensive mods are impossible... which given the goal includes multiplayer, I worry may happen... Multiplayer and Mods seems to be a bridge too far for many development teams. The missing n-Body and the current wobbly unity joint physics makes me worried that very little effort has been put into the "rocket physics" in the vacuum of space as opposed to the apparently pretty good airplane physics (haven't made a plane yet, I like rockets more) which would obviously be a good fit for multiplayer dogfighting or just general flying contraptions with friends. This also makes sense when I hear about bugs like phantom sea level drag stuff like this. Its hard to not notice this sort of thing if you put something into a close orbit to take cool screenshots while whipping over the surface of a moon close enough to feel like your flying over it. Quote Link to comment Share on other sites More sharing options...
MarcAbaddon Posted February 28, 2023 Share Posted February 28, 2023 My only remark here is that I don't really want Lagrande points patched into the SOI model. It'll lead to weird situation at the boundary, and has most of the drawbacks of full n-body (for the player in terms of predictability, I can see it is easier to implement from a dev perspective) and little advantages. Considering that currently even the SOI orbits aren't working without issues, n-body physics isn't something I want added at this stage either. Let's just fix the basics please. Missing n-body has great advantages from the gameplay perspective, so it's not the same kind of issue as with the wobbly physics. Quote Link to comment Share on other sites More sharing options...
TechDragon Posted March 1, 2023 Share Posted March 1, 2023 Having made a plane in the last half a day since my original post, yeah planes feel fantastic, I just chucked something together with big old wings and the afterburning fast jets, did a liftoff strait into a zoom climb and had an apogee around 37km, and it was a bit chaotic as i dropped back into the atmosphere, I definitely did some maneuvering where I feel KSP1 would have ripped my wings off, but I think (it was a black plane at night, so I'm not completely confident of this) the wings didn't even flex, it was like I was flying a solid object. The wobbliest bit of my plane was the wheels on the landing gear! I'm really tempted to make a space plane to see if launching from the runway makes rockets less wobbly, the physics just felt that different. Which puts me back to my concerns about what the focus of development efforts has been. I am while not convinced, pretty confident much more time has been spent polishing planes and flying, because flying is more conducive to a "dynamic" and "interactive" multiplayer experience in "real time together" as opposed to orbiting rockets, where orbital phasing takes a while, frequently requires a time-warp or two if you don't have all day, and then docking is slow and steady to the point quite a lot of people find it boring... Its a fun challenge to do by hand on a new craft which you've never flown before, but it does get tedious to repeatedly dock refueling flights or crew transfer flights. As a developer it feels very understandable to have prioritized things this way, but it does make me worried that were in for a long slog of space related bugs... I hope I'm wrong. Quote Link to comment Share on other sites More sharing options...
mcwaffles2003 Posted March 1, 2023 Share Posted March 1, 2023 On 2/26/2023 at 10:14 AM, garwel said: I think it could still be done using the existing patched conics approach and would be reasonably realistic while not too computationally difficult or unstable. It would allow you to have Lagrange points, for instance. Expand the ellipses that makeup orbits are conic sections, hence patched conics. 3 body gravity would not be made of ellipses, nor is it predictable in the way patched conics are Quote Link to comment Share on other sites More sharing options...
LostElement Posted March 1, 2023 Share Posted March 1, 2023 I hope that the modability of KSP 2 is even better than KSP 1, so if someone chooses to overhaul how physics works via a mod, they could. Quote Link to comment Share on other sites More sharing options...
garwel Posted March 1, 2023 Share Posted March 1, 2023 On 3/1/2023 at 4:57 AM, mcwaffles2003 said: the ellipses that makeup orbits are conic sections, hence patched conics. 3 body gravity would not be made of ellipses, nor is it predictable in the way patched conics are Expand I probably used the wrong term. I meant that this could be done using the approach of dividing space into spheres of influence and drawing the trajectory in each SOI. Of course, the shapes will be different from the current simple keplerian ellipses. But if we assume that the second most influential body is the main body's parent (which will be the case in 99.9% situations), they shouldn't be too hard to compute or predict. Quote Link to comment Share on other sites More sharing options...
Guest Posted March 1, 2023 Share Posted March 1, 2023 (edited) On 3/1/2023 at 7:44 AM, garwel said: But if we assume that the second most influential body is the main body's parent (which will be the case in 99.9% situations), they shouldn't be too hard to compute or predict. Expand That's called the circular restricted three-body problem and it is pretty hard to compute and predict, unfortunately – also unliked patched conics it doesn't have an analytical solution, you have to integrate over time, so you can't just jump to any arbitrary point in time. If you're curious, here's a fairly detailed description: https://orbital-mechanics.space/the-n-body-problem/circular-restricted-three-body-problem.html Edited March 1, 2023 by Guest Quote Link to comment Share on other sites More sharing options...
garwel Posted March 1, 2023 Share Posted March 1, 2023 On 3/1/2023 at 8:26 AM, Periple said: That's called the circular restricted three-body problem and it is pretty hard to compute and predict, unfortunately – also unliked patched conics it doesn't have an analytical solution, you have to integrate over time, so you can't just jump to any arbitrary point in time. If you're curious, here's a fairly detailed description: https://orbital-mechanics.space/the-n-body-problem/circular-restricted-three-body-problem.html Expand Interesting, thanks for the link, Quote Link to comment Share on other sites More sharing options...
tstein Posted March 1, 2023 Share Posted March 1, 2023 On 2/28/2023 at 1:26 PM, MarcAbaddon said: My only remark here is that I don't really want Lagrande points patched into the SOI model. It'll lead to weird situation at the boundary, and has most of the drawbacks of full n-body (for the player in terms of predictability, I can see it is easier to implement from a dev perspective) and little advantages. Considering that currently even the SOI orbits aren't working without issues, n-body physics isn't something I want added at this stage either. Let's just fix the basics please. Missing n-body has great advantages from the gameplay perspective, so it's not the same kind of issue as with the wobbly physics. Expand Sure this discussion is not even that KSP centric, it is more a daydreaming. A game that employs N-Body is likely a game that would would want to play with data efficient interface (and not a 3D rendering of the world). It woudl be much more like a complex mission planner than an exploration game like KSP. A different game. I would love to play it (I have hundreds of hours playing SUB games were you have nothing rendered except contact bearings in a crude map and you hear reports and give most commands by voice ), but some people would not. Quote Link to comment Share on other sites More sharing options...
pandaman Posted March 1, 2023 Share Posted March 1, 2023 My 'gut feeling' on the N body debate is that it would likely cause far more problems, and apparent 'bugs', that are actually a result of it working properly than it may seem. If Patched Conics works well, and predicably and reliably, and is good enough for NASA to plan things, then I don't see any real advantage of changing it. Sure, Lagrange points etc would be a nice feature, but not at the expense of other potentially gameplay wrecking behaviour or increased computational load. Quote Link to comment Share on other sites More sharing options...
Gotmachine Posted March 1, 2023 Share Posted March 1, 2023 On 2/26/2023 at 1:26 PM, Vl3d said: n-body means iterated numerical calculations for positional coordinates. The game cannot perform well without analytic solutions. Expand Simple keplerian orbit ("patched conics") is analytic but it doesn't have a closed-form expression either, it's also an iterative algorithm. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.