Jump to content

[1.4.x] Orbital Decay - Resumed v1.6.1.1, 04 Jun 2018


Recommended Posts

  • 2 weeks later...
  • 2 weeks later...
On 3/16/2020 at 1:39 AM, Daniel Prates said:

So you are using it with 1.9 and it works?

It doesn't, at least not out of the box.

Disregard, I have spoken too soon. After checking the first post, it seems CKAN only lists an even older version of OrbitalDecay.

Installing manually from the Github link in the OP, the corresponding dependency, as mentioned there too, and making sure ORBIT_DRIFT_COMPENSATION is set to false, KSP loads and runs. Watching for a while, there does not appear to be any actual change in orbital parameters though, and OD throws reams of exceptions. At least it does not block, if that does count for anything.

Spoiler
[...snip...]
        UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
[EXC 22:45:09.204] NullReferenceException: Object reference not set to an instance of an object
        WhitecatIndustries.Source.Settings.ReadNB () (at <e538635aa29c46c79a58fd67e58a78b6>:0)
        WhitecatIndustries.Source.DecayManager.RealisticDecaySimulator (Vessel vessel) (at <e538635aa29c46c79a58fd67e58a78b6>:0)
        WhitecatIndustries.Source.DecayManager.FixedUpdate () (at <e538635aa29c46c79a58fd67e58a78b6>:0)
        UnityEngine.DebugLogHandler:LogException(Exception, Object)
        ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
        UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
[EXC 22:45:10.310] NullReferenceException: Object reference not set to an instance of an object
        WhitecatIndustries.Source.Settings.ReadNB () (at <e538635aa29c46c79a58fd67e58a78b6>:0)
        WhitecatIndustries.Source.DecayManager.RealisticDecaySimulator (Vessel vessel) (at <e538635aa29c46c79a58fd67e58a78b6>:0)
        WhitecatIndustries.Source.DecayManager.FixedUpdate () (at <e538635aa29c46c79a58fd67e58a78b6>:0)
        UnityEngine.DebugLogHandler:LogException(Exception, Object)
        ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
        UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
[EXC 22:45:11.400] NullReferenceException: Object reference not set to an instance of an object
        WhitecatIndustries.Source.Settings.ReadNB () (at <e538635aa29c46c79a58fd67e58a78b6>:0)
        WhitecatIndustries.Source.DecayManager.RealisticDecaySimulator (Vessel vessel) (at <e538635aa29c46c79a58fd67e58a78b6>:0)
        WhitecatIndustries.Source.DecayManager.FixedUpdate () (at <e538635aa29c46c79a58fd67e58a78b6>:0)
        UnityEngine.DebugLogHandler:LogException(Exception, Object)
        ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
        UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
[EXC 22:45:12.492] NullReferenceException: Object reference not set to an instance of an object
        WhitecatIndustries.Source.Settings.ReadNB () (at <e538635aa29c46c79a58fd67e58a78b6>:0)
        WhitecatIndustries.Source.DecayManager.RealisticDecaySimulator (Vessel vessel) (at <e538635aa29c46c79a58fd67e58a78b6>:0)
        WhitecatIndustries.Source.DecayManager.FixedUpdate () (at <e538635aa29c46c79a58fd67e58a78b6>:0)
        UnityEngine.DebugLogHandler:LogException(Exception, Object)
        ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
        UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
[EXC 22:45:13.607] NullReferenceException: Object reference not set to an instance of an object
        WhitecatIndustries.Source.Settings.ReadNB () (at <e538635aa29c46c79a58fd67e58a78b6>:0)
        WhitecatIndustries.Source.DecayManager.RealisticDecaySimulator (Vessel vessel) (at <e538635aa29c46c79a58fd67e58a78b6>:0)
        WhitecatIndustries.Source.DecayManager.FixedUpdate () (at <e538635aa29c46c79a58fd67e58a78b6>:0)
        UnityEngine.DebugLogHandler:LogException(Exception, Object)
        ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
        UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
[EXC 22:45:14.684] NullReferenceException: Object reference not set to an instance of an object
        WhitecatIndustries.Source.Settings.ReadNB () (at <e538635aa29c46c79a58fd67e58a78b6>:0)
[...snip...]

 

I have not been using OD before, so if anybody with experience with this mod could weigh in with their observations, that would certainly help clear up any open questions.

 

 

 

Old inaccurate stuff:

Spoiler

  MM throws an exception, and KSP effectively hangs on loading, "verifying expansion assets" or something to that effect.

Spoiler

[...snip...]
[LOG 21:33:22.941] vallstone.prefab
[LOG 21:33:22.942] Expansion makinghistory detected in path /home/games/KerbalSpaceProgram/KSP/GameData/SquadExpansion/MakingHistory
[LOG 21:33:22.942] Expansion serenity detected in path /home/games/KerbalSpaceProgram/KSP/GameData/SquadExpansion/Serenity
[EXC 21:33:23.044] ReflectionTypeLoadException: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
        System.Reflection.Assembly.GetTypes () (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0)
        AssemblyLoader.GetTypesOfClassesImplementingInterface[T] () (at <ac04291822974a138f007b85091a10d0>:0)
        Expansions.Missions.MissionsUtils.InitialiseAdjusterTypes () (at <ac04291822974a138f007b85091a10d0>:0)
        Expansions.ExpansionsLoader+<LoadExpansions>d__21.MoveNext () (at <ac04291822974a138f007b85091a10d0>:0)
        UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <7d9ec060e791409ab3eb85c61e312ed6>:0)
        UnityEngine.DebugLogHandler:LogException(Exception, Object)
        ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
        UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
[LOG 21:33:23.044] [ModuleManager] Intercepted a ReflectionTypeLoadException. List of broken DLLs:
SCS 1.0.0.0 linux-1.9.1_orbitalDecayTest/GameData/WhitecatIndustries/SCS/SCS.dll
[---end of log file---]

 

Whether it might simply be a need for a recompile with newer Unity assemblies, or a more profound issue, I do not know, and ATM do not intend to look deeper into it.

 

 

 

EDIT:

PS.: It took me all of about five minutes to copy a clean KSP install, fire up CKAN to install only OrbitalDecay+ModuleManager, and launch (and shoot down) KSP.

Maybe the next person asking could instead do at least this simple test themselves and report their findings... that goes for each and every mod, not only this one.

 

EDIT2:

Caveat: DO read the original post, and compare what's stated there versus what CKAN tells you. Sometimes they differ, and by a large margin. Also, that makes your test cycle take quite a bit longer, but it's definitely worth it.

"Human decision required"–Moonbase Alpha Central Computer

Edited by Corax
Writing and editing this reply twice still took longer than the actual test procedure... food for thought.
Link to post
Share on other sites

Anyone testing this, make sure the Solar Cycle Simulator is also getting installed as a required dependency. ;)

And also note that forum user @kalmor did a 1.6.1 recompile of both Orbital Decay and Solar Sycle Simulator, to maybe try.

Edited by Stone Blue
Link to post
Share on other sites
3 hours ago, Stone Blue said:

[...] note that forum user @kalmor did a 1.6.1 recompile of both Orbital Decay and Solar Sycle Simulator, to maybe try.

Thanks, I hadn't seen that. However, deleting the original installation and installing kalmor's instead didn't make a difference for me. The exceptions are still there flooding the log, and none of the vessels and debris in orbit (previously and newly launched) showed any signs of orbital decay.

 

Link to post
Share on other sites
  • 2 months later...
  • 1 month later...
6 hours ago, linuxgurugamer said:

Is anyone working on these two mods?  Or is it just people asking about it?

As it appears to me, there is someone working on an WIP mod which plans to IMPLEMENT orbital decay and is requesting help (Ferram is supposedly on the case) when they get around to it, though I've not found any mods to perform a similar function past 1.4

The WIP mod mentioned is Principia by Eggrobin. The intention of this is primarily to establish more realistic game-physics.

Link to post
Share on other sites
1 hour ago, The_Revanchist said:

As it appears to me, there is someone working on an WIP mod which plans to IMPLEMENT orbital decay and is requesting help (Ferram is supposedly on the case) when they get around to it, though I've not found any mods to perform a similar function past 1.4

The WIP mod mentioned is Principia by Eggrobin. The intention of this is primarily to establish more realistic game-physics.

Principia is a total replacement of the physics in KSP.  As such it does not "compete" with this one at all.  It does a whole lot more, but comes with stability issues which most people won't want to deal with

 

Link to post
Share on other sites

A total physics rewrite seems like a sure recipe for a total mess.

This mod here though seems less ambitious (as if a decent orbit decay mod wasn't enough of a challenge already) and it would be swell if someone would pick it up. As far as I am aware there is not another complete mod for that and this one, at least, used to work back then.

Link to post
Share on other sites
3 hours ago, Daniel Prates said:

A total physics rewrite seems like a sure recipe for a total mess.

This mod here though seems less ambitious (as if a decent orbit decay mod wasn't enough of a challenge already) and it would be swell if someone would pick it up. As far as I am aware there is not another complete mod for that and this one, at least, used to work back then.

I'm working on updating it.

Oddly enough, I found stuff in it which would have never worked, I'm wondering if I got an intermediate version.

I'm also going to merge the SolarCycleSimulator with this, it will have it's own DLL, but a single distribution, since I'm not aware of any other mod which uses it

Link to post
Share on other sites
5 hours ago, linuxgurugamer said:

since I'm not aware of any other mod which uses it

double-check with the Kerbalism devs? Not sure what's going into their latest update. But they have solar storms and such, which would go well with the solar cycle sim

Have you also looked into this? Compatibility with KSPTOT would make this mod much more useful as people will have a great external tool to help manage the decay

 

Link to post
Share on other sites

I'm currently working on my Photon Sailor  mod, which has orbital decay simulation and considered extending it to all vessels. I wondered how it could be achieved realisticly and how this mod calculatded drag and mass, but after looking at the code I concluded, it doesn't, it simply assumes everything is a brick of 1 ton with the drag surface of 1 square meter. That was a bit of a dissapointment.

Edited by FreeThinker
Link to post
Share on other sites
On 7/24/2020 at 7:33 PM, FreeThinker said:

I'm currently working on my Photon Sailor  mod, which has orbital decay simulation and considered extending it to all vessels. I wondered how it could be achieved realisticly and how this mod calculatded drag and mass, but after looking at the code I concluded, it doesn't, it simply assumes everything is a brick of 1 ton with the drag surface of 1 square meter. That was a bit of a dissapointment.

Actually, it does appear that it gets the mass of the vehicle, see the VesselData.cs, line 355.: https://github.com/linuxgurugamer/OrbitalDecay/blob/e0d4a511aeaf66c88e94bfa128e9009771d345de/OrbitalDecay/VesselData.cs#L355-L376

It also calculates the vessel area, see, same file, line 261-295

https://github.com/linuxgurugamer/OrbitalDecay/blob/e0d4a511aeaf66c88e94bfa128e9009771d345de/OrbitalDecay/VesselData.cs#L261-L295

 

 

Edited by linuxgurugamer
Link to post
Share on other sites
On 7/24/2020 at 7:33 PM, FreeThinker said:

I'm currently working on my Photon Sailor  mod, which has orbital decay simulation and considered extending it to all vessels. I wondered how it could be achieved realisticly and how this mod calculatded drag and mass, but after looking at the code I concluded, it doesn't, it simply assumes everything is a brick of 1 ton with the drag surface of 1 square meter. That was a bit of a dissapointment.

If you are installing this on an old save, you have to load each active craft (and debris) to get the real mass and area for drag calculations, otherwise it uses a hack to estimate the mass and area, which can result in really weird decay calculations (for example a spent kick stage remaining in orbit far longer than the payload it kicked). But rest assured it does actually use the correct mass and area for drag calculations if it is able to access the correct values, which it can only do in a flight scene with a craft in physics range. A new save with this mod won't experience this because every craft launched will have its mass and area recorded.

 

@linuxgurugamer since you are picking this up, I figure I'd let you know about the bugs I am currently seeing using @kalmor's recompile, since they are old bugs that go back to the last versions in @Whitecat106's git and possibly when @Papa_Joesplit off SCS from the main mod (although this might have existed before as well).

First is the LAN == 0. If you are seeing LANs getting set to 0 or something very close to zero, look at the Mascon calculations as doing this workaround eliminates that problem, but it basically eliminates mascon calculations by removing the gravity maps and setting alternate = true in the mascondata.cfg file: 

 

@Starwaster seemed to think it was the mascon calculations applying too much change to LAN but I don't believe it is that as I watched a probe and either its decoupler or kick stage both get changed from a LAN of ~ 180 to a LAN very close to 0, while most of the other orbital parameters didn't change appreciably enough to be noticed. The third piece, either the kick stage or decoupler, didn't change orbital parameters. If mascons were influencing the orbit that much, I imagine it would have changed the SMA and ECC as well which wasn't observed as other drag factors were negligible and the orbits are close to 90 degree inclination. I think it might be failing to find a craft's LAN and then using 0 as the LAN and then applying mascon deviations to that 0 (which is why it always winds up close to 0 but never exactly that) and then writing that new value.

 

The other major bug I'm seeing is with the Solar Cycle Simulator, the solar cycle is (or was) being reset. After making the mascon workaround I haven't experienced it resetting yet but I don't know if it was because of that or it was just incidental. I do know that currently it has saved a node for the solar cycle now, however I don't know if it was saving one before since I didn't check it before deleting and reinstalling the mod and reverting my persistent file (was more concerned with figuring out the mascon issue). It could have been getting reset because it wasn't saving the node for the current solar cycle, making it create a new solar cycle every time you went to a flight scene. If I see it reset again in my current save, I'll check on the saved node and see if it's creating a new cycle or overwriting one that should still be ongoing.

 

I don't have your current updates as I'm still on 1.7.3 (and the 1.8 compiled dll just won't run at all on 1.7.3) and you might have fixed either of these issues with the updates you've done, but if you do see either of these things happening then it likely isn't a change you've made. I'm just bringing it to your attention before it makes you crazy and they were previously reported bugs that might have gotten buried in the respective threads. Not sure about the scope you intend for this mod, but @Whitecat106seemed to be making it into a Principia-lite with the Nbody stuff but I'm not really sure that's necessary. Mascons would need to be fixed or some sort of hack used to simulate them though as they are the only significant source of orbital decay for orbits above LKO or around airless bodies. My Explorer 1 that is roughly in the same orbit as the real life version is never coming down with the mascon workaround I did above (decay is listed as negligible), but without the work around it does decay above a "negligible" amount. Anyway hope that helps some, as I really want a mod that decays orbits rather than me going into the tracking station and destroying debris and craft according to my ad hoc basis of that should have come down already.

 

Link to post
Share on other sites
On 7/30/2020 at 2:50 PM, Starwaster said:

@draqsko It wasn't a matter of applying too much change, it just wasn't (or isn't) calculating it properly. 

The issue is likely to be in this code here but this is as far as I traced it.

http://github.com/Whitecat106/OrbitalDecay/blob/master/Source/MasConManager.cs#L1190-L1316

I just happened to have an orbit that was at a LAN of 180 and at close to 90 degree inclination and it flipped the orbit entirely on two parts out of three in the same orbit (or close to the same orbit, the Ap/Pe was a little different but inclination and LAN were the same because it was a payload, separator and kick solid). The thing is, the two parts that wound up at close to zero LAN, actually had different values of LAN on either side of zero, one was slightly positive and one was slightly negative yet both were changed at the same instant as I was watching for that after looking at the issues in the git and in the forum thread.

It seemed to me to be throwing the value to zero first and then adjusting it based on mascon given that both objects that changed orbit were about a quarter of the orbit apart and therefore would have had different mascon influences on their orbit. The difference was large enough to not be a rounding error. I was just commenting on what I observed to hopefully help LGG or someone figure out what was going wrong. There were other objects that shifted LAN to close to zero as well but that one was particularly bad given what the original LAN was.

Looking at your git link, I think this is wrong:

            double NewLAN = LAN + RateOfChangeOfLANDeltaTime;
            return RateOfChangeOfLANDeltaTime;

Shouldn't it return NewLAN not RateOfChangeOfLANDeltaTime? The values I'm seeing are what the rate of change should be, not the final value of the LAN, and of course those would be close to zero but on either side of it.

 

Edit: I'm going to have to poke at that file tomorrow with a code viewer, git is ok but it really messes with my eyes and a code viewer makes it much easier to see.

Edited by draqsko
Link to post
Share on other sites

@draqsko

It's hard to say for sure. I wish I had had more time to look through the code.

Looking only at the section  you've pointed out, it definitely is odd that it is discarding NewLAN like that. Was it meant to return a delta or the absolute new LAN value? The way that return value is used elsewhere makes me think it's not actually meant to be the absolute new value. Maybe @Whitecat106 was going one way and then changed his mind. And changed the code but left that one bit in (NewLAN = ...)

Looking at it again and I notice that in https://github.com/Whitecat106/OrbitalDecay/blob/6d648de50261a63fb170f9863106f21ba5131542/Source/DecayManager.cs#L859-L862

It's treating things a bit differently if less than timewarp x100. And the first part of that is scaled by current rate of warp. I would think you would scale it by deltaTime or fixedDeltaTime instead. And why does it only scale the first calculation and not the others?

And if it's x100 or greater then GetSecularLANChange is used instead and I didn't notice that before. So what speeds is this actually happening at? Maybe that one needs to be looked at too.

It's all a bit inconsistent and again I really wish I had had more time to look at things when I tried to help before.

Link to post
Share on other sites
7 hours ago, Starwaster said:

And if it's x100 or greater then GetSecularLANChange is used instead and I didn't notice that before. So what speeds is this actually happening at? Maybe that one needs to be looked at too.

That could be the issue right there. The only time I've observed a shift in LAN so far has been after a high time warp. In the case cited above, I was flying a few pieces of debris from my failed Pioneer P-30 mission (first Munar orbit attempt in this save) that wound up being botched because I lost signal before the burn end. After burning them up in the atmosphere of Kerbin, went back to KSC, then tracking station and seen what I reported above so it had to happen during that flight with timewarp, as I went to the tracking station before that to actually switch to that debris and didn't see any noticeable change in orbits at that time. I didn't check every piece of debris, but every active payload appeared to be fine as I was checking for station keeping working with LFO or something other than MP since the cfg file only had MP listed as a resource but apparently that doesn't matter any more.

So the conditions I've observed so far with a shift in LAN involved a high timewarp, change in SOI in a flight scene, burning up a craft in the atmosphere and changing the scene from flight scene to KSC to Tracking Station. I think I'll restore that Mascon file and see if I can get a change in LAN while in a flight scene at high timewarp in my current save, should be fairly obvious when it happens if I stay in map mode as I got a ton of junk in orbit (one of the reasons I installed this, to bring down debris and broken payloads).

 

@linuxgurugamer Did you start a new thread for maintaining this mod? If so I'll carry on this discussion there and let the mods close this one out.

Link to post
Share on other sites
1 hour ago, draqsko said:

@linuxgurugamer Did you start a new thread for maintaining this mod? If so I'll carry on this discussion there and let the mods close this one out.

I started a new thread here:

I released it as a beta, I'm still deep inside a couple of other mods, so this is going to have to wait until I have some time.  All the comments above are great and useful.  

My repo is here:  https://github.com/linuxgurugamer/OrbitalDecay/

And if anyone actually fixes it before I do, please submit a PR and I'll gladly merge it after review.

 

 

Link to post
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...