LunaMultiplayer / TiltEm

Planetary axial tilt for KSP
MIT License
10 stars 3 forks source link

Line of nodes randomly changing. #2

Closed OhioBob closed 5 years ago

OhioBob commented 6 years ago

I've found a problem. The line of nodes of the equator randomly changes from one game launch to the next. For instance, put a satellite in an equatorial orbit (you'll have to figure out the LAN by trial and error). Shut the game down and restart. The planet's axis will now be pointed in a different direction and the satellite will no longer be orbiting around the equator. I did it three times. First time the LAN was 84.54 degrees, second time it was 198.33, and the third time it was 266.13.  It looks just like a problem we use to have with planetary rings. Any time we tried to incline rings, the LAN kept randomly changing. Kopernicus eventually added a longitudeOfAscendingNode parameter for rings that locked down their orientation. It looks like you may have to do something similar with axial tilt.

gavazquez commented 6 years ago

Ok so I've changed a lot the code yesterday so I'm not sure if the same applies:

Current kerbin rotation:

    Kerbin
    {
        TiltX = 45
        TiltZ = 0
    }

First test: Orbit above of the planetarium rotation (high altitude orbit)

1- image 2 - Saved & closed the game 3- Loaded the save and selected the same vessel 4- Planet tilt is fine: image


Second test: Orbit above of the planetarium rotation (low altitude orbit)

1- image 2 - Saved & closed the game 3- Loaded the save and selected the same vessel 4- Planet tilt is fine: image

gavazquez commented 6 years ago

@OhioBob I think that this commit fixed it https://github.com/LunaMultiplayer/TiltEm/commit/5bab737da4747b5e44407689f901b8e999f58aae

As I've even tried with different tilts and it's consistent across game restarts. Let me know if that's what you've meant

OhioBob commented 6 years ago

The difference between your tests and mine its that I put the vessel in an orbit around the planet's equator. I'm using version 1.0. Here are some screenshots of my test...

https://imgur.com/a/qELDC7O

If the issue is the same that we had with planetary rings, then putting the satellite in an equatorial orbit is required to trigger the problem. The rings would shift plane only when we tried to put another body in the same plane as the rings. And I'm seeing the same thing here. The problem is triggered only when the satellite is placed in an equatorial orbit. When I do the test the way that you did it, I don't have the problem either. You have to do it the way that I did it.

OhioBob commented 6 years ago

I just tested in 1.1 and the bug is still present. To trigger the bug, you MUST put the satellite in an equatorial orbit. I have more screenshots if you need to see them, but it's just another example of what I've already showed you.

I think the problem is that the X and Z axes are not fixed in relation to the celestial sphere. So defining axial tilt in X and Z angles locks the rotational axis in position in relation to the XYZ axes, but not to celestial latitude and longitude.

I think you may have to defined tilt as a function of tilt angle and longitudeOfAscendingNode (of equatorial plane), rather than X and Z angles. Or maybe give the latitude and longitude of the north pole, which is how it's done in real life.

It appears you're dealing with the same problem Kopernicus had to solve for planetary rings. I suggest you take a look at how Kopernicus solved it.

gavazquez commented 6 years ago

Yeah either that or tilt the planet as a function of the orbit epoch. Will ask Thomas once I'm back from holidays

gavazquez commented 6 years ago

It's already fixed on 1.1.0 altough that version have some other problems

njbrown09 commented 5 years ago

Yeah this is definitely an issue. It causes the tilt angle of the planet to change. I tried to align the moons of RSS saturn with the rings and every time i restarted my game saturn was tilted in a different way.