#Venus's gravity is kinda wonky?

40 messages · Page 1 of 1 (latest)

carmine ridge
#

Build: 0.14.0.14 (64)
Vanilla install (no mods)

First, apologies if this is less of a bug and more of an unfinished thing!

When near Venus you are constantly pulled toward the planet itself. This makes doing any manuever around the planet require SO MUCH delta V because you are constantly fighting against it actively pulling you down. This is particularly noticeable after you undock from VORB and immediately begin to 'fall' toward the planet.

granite shell
#

Gravity pulling near Venus is intended, but there is indeed a bug causing gravity on ships to be stronger than VORB (and other permanent satellites).

I haven't looked into this enough yet to know which one is correct, but one of them is, and we have to fix the other 😅

carmine ridge
#

I'm not sure I understand why we would be falling towards venus if we just undocked from VORB, though? Relative to Venus we should be going nearly the same speed as VORB, minus a few m/s from the undocking, so our orbit should be extremely similar. Am I misunderstanding what you mean?

dusky ibex
#

the Gravitational pull of Venus is 91% of earth's. The delta-v, needed to escape the gravity is above 10.36km/s. rounded up you'd want 10.4km/s

#

You might be able to do some flying along with the orbit and then try and pull away, but I'm not sure how well that is calculated. What this means is you have too little thrust. Every time you expand your ship add more thrusters, and more N2.

neat tapir
#

You shouldn't be falling into Venus after undocking as your speed should be similar to the station.

frozen hawk
carmine ridge
#

Exactly. You should be retaining the velocity from the station, minus whatever it takes to undock. You should not begin to fall toward the planet.

#

Escaping the planet is one thing, but it should require way, way less deltaV to manuever around in orbit.

#

I made these for general some time ago. They're exaggerated to try to get across what I mean

#

Yellow ring around venus is just its rotation

pure sparrow
#

That assumes you exit behind vorb. If you exit in the same direction then you'll be falling up as your total velocity is (vorbs)+(your new delta)

carmine ridge
#

Even if that were the case you would not fall in a straight line to it.

#

because you still have most of that velocity

#

If you undocked in front of VORB you'd actually have an orbit slightly further out. Instead of being in a bit more in the second image, it'd be out more

neat tapir
# granite shell Gravity pulling near Venus is intended, but there is indeed a bug causing gravit...

I wonder if this is related to the acceleration/deceleration issue I was noticing, where it seems like the effect of celestial bodies on the player ship are exaggerated by 10x what they should be. Out by Ganymede for example, the pull of the Sun should be 0.001 m/s, but I'm getting 0.01 m/s. If we are getting 10x the pull from Venus than we should be, that would probably explain what is going on.

granite shell
#

Based on the VORB case, 10x seems like a lot. But it's definitely more than it should be (unless VORB is on a bogus orbit).

Just to explain a bit more, our celestial bodies (and stations) use a pre-baked orbit. We tell the game the orbital radius, orbital period, and eccentricity, and it just animates them around the System.

We do this to avoid expensive gravity/distance simulation calculations every frame on all the bodies/stations in the game.

Chances are that whatever equation we're using for orbit animation is mismatched with the ones we use for simulation.

The question is, which one is wrong?

This one's been on my radar for a while, and I just haven't had time to sort it out. But I'll log it officially anyway!

frozen hawk
#

Yep, I guessed this might be the source of the misconvergence. Perhaps the station orbit needn't be so low, or the gravitation (mass of Venus) could be weakened? Loosening the reality might serve playability, I suppose?

carmine ridge
civic topazBOT
#

Gave +1 Rep to @granite shell (current: #27 - 9)

carmine ridge
#

Oops I did not mean to reply to you, sorry

dusky ibex
gentle turtle
#

@granite shell 5 minutes of your time. I spent a couple of hours today tracking this issue and I found the origin.
Long story short: When undocking from VORB the ship is affected by two acceleration forces: The normal one from Venus that updates and behaves normally and a second one that get “stuck” accelerating the ship towards the direction Venus was at the moment of undocking pulling the same g’s experienced at that moment. The compound pull causes the discrepancy between station orbit and the ship’s; essentially doubling Venus’s gravity at undocking, but the stuck acceleration will not stop.

I provide two clean new savegames from the .17 patch to show the how the bug manifests.
Savegame 1:

  • The ship was undocked from VORB at relative position 0 degrees in relation to Venus. Venus is at 180 degrees at 0.37g. This will be the direction of the bugged pull
  • The ship is brought to a stop relative to Venus at 0ms VREL and VCRS at +3000Km distance at roughly 270 degrees relative to Venus.
  • Expected behavior in this stopped state should cause the ship to drop like a stone towards Venus with little VCRS
  • Observed behavior: running at 16x shows how the ship drops towards the south of the planet skimming the atmosphere at 600Km, not falling into the planet and constantly accelerating away from Venus. Fun to watch.

Savegame 2: Basically, the same behavior but in a less extreme case, showing how undocking from the 180 degrees position and Venus at 0 degrees the ship experiences constant acceleration towards 0 degrees.

#

It should be obvious that it is working when is fixed but for future test the steps to reproduce are:
-Dock at VORB.
-Undock and accelerate prograde for a quarter orbit.
-Bring the ship to a stop relative to Venus.
-Ship should accelerate only towards Venus following the barycenter line.

granite shell
#

Thanks for the additional sleuthing! That test case sounds like it might be handy for teasing out the bug.

gentle turtle
# granite shell Thanks for the additional sleuthing! That test case sounds like it might be hand...

I tracked the bug in the code. It is caused by the call to ShipSitu.CopyFrom originating from Ship.Undock.

CopyFrom not only causes the ship to inherit the parent velocity but its accelerations! In the case of this manifestation of the bug in Venus, after undocking from VORB The ship inherits vAccEx.x and vAccEx.y acting permanently on the ship until you dock to another station, and inherit a new vAccEx value from the new station.

After examining some saves from other players, I’m going to make an assumption and say that this is the same source of the bug of fast spinning derelicts: Hauler undocks from derelict while actively rotating => derelict inherits a permanent rotational acceleration => docking with the ship causes the derelict to update and increase fRot constantly.

A quick hotfix for player ships might be to call for ShipSitu.ResetAccelerations from CrewSim.UndockShip. I can see how it might break some things if implemented in Ship.Undock.

I hope is that easy… It is never that easy…

gentle turtle
#

I solved the issue mentioned above privately in my game and did some additional testing to check for the discrepancies between real time simulation and the pre-baked VORB orbit.

Real-time ship simulation seems to be roughly correct and functional for orbital speed, distance and G values at different altitudes, AFAIK. Because it’s hard to do this on manual with just VREL and VCRS.
Venus’ Hill sphere is an order of magnitude smaller than it should. It might be caused by rounding or another problem. Probably worth looking into when the time comes to give the simulation another update.

Regarding VORB. There are problems with the station orbit. Maybe this helps to troubleshoot how the orbits are generated:
1- The station orbits at 3.37Km/s at periapsis. This value should be at least 7,10 Real value should be 8.5 given the eccentricity of the orbit.
2- Ships seem to fall toward Venus because at that altitude you’d need at least 7,10Km/s to stay in orbit. And they only get 3.37 from the station.
3- Orbital period for current VORB orbit should be around 14500s (4h). From the json files now it is closer to 36000s (10h).
(edited typos, doing this while sick with covid sucks)

tribal minnow
#

As I understand you, one possibly always contracts some static acceleration during undocking. You desription matches my observation at VORB. Apart from being flung out of the solar system when undocking from VORB, it would explain why it sometimes feels like you have to push through syrup out at the home asteroid. I have also never been abel to achive a "stable" orbit anywhere around anything. I ascribed that to my halfbaked understanding of orbital mechanics but also felt like theres something off with gravity.
Good job digging into this.

granite shell
#

First of all, sorry to hear you caught Covid! Hope you're feeling well again soon.

Secondly, just following-up to say it was indeed a period problem. I was re-checking all the gravity/acceleration physics like you while on the plane the other day, and banging my head against the wall when it all came back accurate.

Should've checked here first! I didn't see your updated info until today.

Anyway, this appears to be a potential problem with any body that has both axes and period defined in json. If the period doesn't match the axes, we get this behavior.

#

Sometimes this is desireable, such as aerostats and nav buoys, which aren't freely orbiting.

#

But VORB isn't one of those cases, so I changed the game to dynamically calculate a good period for any body that leaves the period field 0 on load.

#

Then I changed VORB's data to have period = 0. But since that only affects new games started after this patch goes live, I'll also add code to repair old saves.

#

This has the side effect that anyone near VORB will load their save and likely be far from VORB afterward. But it'll at least mean undocking from VORB after the patch is stable orbit again.

#

Thanks again for your help!

gentle turtle
# granite shell Thanks again for your help!

Glad to be helpful, and thank you for creating a wonderful game!
To be honest I was hesitant about pointing out the exact issue directly, I didn't want to sound like the smartass who has just recently arrived to start spouting out "this is whats wrong with the code" after a superficial look. Better to be cautious and respectful about anybody's work.

#

Anyway, it's fixed, hopefully this appeases Kepler's ghost for a while.

fair narwhal
#

And while I'm at it, here's another thing. Being docked with an aero shuttle seems to give you antigravity, the planet starts repelling you instead of attracting. Is this somehow related to this?

granite shell
#

Same orbital track, just faster velocity.
For the aero shuttle, I don't know offhand what that is. But I'd guess it's a separate issue, perhaps with lift and/or drag. Worth starting a new thread, if you don't mind.

long wyvern
#

For anyone experiencing the Docking Rotation glitch before its patched:

I managed to patch my save, after spinning uncontrollably post-undocking, by changing the "fRot" and "fW" to 0.0, in the [YOUR SHIP CALLSIGN].json in the save file zip.

(For reference, it was above 6k, and the stars in the background was not moving, they were flashing)