Jump to content

[1.4.3 <= KSP <= 1.12.5] KSP Recall - 0.4.1.0- 2024-0407


Lisias

Recommended Posts

3 hours ago, TranceaddicT said:

Second,LOGS.

Without logs, I'm alone on the dark with a pretty nasty SAS biting beast around. But in 0.001% of the cases, that beast is so smelly that we can identity it without the log just by sniffing. And with 600MB of log, it's hard to upload this monumental pile of bad news to to any service (even by zipping it).

I don't have a solution for this case yet (huge logs). I think we are in the need of a in situ pre-analysis tool...

Had not I messed up this one, and then it would be a a rogue interaction or mispatching, extract manually the needed info from that 600MB of logs would be a hell of a job.

 

3 hours ago, Darkherring said:

Hi, I've got a massive spam in the KSP.log file. It expanded to over 600MB

It's spammed mostly with 
[EXC 22:35:33.560] NullReferenceException: Object reference not set to an instance of an object
    KSP_Recall.Driftless.FixedUpdate () (at <68468174186e4582a5c4f9fccd1989fb>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

I think it starts at the moment of landing.

Well, I borked so magnificently on this one that I'm surprised it took so long to someone to kick my balls on it.

I forgot that on loading savegames, the OnStart is not called, just the OnLoad. #facePalm.

If you are on KSP 1.9, delete 999_KSP-Recall/Plugins/Driftless.dll for while. if you are on any other KSP, delete the whole thing for now.

You will have a fix for it tonight. Stay tuned, and sorry for that.

-- -- POST EDIT -- --

Found the problem! Boy, that was just... "stupid". :sticktongue:

[LOG 20:21:42.985] [KSP-Recall-Driftless] TRACE: telescopicLadder:FFFAA7DE has no RigidBody.

Since I'm on the code, I'm trying to fine tune the work around to see if I can improve the stunt.

In a way or another, I will release the fix in two hours more or less (unless something else happens, of course :P - Murphy is hearing!!!)

-- -- POST POST EDIT -- --

Interesting... Kerbals are being Started, Initialized, Saved, etc, twice...

[LOG 20:41:07.894] [KSP-Recall-Driftless] TRACE: OnAwake femaleEVA(Clone)(Clone):FFF9D694
[LOG 20:41:07.962] [KSP-Recall-Driftless] TRACE: OnAwake femaleEVA(Clone)(Clone):FFF9D694
[LOG 20:41:07.966] [KSP-Recall-Driftless] TRACE: OnInitialize femaleEVA(Clone)(Clone):FFF9D694
[LOG 20:41:07.966] [KSP-Recall-Driftless] TRACE: OnInitialize femaleEVA(Clone)(Clone):FFF9D694
[LOG 20:41:07.977] [KSP-Recall-Driftless] TRACE: OnStart kerbalEVAfemale (Maxeny Kerman):FFF9D694 Flying True
[LOG 20:41:07.978] [KSP-Recall-Driftless] TRACE: OnStart kerbalEVAfemale (Maxeny Kerman):FFF9D694 Flying True

No relation with anything, just something curious I wanted to keep registered somewhere...

-- -- POST POST POST EDIT -- --

Interesting². Kerbals have twenty times the maximum "spurious velocity" than the Aegis. I Wonder their events above being called twice also implies that the FixedUpdate are also being called twice? This would double the amount of noise on the parameters I'm suppressing with this stunt...

Edited by Lisias
POST POST POST edit
Link to comment
Share on other sites

ANNOUNCE

KSP Recall 0.0.4.1 in on the Wild, featuring:

  • A fix for the infinite NRE on the dedriftification - some parts just don't have a RigidBody, and I didn't told the code about it.
  • Kerbals on EVA suffers 20 times more drifting than the craft used on the testing(Aegis 3A). They now drifts less too.
  • Saving a tiny bit of CPU doing smarter handling of inactive and rigidbodyless parts.

On my tests, I managed to leave a craft alone for 15 minutes without drifting a single degree, but once I got about 22 degrees after 45 minutes (still better than 1 degree each 2 or 3 seconds, though)- as I said: it's a work around, not a fix.

Female Kerbals apparently drift more than males - the spurious velocity on males never reaches 18mm/s, but the females reached about 20 to 21mm/s. At least, on my rig. This information may be biased however, apparently VesselMover is spawning preferably females on my savegame, and so perhaps the extra drift is due this Kerbal being spawned second.

For sadistic Kerbonauts that don't refrain themselves from torturing their gaming machines, adjusting the Maximum Physics Delta-Time Per Frame to 0.03 gave some marginal positive results on the crafts on my i7 MacPotato, but the Kerbals drifted sensibly more. Given the randomness of the amount of drifting we get on every game restart, take this information with a huge grain of salt.

Note: Wheels and Landing Legs also drifts, but due different reasons - so, in fact, we have two sources of drifting on KSP >= 1.8 right now. The present Recall version does not (yet) fixes the wheels' drift (besides helping a very little bit, as there's one less source of drifting now).

Finally, the Driftless PAW now appears only on flight. Resourceful still appears only on Editor.

Good Luck!  


This Release will be published using the following Schedule:

  • GitHub, reaching manual installers first and users of KSP-AVC. Right now.
  • CurseForge, Right now.
  • SpaceDock (and CKAN users), Right now.
Link to comment
Share on other sites

I'm experiencing some issues with 0.4.1, as opposed to 0.4.0. Firstly, ALL decoupling parts are always staged, even when disabled (docking ports, heat shields). Secondly, I've had a visual glitch where a ship displays 0 Δv even when it has more than that, although this doesn't happen with every ship.

Here's one of my ships on 0.4.0:

mNfhTW6.jpg

And here's the same ship, same save, on 0.4.1:

By7e6K3.jpg

I'm reasonably sure it's KSP Recall that's causing this behavior, because reverting to 0.4.0 makes it go away.

Link to comment
Share on other sites

13 hours ago, BTAxis said:

I'm experiencing some issues with 0.4.1, as opposed to 0.4.0. Firstly, ALL decoupling parts are always staged, even when disabled (docking ports, heat shields). Secondly, I've had a visual glitch where a ship displays 0 Δv even when it has more than that, although this doesn't happen with every ship.

What's your KSP version? I'm using KSP 1.10.1 right now and I reproduced the decoupler's problem - its related to Driftless, I just don't understand how. Yet.

But that other problem on the DeltaV. that one I couldn't. I'm firing up KSP 1.9 to see if Resourceful is involved on this one.

It may be also a Unholy Interaction between modules (Kraken Food). Please send me your KSP.log, perhaps it has a hint about where to look for this one.

-- -- -- POST EDIT -- --

I found the problem with the Staging! I should had paid more attention to the API Documentation!

I'm using OnActive and OnInactive in an attempt to save a tiny little  bit of CPU by avoiding checking things again and again on the FixedUpdate, and didn't realized that overriding OnActive would automatically means it's stageable - it makes no sense to me, but it's documented on the API, so... :)

This one is tackled down.

Edited by Lisias
post edit
Link to comment
Share on other sites

 

32 minutes ago, Lisias said:

What's your KSP version?

I'm on 1.9.1. As I said, the Δv  issue doesn't happen all the time - I only saw it on that one ship actually. I think I launched that ship before switching Recall versions; I know for a fact that this did not happen with a ship I launched afterwards. That may or may not be significant. If it is, it's probably a bit of a non-issue in the long term.

I should also note that I play with a number of other mods, notably Kerbalism.

Link to comment
Share on other sites

2 hours ago, BTAxis said:

I'm on 1.9.1. As I said, the Δv  issue doesn't happen all the time - I only saw it on that one ship actually. I think I launched that ship before switching Recall versions;

Can you send me this ship for analysis, please? Besides being more an annoyance than a problem, I don't know why this is happening and there's a chance that this could be the trigger for something else.

In time, I nailed the problem on the Staging. it's something unexpected on the KSP API that I didn't realized until now (see here). As soon as I get this one on Resourceful under control, I will release the fix! :)

Edited by Lisias
Kraken damned auto-completions!! :/
Link to comment
Share on other sites

Just now, Lisias said:

Can you send me this ship for analysis, please? Besides being more or an annoyance than a problem, I don't know why this is happening and there's a chance that this could be the trigger for something else.

I've been poking around a bit more, and it seems it's not a problem with the ship design or anything else I can identify. It seems isolated to this specific ship. Launching another with the exact same design does not replicate the problem, nor do any of my other in-flight ships exhibit the same behavior.

That being said, I have uploaded the ship, which is fairly basic. The only noteworthy thing about it is that it uses a ReStock Plus engine, but I don't think that's in any way related.

I've also included the save and a .ckan export of my current mod setup. On top of the CKAN mods I also run KerbalFlightIndicators and Soundtrack Editor Forked, which I did not get through CKAN but from Github.

Link to comment
Share on other sites

1 hour ago, BTAxis said:

I've been poking around a bit more, and it seems it's not a problem with the ship design or anything else I can identify. It seems isolated to this specific ship. Launching another with the exact same design does not replicate the problem, nor do any of my other in-flight ships exhibit the same behavior.

That being said, I have uploaded the ship, which is fairly basic. The only noteworthy thing about it is that it uses a ReStock Plus engine, but I don't think that's in any way related.

I've also included the save and a .ckan export of my current mod setup. On top of the CKAN mods I also run KerbalFlightIndicators and Soundtrack Editor Forked, which I did not get through CKAN but from Github.

Have you run a diff on the two craft?  That'll tell you what's unique to that craft.

Edited by TranceaddicT
Link to comment
Share on other sites

28 minutes ago, TranceaddicT said:

Have you run a diff on the two craft?  That'll tell you what's unique to that craft.

I've just tried that, but the diff is pretty huge because the various data structures didn't get serialized in the same order for both craft. It doesn't seem very helpful.

Link to comment
Share on other sites

32 minutes ago, BTAxis said:

I've just tried that, but the diff is pretty huge because the various data structures didn't get serialized in the same order for both craft. It doesn't seem very helpful.

Upload it.  I'll do some reorganizing for excrementss-n-giggles when I need a break from overhauling RO's KSPedia.

(Mind-numbing ADHD tasks can be a good thing too.)

Link to comment
Share on other sites

1 minute ago, TranceaddicT said:

Upload it.  I'll do some reorganizing for excrementss-n-giggles when I need a break from overhauling RO's KSPedia.

I've put the data for the ships up on the google drive I linked earlier. Just to recap, Ship1 is the original craft, the one that has the issue seen in my screenshot. Ship2 is another instance of the same design which is sitting at the launch pad (because it can't get off Kerbin on its own). It works as you'd expect. I did also test it in space via KRASH, but I can't save in the middle of a sim, so.

Link to comment
Share on other sites

1 minute ago, TranceaddicT said:

Do you have AQSS?

It'll do it.

Put your ship on the pad wait 10 minutes and proof "quicksave complete" 

Oh, saving on the pad isn't a problem. My comment was about putting it in space without launching normally. I just figured I'd put it in the same conditions as the other one, but ah well.

 

Link to comment
Share on other sites

Okay, some progress. After the exchange above, it occurred to me that this could be related to the actual launch I used on the original ship.

It is, kind of.

The original launch consists of that lander, mounted atop a rocket, connected by a docking port and some struts. The docking port (on the lander's side), crucially, has its crossfeed disabled so its fuel doesn't get used by the launch vehicle. I simmed the detach in space, and yep, Δv shows zero. I could get it to zero out on the rocket too by disabling its crossfeed, even after detach.

I've put the launch vehicle design up on the Gdrive linked above. You can test this on the launchpad. Manually decouple the upper stage (it should balance on the rocket), and switch to it with ]. It should have 0 Δv. Re-enabling the crossfeed doesn't fix it, though.

Edited by BTAxis
Englishing all proper like.
Link to comment
Share on other sites

18 hours ago, BTAxis said:

Okay, some progress. After the exchange above, it occurred to me that this could be related to the actual launch I used on the original ship.

It's possible, but I think it's unrelated. I had written that Resourceful stunt and there's nothing on it that it's influenced by anything else but the presence of RESOURCES and some Editor and PartModule life cycle events.

Of course, it could be somehow triggering something else to misbehave, but then it should be happening before 0.0.4.1, and you made it clear that the first time you got the stunt was on 0.0.4.1 . So I'm guessing it's something that changed between 0.0.4.0 and 0.0.4.1 .

The first thing I tried was to create a test bed for your SFS, and by loading it:

iXbbIhn.png

It works for me. :P Oh, well...

Now we are back to inferring, it's cold around here, where I put my Sherlock Holmes style hat? :sticktongue: Let's trying a differential, what changed on 0.0.4.1 that could trigger something on you?

The Resourceful's PartModule code had only one change, on the PAW definition, and it only made explicit something that was implicit without changing any previous feature...

BUT... I had a complain about Resourceful failing to help a FS, and investigating, I realised that such FS were adding RESOURCE at runtime on a part without resources on the prefab. In order to fix that, I rewrote the patch to shove Resourceful on anything, as it's impossible to foresee when something would apply a resource on something else in the middle of the gaming, and Resourceful is well behaving enough to detect when there's no resource available and waive running. It's not a decision I took lightly (I hate to just shoving things where it can be not needed), but I could not came with anything else that would not need a hell of an extensive research on every Fuel Switch available (and then hoping for no one changing them).

So this change can explain why something involving resources happened to you on 0.0.4.1 but not on 0.0.4.0 . But why in hell a kraken damned engine? Engine has no RESOURCE, only PROPELLANT!

Well, the answer are on the craft file, indeed. The restock-engine-pug has resources:

  RESOURCE
  {
    name = LiquidFuel
    amount = 18
    maxAmount = 18
  }
  RESOURCE
  {
    name = Oxidizer
    amount = 22
    maxAmount = 22
  }

Part of the mystery is solved. I now know why you got bitten. But still don't have a clue about how. :/ 

-- -- -- POST EDIT -- -- -- 

I have a theory - it's more a wild guess, but it appears to make sense.

Since KSP 1.5 or 1.6 (I just detected it on 1.7), KSP has a thingy called UpgradeScripts (using another thingy I still learning about called SaveUpgradePipeline). It appears to be, essentially, why you can load older KSP versions crafts and savegames and still be able to use them besides all the changes KSP had passed through.

Of course, I don't have the slightest idea when this thingy runs, but since I know how and when Resourceful runs, and knowing that this upgrade thingy shoves zeroed missing RESOURCEs on a part when it differs from the prefab (it was how I detected it, I used to toy with the SFS on the 1.4.x era and when I migrated to 1.7, I couldn't do it anymore the same), I think that somehow this migration script acted on the very same time Resourceful was caching the resources. Foreseeing this possible toe stomping fest, Resourceful restores copies of the cache using a critical section (but the critical section only works for Resourceful own data structures, it can't magically protect internal KSP engine ones).

So, there's a tiny little time window on this process in which something (and I'm guessing is the UpgradePipeline) could be injecting zeroed resources on that engine, and then some part of KSP could had fetched this data by plain bad luck, and then Resourceful restores the intended data and you get what your screenshot shows: a GUI saying you are out of gas, but the rest of the game would be using the restored resources where there's some gas.

Take what I said on this post edit with a huge grain of salt - it's all inferences. Pretty well educated guess, but still a guess.

I couldn't think on anything else, however.

--- post post edit ---

I failed to explain why the UpgradePipeline may be involved on the mess: once you install 0.0.4.1, a part that wasn't being previousl patched, now is. So some parts on the prefab now have the Resourceful, while on the savegame not. Then you load the savegame, the UpgradePipeline detected the engine's prefab has somerhing missing on the savegame and decided to act. And by some metaphysical twist of fate :P the engine with resources would had triggered the misbehaviour I suggested.

-- -- post post post edit -- -- --

"All of those clever reasons were wrong." -- House, Gregory. M.D. :P

-- -- POST POST POST POST EDIT

Not all of them. T, Lisias. BDFH

Edited by Lisias
POST POST POST POST EDIT
Link to comment
Share on other sites

6 hours ago, Lisias said:

It works for me. :P Oh, well...

I noticed in your screenshot that you have the full SAS range at your disposal, so you probably loaded it in sandbox mode. My save was made in career mode. I tried loading my own save in a sandbox game, and it works normally for me then too.

Derp, turns out I was running on 0.4.0. The above is nonsense. Sandbox mode makes no difference for me.

Edit 2: Okay, but I do know why it's not happening for you. You fixed the first bug, the one where the docking port is always staged. The 0 Δv thing ONLY happens if the docking port is staged BEFORE the engine, or is in the same stage:

ACbG9c0.png

So I guess it's de facto fixed already?

Edited by BTAxis
I did a stupid.
Link to comment
Share on other sites

12 minutes ago, BTAxis said:

Derp, turns out I was running on 0.4.0. The above is nonsense. Sandbox mode makes no difference for me.

I inspected the VESSEL node for the lander can line by line, and it looks fine. And it loaded fine too, and worked as expected. But i was on 0.0.4.1.

That savegame had Resourceful on the pug engine, so it's obvious it would run fine here.

Assuming I'm right, the problem happens by saving on 0.0.4.0 (that doesn't patches engines) and then loading on 0.0.4.1 (that patches the engine, and so the prefab would be different then then sfs, and UpdatePipeline would be triggered).

So, in essence, I didn't really reproduced the needed steps, I gone straight to the last step and claimed success.

Later after job I will install 0.0.4.0, start a new game with the Lander, then save it, update to 0.0.4.1, fire up the game and see what I get.

Let's try a stunt in the mean time: Install 0.0.4.1, then copy the CFG files from the 0.0.4.0 over the new ones. This will tell us if my hypothesis has merit.

 

 

Link to comment
Share on other sites

By the way, there's one more weird thing that I'm experiencing. When flying, my ships will send themselves into a spin using their attitude controls if SAS is off (all ships do this). I'm not really sure if this is related to Recall, but I did just switch from 0.4.1 to 0.4.0 and the behavior went away. However, that might be a coincidence, because I get the feeling this randomly happens in some play sessions, and not in others. I'm still asking though, in case you can reproduce. If not, then don't worry about it.

Link to comment
Share on other sites

5 hours ago, BTAxis said:

Edit 2: Okay, but I do know why it's not happening for you. You fixed the first bug, the one where the docking port is always staged. The 0 Δv thing ONLY happens if the docking port is staged BEFORE the engine, or is in the same stage:

So I guess it's de facto fixed already?

Good catch! It must be something else on the API that I'm not aware. I will make a Pre Release for 0.0.4.2 in the next few hours and advise you in PM, so you can test it on you rig!

Thanks for the debugging!

 

3 hours ago, BTAxis said:

By the way, there's one more weird thing that I'm experiencing. When flying, my ships will send themselves into a spin using their attitude controls if SAS is off (all ships do this).

Remove Driftless.dll from the GameData and try again. Driftless zeroes the rotation forces if the magnitude of the vessel's velocity is smaller than a delta, but only when the craft situation is LANDED. Or at least is what I expect the code to do - but you may had found yet something I need to double-check due some API idiosyncrasy.

Link to comment
Share on other sites

3 hours ago, BTAxis said:

By the way, there's one more weird thing that I'm experiencing. When flying, my ships will send themselves into a spin using their attitude controls if SAS is off (all ships do this). I'm not really sure if this is related to Recall, but I did just switch from 0.4.1 to 0.4.0 and the behavior went away. However, that might be a coincidence, because I get the feeling this randomly happens in some play sessions, and not in others. I'm still asking though, in case you can reproduce. If not, then don't worry about it.

I worked this out. FAR's roll stabilization was somehow enabled, which causes weirdness in space. Nothing to do with you!

Link to comment
Share on other sites

9 hours ago, BTAxis said:

I noticed in your screenshot that you have the full SAS range at your disposal, so you probably loaded it in sandbox mode. My save was made in career mode. I tried loading my own save in a sandbox game, and it works normally for me then too.

Derp, turns out I was running on 0.4.0. The above is nonsense. Sandbox mode makes no difference for me.

Edit 2: Okay, but I do know why it's not happening for you. You fixed the first bug, the one where the docking port is always staged. The 0 Δv thing ONLY happens if the docking port is staged BEFORE the engine, or is in the same stage:

ACbG9c0.png

So I guess it's de facto fixed already?

I tried the stunt using 0.0.4.1 on my rig and your savagame. No dice. Still works for me.

Bellow, the three possibilities on a recently cheated into space Lander:

Spoiler

A9flR8q.png

0w0UqZ0.png

dH2C7Oy.png

But... That was a new Lander, instantiated after upgrading to 0.0.4.1.

Then I tried your test on the currently flying crafts on the savegame, that were instantiate before you had updated to 0.0.4.1:

48d6Xb2.png

And WE HAVE A BINGO! :) You nailed it, the problem just happens when you shove the problematic part before the engine on crafts instantiated before updating to KSP 0.0.4.1!! :)  I'm guessing it is blocking the fuel flow (but the KSP code is ignoring that this engine has its own resources on it - it's possible that you had found also a flaw on KSP itself! :D ).

I'm building a pre-release for you, and I will come back to you soon!

Edited by Lisias
Eternal Typos of the Englishless Mind.
Link to comment
Share on other sites

ANNOUNCE

KSP Recall 0.0.4.3 in on the Wild, featuring:

  • A fix for the infinite NRE on the dedriftification - some parts just don't have a RigidBody, and I didn't told the code about it.
    • And now without blocking fuel when applied on Decouplers and Docking Ports below engines on staging. 
  • Saving a tiny bit of CPU doing smarter handling of inactive and rigidbodyless parts.

On my tests, I managed to leave a craft alone for 15 minutes without drifting a single degree, but once I got about 22 degrees after 45 minutes (still better than 1 degree each 2 or 3 seconds, though) - it all depends of your CPU and how many parts are being active on the scene.

Kerbals are just another part on the scene. Depending on how many parts are in physics range (and their position on the list), they will or will not drift even with Recall installed.

For sadistic Kerbonauts that don't refrain themselves from torturing their gaming machines, adjusting the Maximum Physics Delta-Time Per Frame may render good results. If your CPU is near the limit (flickering the timestamp on top left to yellow), you may want to increase it a bit.

Constant CPU overloads (time stamp on top left is always yellow or even red) are currently known to heavily inducing drifting, as this situation apparently aborts the FixedUpdate on some Modules (and so Driftlessis rendered useless).

Note: Wheels and Landing Legs also drifts, but due different reasons. However, it was realised that Driftless prevents, most of the time, the situation that triggers the Wheels and Legs drift. So it ended up being a fix, after all. :)

Finally, the Driftless PAW now appears only on flight. Resourceful still appears only on Editor.

Good Luck!  


This Release will be published using the following Schedule:

  • GitHub, reaching manual installers first and users of KSP-AVC. Right now.
  • CurseForge, Right now.
  • SpaceDock (and CKAN users), Right now.
Edited by Lisias
Of cuorse, tyops!
Link to comment
Share on other sites

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...