Jump to content

Asteroids and gravity


Recommended Posts

I'm positive it's buried in a devnote somewhere, but why don't asteroids have 0.0000001m/s^2 gravity?

I know this is a ridiculous desire, but my question is less about desire for it, and more about curiosity of if gravity is strictly linked to the rail system, or if it really chews up that much processing power, or if Squad just had better things to do than assign infinitesimal fractions of gravity to every class of asteroid.

Other reason I ask, is, if someone were to generate a custom asteroid that is, say, Phoebe size, would it be difficult to give it gravity AND be off rails? 

Link to comment
Share on other sites

1 hour ago, Venusgate said:

I'm positive it's buried in a devnote somewhere, but why don't asteroids have 0.0000001m/s^2 gravity?

Simple answer.  Asteroids are treated by the game exactly the same as ships, so you can target them and dock with them.  Ships don't have gravity so asteroids don't have it, either.

Link to comment
Share on other sites

I'm not sure what the official answer would be on this, however, consider the following possibilities: 

As Ges said, from a purely technical, game works like this way, the Asteroid is treated for the post parts like a large single piece Ship or Part debris. 

The game only deals in two body problems for Gravity, and the main source of gravity will be the Planet or Moon in the SOI that the Kerbal Ship and Roid are currently interacting. So the game will only deal with The Planet to Ship, and the Planet to Roid calculations. Ship to Roid calculations would become an N-Body problem, and that's not how the game works. 

From a practicality point of view, the infinitesimal micro-gravity presented by even the largest E-Class Roids in game is so small as to have nil observable effect in the game anyways. The gravitational effects would take days if not weeks of gametime to change anything about a ships interaction with the roid, and could be undone by reaction wheels or a kerbal sneeze. So there's really little to no point to it, as it wouldn't add anything to actual gameplay. (Pol/Bop can be painfully slow as it is...Roids would be orders of magnitude worse)

Link to comment
Share on other sites

In KSP, the gravity of a body is only applicable inside its SoI.

What would be an asteroid SoI radius equal to? The formula is rSoI = a∙(m / M)0.4.

So a 3000 t class E asteroid in a Solar orbit near Kerbin or a similar asteroid around Kerbin would have 27 m max SoI radius. Its SoI would be below its surface.

Well, near the apoapsis of Eeloo, the Soi radius of a 3000 t asteroid would be 223 m. So a ship can orbit it with the velocity of a few millimetres per second. With all that orbit wobbling we have in KSP, it would be impossible to keep such an orbit when not on rails.

Edited by Teilnehmer
Link to comment
Share on other sites

2 hours ago, Geschosskopf said:

Simple answer.  Asteroids are treated by the game exactly the same as ships, so you can target them and dock with them.  Ships don't have gravity so asteroids don't have it, either.

That's just an answer that leads to another question: Why don't ships have gravity? :P

Link to comment
Share on other sites

9 minutes ago, Venusgate said:

Why don't ships have gravity?

Oh oh I know this. I saw someone work this out - a ship like the real life Space Shuttle has a SOI smaller than the hull of the ship itself, as a manned spacecraft has a lot of empty space within unlike a dense ball of rock. There is no stable orbit around the space shuttle on the outside and once you get inside the shuttle some of its mass is now above your head and the gravity they are causing is cancelling out the gravity caused by the material below your foot.

In fact if you think about it, gravity is actually trying to tear the space shuttle apart instead of trying to get it to coalesce into a tiny ball. The reason is that different parts of the space shuttle are individually in different earth orbit and the orbital speed difference means they want to fly apart. The space shuttle only stays in one piece because the electromagnetic forces that keep the material rigid is so vastly stronger than earth's gravity.

 

Link to comment
Share on other sites

1 hour ago, Temstar said:

Oh oh I know this.

I didn't know about the SOI being too small for the hull. Neat!

To keep in line with the intent of my question though: just because the SOI is too small to have more than absolutely zero effect on outside craft is not a reason not give it a stat anyway. As I suggested, I think it's more of a "it has no effect, so instead of being super nerds and putting it in the game anyway, we'll be realists and not"

And my question is: is there a blank space in the code to enter these values, or is it hard coded to the rail system somehow?

 

Edited by Venusgate
Link to comment
Share on other sites

Well, they made an atmosphere for Kerbol (starting at 500 000m I think)  that is completly unreachable in stock KSP because of the heat ; so why not a stupidly low gravity ?

But I agree with purpletarget, it would be slow as hell, way worse than Gilly. And I already treat Gilly as an asteroid rather than a moon, because else everything happen so sloooooooowly, and stock time acceleration limits doesn't allow you to keep it from being super boring.

Link to comment
Share on other sites

I imagine it wouldn't be too hard to work up a mod that would apply gravity among asteroids and ships that are in near proximity. However, right off the top of my head I can think of two wrinkles that would be difficult to solve.

First, it would be prone to blowing up if the object count is large, since it's O(N^2) complexity. Though perhaps there might be some workarounds to help.

More troublingly, however, is that it just plain wouldn't work when time warp is on. Things run on rails in time warp, and you can't run an N-body system on rails because there aren't any rails.

The reason KSP can run on rails is because the only things that have gravity are themselves completely impervious to all forces, and the SoI system guarantees that only one body at a time can exert gravity on a ship. Remove those constraints and "running on rails" becomes mathematically impossible.

Now, if you want to have an asteroid with gravity, you could do that by actually modeling it as a planet, using Kopernicus; basically, just a really really tiny moon. You can fudge the SoI; the radius is calculated based on the mass by default, but you can override that to provide your own value.

However, if you do that, then it will act like a KSP planet: permanently on rails, you can't budge it a millimeter from its prescribed orbit, and you'd better make sure that its orbit doesn't intersect anything else's or you'll get weird buggy behavior.

Edited by Snark
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...